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