summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/do-not-ignore-lifetime-bounds-in-copy.rs
blob: 99922cc51b0d1bd497b572b72c76049e9632f789 (plain)
1
2
3
4
5
6
7
8
9
10
11
// 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);
}