]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-14229.rs
Merge commit '97e504549371d7640cf011d266e3c17394fdddac' into sync_cg_clif-2021-12-20
[rust.git] / src / test / ui / issues / issue-14229.rs
1 // run-pass
2 trait Foo: Sized {
3     fn foo(self) {}
4 }
5
6 trait Bar: Sized {
7     fn bar(self) {}
8 }
9
10 struct S;
11
12 impl<'l> Foo for &'l S {}
13
14 impl<T: Foo> Bar for T {}
15
16 fn main() {
17     let s = S;
18     s.foo();
19     (&s).bar();
20     s.bar();
21 }