os-rust/tests/ui/object-safety/object-safety-phantom-fn.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
317 B
Rust
Raw Normal View History

// Check that `Self` appearing in a phantom fn does not make a trait not object safe.
//@ build-pass (FIXME(62277): could be check-pass?)
#![allow(dead_code)]
2015-03-31 19:58:01 -04:00
trait Baz {
}
2015-03-31 19:58:01 -04:00
trait Bar<T> {
}
2019-05-28 14:46:13 -04:00
fn make_bar<T:Bar<u32>>(t: &T) -> &dyn Bar<u32> {
t
}
2019-05-28 14:46:13 -04:00
fn make_baz<T:Baz>(t: &T) -> &dyn Baz {
t
}
fn main() {
}