]> git.proxmox.com Git - rustc.git/blame - src/test/ui/nll/issue-54382-use-span-of-tail-of-block.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / nll / issue-54382-use-span-of-tail-of-block.rs
CommitLineData
a1dfa0c6
XL
1fn 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)]
16struct D<T: std::fmt::Debug>(T);
17
18impl<T: std::fmt::Debug> Drop for D<T> {
19 fn drop(&mut self) {
20 println!("dropping {:?})", self);
21 }
22}
23
24impl<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
29fn side_effects() { }