summaryrefslogtreecommitdiffstats
path: root/src/test/ui/suggestions/suggest-imm-mut-trait-implementations.rs
blob: a62669d5b2d8f7ec50dabd074256da16bd72a7ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
trait Trait {}

struct A;
struct B;
struct C;

impl Trait for &A {}
impl Trait for &mut A {}

impl Trait for &B {}

impl Trait for &mut C {}

fn foo<X: Trait>(_: X) {}

fn main() {
    let a = A;
    let b = B;
    let c = C;
    foo(a); //~ ERROR the trait bound `A: Trait` is not satisfied
    foo(b); //~ ERROR the trait bound `B: Trait` is not satisfied
    foo(c); //~ ERROR the trait bound `C: Trait` is not satisfied
}