fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.2 KiB40 linesraw
1error[E0277]: the trait bound `&S: Trait` is not satisfied
2  --> $DIR/imm-ref-trait-object-literal.rs:12:7
3   |
4LL |   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`
10note: required by a bound in `foo`
11  --> $DIR/imm-ref-trait-object-literal.rs:7:11
12   |
13LL | fn foo<X: Trait>(_: X) {}
14   |           ^^^^^ required by this bound in `foo`
15help: consider changing this borrow's mutability
16   |
17LL |   foo(&mut s);
18   |       ~~~~
19
20error[E0277]: the trait bound `S: Trait` is not satisfied
21  --> $DIR/imm-ref-trait-object-literal.rs:13:7
22   |
23LL |   foo(s);
24   |   --- ^ the trait `Trait` is not implemented for `S`
25   |   |
26   |   required by a bound introduced by this call
27   |
28note: required by a bound in `foo`
29  --> $DIR/imm-ref-trait-object-literal.rs:7:11
30   |
31LL | fn foo<X: Trait>(_: X) {}
32   |           ^^^^^ required by this bound in `foo`
33help: consider mutably borrowing here
34   |
35LL |   foo(&mut s);
36   |       ++++
37
38error: aborting due to 2 previous errors
39
40For more information about this error, try `rustc --explain E0277`.