mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-16 22:16:53 +00:00
Rollup merge of #80930 - euclio:trait-method-mutability-help, r=estebank
fix typo in trait method mutability mismatch help
This commit is contained in:
commit
139daf564e
@ -296,7 +296,7 @@ fn compare_predicate_entailment<'tcx>(
|
||||
{
|
||||
diag.span_suggestion(
|
||||
impl_err_span,
|
||||
"consider change the type to match the mutability in trait",
|
||||
"consider changing the mutability to match the trait",
|
||||
trait_err_str,
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
|
@ -5,14 +5,13 @@ LL | fn bar(&mut self, other: &mut dyn Foo);
|
||||
| ------------ type in trait
|
||||
...
|
||||
LL | fn bar(&mut self, other: &dyn Foo) {}
|
||||
| ^^^^^^^^ types differ in mutability
|
||||
| ^^^^^^^^
|
||||
| |
|
||||
| types differ in mutability
|
||||
| help: consider changing the mutability to match the trait: `&mut dyn Foo`
|
||||
|
|
||||
= note: expected fn pointer `fn(&mut Baz, &mut dyn Foo)`
|
||||
found fn pointer `fn(&mut Baz, &dyn Foo)`
|
||||
help: consider change the type to match the mutability in trait
|
||||
|
|
||||
LL | fn bar(&mut self, other: &mut dyn Foo) {}
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -17,14 +17,13 @@ LL | fn bar(&self);
|
||||
| ----- type in trait
|
||||
...
|
||||
LL | fn bar(&mut self) { }
|
||||
| ^^^^^^^^^ types differ in mutability
|
||||
| ^^^^^^^^^
|
||||
| |
|
||||
| types differ in mutability
|
||||
| help: consider changing the mutability to match the trait: `&self`
|
||||
|
|
||||
= note: expected fn pointer `fn(&Bar)`
|
||||
found fn pointer `fn(&mut Bar)`
|
||||
help: consider change the type to match the mutability in trait
|
||||
|
|
||||
LL | fn bar(&self) { }
|
||||
| ^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -17,14 +17,13 @@ LL | fn bar(&mut self, bar: &mut Bar);
|
||||
| -------- type in trait
|
||||
...
|
||||
LL | fn bar(&mut self, bar: &Bar) { }
|
||||
| ^^^^ types differ in mutability
|
||||
| ^^^^
|
||||
| |
|
||||
| types differ in mutability
|
||||
| help: consider changing the mutability to match the trait: `&mut Bar`
|
||||
|
|
||||
= note: expected fn pointer `fn(&mut Bar, &mut Bar)`
|
||||
found fn pointer `fn(&mut Bar, &Bar)`
|
||||
help: consider change the type to match the mutability in trait
|
||||
|
|
||||
LL | fn bar(&mut self, bar: &mut Bar) { }
|
||||
| ^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user