rust/src/test/ui/object-safety/object-safety-phantom-fn.rs
2018-12-25 21:08:33 -07:00

23 lines
273 B
Rust

// Check that `Self` appearing in a phantom fn does not make a trait not object safe.
// compile-pass
#![allow(dead_code)]
trait Baz {
}
trait Bar<T> {
}
fn make_bar<T:Bar<u32>>(t: &T) -> &Bar<u32> {
t
}
fn make_baz<T:Baz>(t: &T) -> &Baz {
t
}
fn main() {
}