2022-11-30 14:41:02 -06:00
|
|
|
// revisions: not_static yes_static
|
|
|
|
//[yes_static] check-pass
|
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
struct Foo<'lt>(&'lt ());
|
|
|
|
|
|
|
|
impl Copy for Foo<'static> {}
|
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
struct Bar<'lt>(Foo<'lt>);
|
|
|
|
|
|
|
|
#[cfg(not_static)]
|
|
|
|
impl<'any> Copy for Bar<'any> {}
|
2023-03-07 17:55:51 -06:00
|
|
|
//[not_static]~^ the trait `Copy` cannot be implemented for this type
|
2022-11-30 14:41:02 -06:00
|
|
|
|
|
|
|
#[cfg(yes_static)]
|
|
|
|
impl<'any> Copy for Bar<'static> {}
|
|
|
|
|
|
|
|
fn main() {}
|