mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
23 lines
317 B
Rust
23 lines
317 B
Rust
// 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)]
|
|
|
|
trait Baz {
|
|
}
|
|
|
|
trait Bar<T> {
|
|
}
|
|
|
|
fn make_bar<T:Bar<u32>>(t: &T) -> &dyn Bar<u32> {
|
|
t
|
|
}
|
|
|
|
fn make_baz<T:Baz>(t: &T) -> &dyn Baz {
|
|
t
|
|
}
|
|
|
|
|
|
fn main() {
|
|
}
|