fork/rust

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

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

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