]>
Commit | Line | Data |
---|---|---|
a1dfa0c6 XL |
1 | fn main() { |
2 | { | |
3 | let mut _thing1 = D(Box::new("thing1")); | |
4 | { | |
5 | let _thing2 = D("thing2"); | |
6 | side_effects(); | |
7 | D("other").next(&_thing1) | |
8 | //~^ ERROR does not live long enough | |
9 | } | |
10 | } | |
11 | ||
12 | ; | |
13 | } | |
14 | ||
15 | #[derive(Debug)] | |
16 | struct D<T: std::fmt::Debug>(T); | |
17 | ||
18 | impl<T: std::fmt::Debug> Drop for D<T> { | |
19 | fn drop(&mut self) { | |
20 | println!("dropping {:?})", self); | |
21 | } | |
22 | } | |
23 | ||
24 | impl<T: std::fmt::Debug> D<T> { | |
25 | fn next<U: std::fmt::Debug>(&self, _other: U) -> D<U> { D(_other) } | |
26 | fn end(&self) { } | |
27 | } | |
28 | ||
29 | fn side_effects() { } |