summaryrefslogtreecommitdiffstats
path: root/tests/ui/derives/issue-91492.rs
blob: df792f118ab7652a135ab2ed8543eb1ae1d25843 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Reproduce the issue with vec
pub struct NoDerives;
fn fun1(foo: &mut Vec<NoDerives>, bar: &[NoDerives]) {
    foo.extend_from_slice(bar); //~ ERROR
}

// Reproduce the issue with vec
// and demonstrate that other derives are ignored in the suggested output
#[derive(Default, PartialEq)]
pub struct SomeDerives;
fn fun2(foo: &mut Vec<SomeDerives>, bar: &[SomeDerives]) {
    foo.extend_from_slice(bar); //~ ERROR
}

// Try and fail to reproduce the issue without vec.
// No idea why it doesnt reproduce the issue but its still a useful test case.
struct Object<T, A>(T, A);
impl<T: Clone, A: Default> Object<T, A> {
    fn use_clone(&self) {}
}
fn fun3(foo: Object<NoDerives, SomeDerives>) {
    foo.use_clone(); //~ ERROR
}

fn main() {}