]> git.lizzy.rs Git - rust.git/blob - tests/ui/object-safety/object-safety-phantom-fn.rs
Rollup merge of #106605 - notriddle:notriddle/outdated-rustbook, r=GuillaumeGomez
[rust.git] / tests / ui / object-safety / object-safety-phantom-fn.rs
1 // Check that `Self` appearing in a phantom fn does not make a trait not object safe.
2
3 // build-pass (FIXME(62277): could be check-pass?)
4 #![allow(dead_code)]
5
6 trait Baz {
7 }
8
9 trait Bar<T> {
10 }
11
12 fn make_bar<T:Bar<u32>>(t: &T) -> &dyn Bar<u32> {
13     t
14 }
15
16 fn make_baz<T:Baz>(t: &T) -> &dyn Baz {
17     t
18 }
19
20
21 fn main() {
22 }