mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
12 lines
290 B
Rust
12 lines
290 B
Rust
// Test that the 'static bound from the Copy impl is respected. Regression test for #29149.
|
|
|
|
#[derive(Clone)] struct Foo<'a>(&'a u32);
|
|
impl Copy for Foo<'static> {}
|
|
|
|
fn main() {
|
|
let s = 2;
|
|
let a = Foo(&s); //~ ERROR `s` does not live long enough [E0597]
|
|
drop(a);
|
|
drop(a);
|
|
}
|