]> git.lizzy.rs Git - rust.git/blob - tests/ui/derives/issue-91492.rs
add tests for 107090
[rust.git] / tests / ui / derives / issue-91492.rs
1 // Reproduce the issue with vec
2 pub struct NoDerives;
3 fn fun1(foo: &mut Vec<NoDerives>, bar: &[NoDerives]) {
4     foo.extend_from_slice(bar); //~ ERROR
5 }
6
7 // Reproduce the issue with vec
8 // and demonstrate that other derives are ignored in the suggested output
9 #[derive(Default, PartialEq)]
10 pub struct SomeDerives;
11 fn fun2(foo: &mut Vec<SomeDerives>, bar: &[SomeDerives]) {
12     foo.extend_from_slice(bar); //~ ERROR
13 }
14
15 // Try and fail to reproduce the issue without vec.
16 // No idea why it doesnt reproduce the issue but its still a useful test case.
17 struct Object<T, A>(T, A);
18 impl<T: Clone, A: Default> Object<T, A> {
19     fn use_clone(&self) {}
20 }
21 fn fun3(foo: Object<NoDerives, SomeDerives>) {
22     foo.use_clone(); //~ ERROR
23 }
24
25 fn main() {}