File tree Expand file tree Collapse file tree 4 files changed +7
-0
lines changed
compiler/rustc_hir_analysis
tests/ui/impl-trait/in-trait Expand file tree Collapse file tree 4 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,7 @@ hir_analysis_rpitit_refined = impl trait in impl method signature does not match
226226 .suggestion = replace the return type so that it matches the trait
227227 .label = return type from trait method defined here
228228 .unmatched_bound_label = this bound is stronger than that defined on the trait
229+ .note = add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
229230
230231hir_analysis_self_in_impl_self =
231232 `Self` is not valid in the self type of an impl block
Original file line number Diff line number Diff line change @@ -921,6 +921,7 @@ pub struct UnusedAssociatedTypeBounds {
921921
922922#[ derive( LintDiagnostic ) ]
923923#[ diag( hir_analysis_rpitit_refined) ]
924+ #[ note]
924925pub ( crate ) struct ReturnPositionImplTraitInTraitRefined < ' tcx > {
925926 #[ suggestion( applicability = "maybe-incorrect" , code = "{pre}{return_ty}{post}" ) ]
926927 pub impl_return_span : Span ,
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ LL | fn iter(&self) -> impl '_ + Iterator<Item = Self::Item<'_>>;
2121LL | fn iter(&self) -> impl 'a + Iterator<Item = I::Item<'a>> {
2222 | ^^ this bound is stronger than that defined on the trait
2323 |
24+ = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
2425 = note: `#[warn(refining_impl_trait)]` on by default
2526help: replace the return type so that it matches the trait
2627 |
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ LL | fn bar() -> impl Sized;
77LL | fn bar() -> impl Copy {}
88 | ^^^^ this bound is stronger than that defined on the trait
99 |
10+ = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
1011note: the lint level is defined here
1112 --> $DIR/refine.rs:2:9
1213 |
@@ -26,6 +27,7 @@ LL | fn bar() -> impl Sized;
2627LL | fn bar() {}
2728 | ^^^^^^^^
2829 |
30+ = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
2931help: replace the return type so that it matches the trait
3032 |
3133LL | fn bar() -> impl Sized {}
@@ -40,6 +42,7 @@ LL | fn bar() -> impl Sized;
4042LL | fn bar() -> () {}
4143 | ^^
4244 |
45+ = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
4346help: replace the return type so that it matches the trait
4447 |
4548LL | fn bar() -> impl Sized {}
@@ -54,6 +57,7 @@ LL | fn bar<'a>(&'a self) -> impl Sized + 'a;
5457LL | fn bar(&self) -> impl Copy + '_ {}
5558 | ^^^^ this bound is stronger than that defined on the trait
5659 |
60+ = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
5761help: replace the return type so that it matches the trait
5862 |
5963LL | fn bar(&self) -> impl Sized + '_ {}
You can’t perform that action at this time.
0 commit comments