diff options
| author | Andy Russell <arussell123@gmail.com> | 2021-01-11 19:27:38 -0500 |
|---|---|---|
| committer | Andy Russell <arussell123@gmail.com> | 2021-01-11 19:28:25 -0500 |
| commit | b6dc03b93dfe421a42d8dec910775a601fbd3d50 (patch) | |
| tree | b9c3cb69bcaaf8fffb63acb215241ecc2a1eaacd | |
| parent | c5eae562935922f712edec56a45591bc2f8ded1c (diff) | |
| download | rust-b6dc03b93dfe421a42d8dec910775a601fbd3d50.tar.gz rust-b6dc03b93dfe421a42d8dec910775a601fbd3d50.zip | |
fix typo in trait method mutability mismatch help
4 files changed, 13 insertions, 16 deletions
diff --git a/compiler/rustc_typeck/src/check/compare_method.rs b/compiler/rustc_typeck/src/check/compare_method.rs index bb324d0d8bc..320ded5334e 100644 --- a/compiler/rustc_typeck/src/check/compare_method.rs +++ b/compiler/rustc_typeck/src/check/compare_method.rs @@ -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, ); diff --git a/src/test/ui/issues/issue-13033.stderr b/src/test/ui/issues/issue-13033.stderr index a8473c8a524..57447fa48aa 100644 --- a/src/test/ui/issues/issue-13033.stderr +++ b/src/test/ui/issues/issue-13033.stderr @@ -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 diff --git a/src/test/ui/mismatched_types/E0053.stderr b/src/test/ui/mismatched_types/E0053.stderr index fef83e6bbe2..e0a3ce922b9 100644 --- a/src/test/ui/mismatched_types/E0053.stderr +++ b/src/test/ui/mismatched_types/E0053.stderr @@ -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 diff --git a/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr b/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr index 5735120f710..161843473b6 100644 --- a/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr +++ b/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr @@ -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 |
