fork/rust

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

borsAuto merge of #69444 - pietroalbini:stable-next-final-v2-new, r=pietroalbinif3e1a954d2e

1.41.1
936 B30 linesraw
1error[E0277]: the trait bound `&S: Trait` is not satisfied
2  --> $DIR/imm-ref-trait-object-literal.rs:12:7
3   |
4LL | fn foo<X: Trait>(_: X) {}
5   |    ---    ----- required by this bound in `foo`
6...
7LL |   foo(&s);
8   |       -^
9   |       |
10   |       the trait `Trait` is not implemented for `&S`
11   |       help: consider changing this borrow's mutability: `&mut`
12   |
13   = help: the following implementations were found:
14             <&'a mut S as Trait>
15
16error[E0277]: the trait bound `S: Trait` is not satisfied
17  --> $DIR/imm-ref-trait-object-literal.rs:13:7
18   |
19LL | fn foo<X: Trait>(_: X) {}
20   |    ---    ----- required by this bound in `foo`
21...
22LL |   foo(s);
23   |       ^ the trait `Trait` is not implemented for `S`
24   |
25   = help: the following implementations were found:
26             <&'a mut S as Trait>
27
28error: aborting due to 2 previous errors
29
30For more information about this error, try `rustc --explain E0277`.