2019-10-04 00:10:37 +00:00
|
|
|
error[E0277]: the trait bound `&S: Trait` is not satisfied
|
|
|
|
--> $DIR/imm-ref-trait-object-literal.rs:12:7
|
|
|
|
|
|
|
|
|
LL | foo(&s);
|
2020-03-12 03:38:21 +00:00
|
|
|
| ^^ the trait `Trait` is not implemented for `&S`
|
2019-10-04 00:10:37 +00:00
|
|
|
|
|
|
|
|
= help: the following implementations were found:
|
|
|
|
<&'a mut S as Trait>
|
2021-07-31 16:26:55 +00:00
|
|
|
note: required by a bound in `foo`
|
|
|
|
--> $DIR/imm-ref-trait-object-literal.rs:7:11
|
|
|
|
|
|
|
|
|
LL | fn foo<X: Trait>(_: X) {}
|
|
|
|
| ^^^^^ required by this bound in `foo`
|
2020-03-12 03:38:21 +00:00
|
|
|
help: consider changing this borrow's mutability
|
|
|
|
|
|
|
|
|
LL | foo(&mut s);
|
2021-06-22 02:07:19 +00:00
|
|
|
| ~~~~
|
2019-10-04 00:10:37 +00:00
|
|
|
|
|
|
|
error[E0277]: the trait bound `S: Trait` is not satisfied
|
|
|
|
--> $DIR/imm-ref-trait-object-literal.rs:13:7
|
|
|
|
|
|
|
|
|
LL | foo(s);
|
2021-05-16 14:20:35 +00:00
|
|
|
| ^
|
|
|
|
| |
|
|
|
|
| expected an implementor of trait `Trait`
|
2021-05-17 20:58:09 +00:00
|
|
|
| help: consider mutably borrowing here: `&mut s`
|
2021-07-31 16:26:55 +00:00
|
|
|
|
|
|
|
|
note: required by a bound in `foo`
|
|
|
|
--> $DIR/imm-ref-trait-object-literal.rs:7:11
|
|
|
|
|
|
|
|
|
LL | fn foo<X: Trait>(_: X) {}
|
|
|
|
| ^^^^^ required by this bound in `foo`
|
2019-10-04 00:10:37 +00:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|