]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/imm-ref-trait-object-literal.stderr
Override rustc version in ui and mir-opt tests to get stable hashes
[rust.git] / src / test / ui / suggestions / imm-ref-trait-object-literal.stderr
1 error[E0277]: the trait bound `&S: Trait` is not satisfied
2   --> $DIR/imm-ref-trait-object-literal.rs:12:7
3    |
4 LL |   foo(&s);
5    |   --- ^^ the trait `Trait` is not implemented for `&S`
6    |   |
7    |   required by a bound introduced by this call
8    |
9    = help: the following implementations were found:
10              <&'a mut S as Trait>
11 note: required by a bound in `foo`
12   --> $DIR/imm-ref-trait-object-literal.rs:7:11
13    |
14 LL | fn foo<X: Trait>(_: X) {}
15    |           ^^^^^ required by this bound in `foo`
16 help: consider changing this borrow's mutability
17    |
18 LL |   foo(&mut s);
19    |       ~~~~
20
21 error[E0277]: the trait bound `S: Trait` is not satisfied
22   --> $DIR/imm-ref-trait-object-literal.rs:13:7
23    |
24 LL |   foo(s);
25    |   --- ^ expected an implementor of trait `Trait`
26    |   |
27    |   required by a bound introduced by this call
28    |
29 note: required by a bound in `foo`
30   --> $DIR/imm-ref-trait-object-literal.rs:7:11
31    |
32 LL | fn foo<X: Trait>(_: X) {}
33    |           ^^^^^ required by this bound in `foo`
34 help: consider mutably borrowing here
35    |
36 LL |   foo(&mut s);
37    |       ++++
38
39 error: aborting due to 2 previous errors
40
41 For more information about this error, try `rustc --explain E0277`.