rust/tests/ui/traits/copy-requires-self-wf.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
244 B
Rust
Raw Normal View History

2022-12-09 13:58:46 -06:00
// check-pass
#[derive(Clone)]
struct A<'a, T>(&'a T);
impl<'a, T: Copy + 'a> Copy for A<'a, T> {}
#[derive(Clone)]
struct B<'a, T>(A<'a, T>);
// `T: '_` should be implied by `WF(B<'_, T>)`.
impl<T: Copy> Copy for B<'_, T> {}
fn main() {}