summaryrefslogtreecommitdiffstats
path: root/tests/ui/object-safety/object-safety-phantom-fn.rs
blob: 3ffeb81c1cbe37b3fd444470732d795abb4154b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// 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() {
}