]> git.lizzy.rs Git - rust.git/blob - src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.rs
Merge commit '3e7c6dec244539970b593824334876f8b6ed0b18' into clippyup
[rust.git] / src / test / ui / object-lifetime / object-lifetime-default-from-rptr-box-error.rs
1 // Test that the lifetime from the enclosing `&` is "inherited"
2 // through the `Box` struct.
3
4 #![allow(dead_code)]
5
6 trait Test {
7     fn foo(&self) { }
8 }
9
10 struct SomeStruct<'a> {
11     t: &'a Box<dyn Test>,
12 }
13
14 fn c<'a>(t: &'a Box<dyn Test+'a>, mut ss: SomeStruct<'a>) {
15     ss.t = t; //~ ERROR mismatched types
16 }
17
18 fn main() {
19 }