Files
rust/tests/ui/dyn-compatibility/phantom-fn.rs

23 lines
318 B
Rust
Raw Normal View History

// Check that `Self` appearing in a phantom fn does not make a trait dyn-incompatible.
//@ 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() {
}