]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/imm-ref-trait-object-literal.stderr
Rollup merge of #99079 - compiler-errors:issue-99073, r=oli-obk
[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 trait `Trait` is implemented for `&'a mut S`
10 note: required by a bound in `foo`
11   --> $DIR/imm-ref-trait-object-literal.rs:7:11
12    |
13 LL | fn foo<X: Trait>(_: X) {}
14    |           ^^^^^ required by this bound in `foo`
15 help: consider changing this borrow's mutability
16    |
17 LL |   foo(&mut s);
18    |       ~~~~
19
20 error[E0277]: the trait bound `S: Trait` is not satisfied
21   --> $DIR/imm-ref-trait-object-literal.rs:13:7
22    |
23 LL |   foo(s);
24    |   --- ^ expected an implementor of trait `Trait`
25    |   |
26    |   required by a bound introduced by this call
27    |
28 note: required by a bound in `foo`
29   --> $DIR/imm-ref-trait-object-literal.rs:7:11
30    |
31 LL | fn foo<X: Trait>(_: X) {}
32    |           ^^^^^ required by this bound in `foo`
33 help: consider mutably borrowing here
34    |
35 LL |   foo(&mut s);
36    |       ++++
37
38 error: aborting due to 2 previous errors
39
40 For more information about this error, try `rustc --explain E0277`.