]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/do-not-ignore-lifetime-bounds-in-copy.rs
Auto merge of #105145 - Ayush1325:sequential-remote-server, r=Mark-Simulacrum
[rust.git] / src / test / ui / nll / do-not-ignore-lifetime-bounds-in-copy.rs
1 // Test that the 'static bound from the Copy impl is respected. Regression test for #29149.
2
3 #[derive(Clone)] struct Foo<'a>(&'a u32);
4 impl Copy for Foo<'static> {}
5
6 fn main() {
7     let s = 2;
8     let a = Foo(&s); //~ ERROR `s` does not live long enough [E0597]
9     drop(a);
10     drop(a);
11 }