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