]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/suggest-imm-mut-trait-implementations.rs
Rollup merge of #104965 - zacklukem:p-option-as_ref-docs, r=scottmcm
[rust.git] / tests / ui / suggestions / suggest-imm-mut-trait-implementations.rs
1 trait Trait {}
2
3 struct A;
4 struct B;
5 struct C;
6
7 impl Trait for &A {}
8 impl Trait for &mut A {}
9
10 impl Trait for &B {}
11
12 impl Trait for &mut C {}
13
14 fn foo<X: Trait>(_: X) {}
15
16 fn main() {
17     let a = A;
18     let b = B;
19     let c = C;
20     foo(a); //~ ERROR the trait bound `A: Trait` is not satisfied
21     foo(b); //~ ERROR the trait bound `B: Trait` is not satisfied
22     foo(c); //~ ERROR the trait bound `C: Trait` is not satisfied
23 }