File tree 4 files changed +7
-0
lines changed
compiler/rustc_hir_analysis
tests/ui/impl-trait/in-trait
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
226
226
.suggestion = replace the return type so that it matches the trait
227
227
.label = return type from trait method defined here
228
228
.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
229
230
230
231
hir_analysis_self_in_impl_self =
231
232
`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 {
921
921
922
922
#[ derive( LintDiagnostic ) ]
923
923
#[ diag( hir_analysis_rpitit_refined) ]
924
+ #[ note]
924
925
pub ( crate ) struct ReturnPositionImplTraitInTraitRefined < ' tcx > {
925
926
#[ suggestion( applicability = "maybe-incorrect" , code = "{pre}{return_ty}{post}" ) ]
926
927
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<'_>>;
21
21
LL | fn iter(&self) -> impl 'a + Iterator<Item = I::Item<'a>> {
22
22
| ^^ this bound is stronger than that defined on the trait
23
23
|
24
+ = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
24
25
= note: `#[warn(refining_impl_trait)]` on by default
25
26
help: replace the return type so that it matches the trait
26
27
|
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ LL | fn bar() -> impl Sized;
7
7
LL | fn bar() -> impl Copy {}
8
8
| ^^^^ this bound is stronger than that defined on the trait
9
9
|
10
+ = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
10
11
note: the lint level is defined here
11
12
--> $DIR/refine.rs:2:9
12
13
|
@@ -26,6 +27,7 @@ LL | fn bar() -> impl Sized;
26
27
LL | fn bar() {}
27
28
| ^^^^^^^^
28
29
|
30
+ = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
29
31
help: replace the return type so that it matches the trait
30
32
|
31
33
LL | fn bar() -> impl Sized {}
@@ -40,6 +42,7 @@ LL | fn bar() -> impl Sized;
40
42
LL | fn bar() -> () {}
41
43
| ^^
42
44
|
45
+ = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
43
46
help: replace the return type so that it matches the trait
44
47
|
45
48
LL | fn bar() -> impl Sized {}
@@ -54,6 +57,7 @@ LL | fn bar<'a>(&'a self) -> impl Sized + 'a;
54
57
LL | fn bar(&self) -> impl Copy + '_ {}
55
58
| ^^^^ this bound is stronger than that defined on the trait
56
59
|
60
+ = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
57
61
help: replace the return type so that it matches the trait
58
62
|
59
63
LL | fn bar(&self) -> impl Sized + '_ {}
You can’t perform that action at this time.
0 commit comments