2019-10-03 19:10:37 -05:00
|
|
|
error[E0277]: the trait bound `&S: Trait` is not satisfied
|
|
|
|
--> $DIR/imm-ref-trait-object-literal.rs:12:7
|
|
|
|
|
|
|
|
|
LL | foo(&s);
|
2021-09-07 06:30:53 -05:00
|
|
|
| --- ^^ the trait `Trait` is not implemented for `&S`
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2019-10-03 19:10:37 -05:00
|
|
|
|
|
2021-12-13 14:56:40 -06:00
|
|
|
= help: the trait `Trait` is implemented for `&'a mut S`
|
2021-07-31 11:26:55 -05: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-11 22:38:21 -05:00
|
|
|
help: consider changing this borrow's mutability
|
|
|
|
|
|
|
|
|
LL | foo(&mut s);
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~~~~
|
2019-10-03 19:10:37 -05:00
|
|
|
|
|
|
|
error[E0277]: the trait bound `S: Trait` is not satisfied
|
|
|
|
--> $DIR/imm-ref-trait-object-literal.rs:13:7
|
|
|
|
|
|
|
|
|
LL | foo(s);
|
2022-08-18 07:16:35 -05:00
|
|
|
| --- ^ the trait `Trait` is not implemented for `S`
|
2021-09-26 10:30:39 -05:00
|
|
|
| |
|
2021-09-07 06:30:53 -05:00
|
|
|
| required by a bound introduced by this call
|
2021-07-31 11:26:55 -05: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`
|
2021-09-26 10:30:39 -05:00
|
|
|
help: consider mutably borrowing here
|
|
|
|
|
|
|
|
|
LL | foo(&mut s);
|
|
|
|
| ++++
|
2019-10-03 19:10:37 -05:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|