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);
|
2021-09-07 11:30:53 +00:00
|
|
|
| --- ^^ the trait `Trait` is not implemented for `&S`
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2019-10-04 00:10:37 +00:00
|
|
|
|
|
2021-12-13 20:56:40 +00:00
|
|
|
= help: the trait `Trait` is implemented for `&'a 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`
|
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);
|
2022-08-18 12:16:35 +00:00
|
|
|
| --- ^ the trait `Trait` is not implemented for `S`
|
2021-09-26 15:30:39 +00:00
|
|
|
| |
|
2021-09-07 11:30:53 +00:00
|
|
|
| required by a bound introduced by this call
|
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`
|
2021-09-26 15:30:39 +00:00
|
|
|
help: consider mutably borrowing here
|
|
|
|
|
|
|
|
|
LL | foo(&mut s);
|
|
|
|
| ++++
|
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`.
|