]> git.proxmox.com Git - rustc.git/blob - tests/ui/traits/copy-is-not-modulo-regions.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / tests / ui / traits / copy-is-not-modulo-regions.rs
1 // revisions: not_static yes_static
2 //[yes_static] check-pass
3
4 #[derive(Clone)]
5 struct Foo<'lt>(&'lt ());
6
7 impl Copy for Foo<'static> {}
8
9 #[derive(Clone)]
10 struct Bar<'lt>(Foo<'lt>);
11
12 #[cfg(not_static)]
13 impl<'any> Copy for Bar<'any> {}
14 //[not_static]~^ the trait `Copy` cannot be implemented for this type
15
16 #[cfg(yes_static)]
17 impl<'any> Copy for Bar<'static> {}
18
19 fn main() {}