Add note
This commit is contained in:
parent
4d05da46e7
commit
7714db873e
4 changed files with 7 additions and 0 deletions
|
@ -226,6 +226,7 @@ hir_analysis_rpitit_refined = impl trait in impl method signature does not match
|
||||||
.suggestion = replace the return type so that it matches the trait
|
.suggestion = replace the return type so that it matches the trait
|
||||||
.label = return type from trait method defined here
|
.label = return type from trait method defined here
|
||||||
.unmatched_bound_label = this bound is stronger than that defined on the trait
|
.unmatched_bound_label = this bound is stronger than that defined on the trait
|
||||||
|
.note = add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
|
||||||
|
|
||||||
hir_analysis_self_in_impl_self =
|
hir_analysis_self_in_impl_self =
|
||||||
`Self` is not valid in the self type of an impl block
|
`Self` is not valid in the self type of an impl block
|
||||||
|
|
|
@ -921,6 +921,7 @@ pub struct UnusedAssociatedTypeBounds {
|
||||||
|
|
||||||
#[derive(LintDiagnostic)]
|
#[derive(LintDiagnostic)]
|
||||||
#[diag(hir_analysis_rpitit_refined)]
|
#[diag(hir_analysis_rpitit_refined)]
|
||||||
|
#[note]
|
||||||
pub(crate) struct ReturnPositionImplTraitInTraitRefined<'tcx> {
|
pub(crate) struct ReturnPositionImplTraitInTraitRefined<'tcx> {
|
||||||
#[suggestion(applicability = "maybe-incorrect", code = "{pre}{return_ty}{post}")]
|
#[suggestion(applicability = "maybe-incorrect", code = "{pre}{return_ty}{post}")]
|
||||||
pub impl_return_span: Span,
|
pub impl_return_span: Span,
|
||||||
|
|
|
@ -21,6 +21,7 @@ LL | fn iter(&self) -> impl '_ + Iterator<Item = Self::Item<'_>>;
|
||||||
LL | fn iter(&self) -> impl 'a + Iterator<Item = I::Item<'a>> {
|
LL | fn iter(&self) -> impl 'a + Iterator<Item = I::Item<'a>> {
|
||||||
| ^^ this bound is stronger than that defined on the trait
|
| ^^ this bound is stronger than that defined on the trait
|
||||||
|
|
|
|
||||||
|
= note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
|
||||||
= note: `#[warn(refining_impl_trait)]` on by default
|
= note: `#[warn(refining_impl_trait)]` on by default
|
||||||
help: replace the return type so that it matches the trait
|
help: replace the return type so that it matches the trait
|
||||||
|
|
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ LL | fn bar() -> impl Sized;
|
||||||
LL | fn bar() -> impl Copy {}
|
LL | fn bar() -> impl Copy {}
|
||||||
| ^^^^ this bound is stronger than that defined on the trait
|
| ^^^^ this bound is stronger than that defined on the trait
|
||||||
|
|
|
|
||||||
|
= note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/refine.rs:2:9
|
--> $DIR/refine.rs:2:9
|
||||||
|
|
|
|
||||||
|
@ -26,6 +27,7 @@ LL | fn bar() -> impl Sized;
|
||||||
LL | fn bar() {}
|
LL | fn bar() {}
|
||||||
| ^^^^^^^^
|
| ^^^^^^^^
|
||||||
|
|
|
|
||||||
|
= note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
|
||||||
help: replace the return type so that it matches the trait
|
help: replace the return type so that it matches the trait
|
||||||
|
|
|
|
||||||
LL | fn bar() -> impl Sized {}
|
LL | fn bar() -> impl Sized {}
|
||||||
|
@ -40,6 +42,7 @@ LL | fn bar() -> impl Sized;
|
||||||
LL | fn bar() -> () {}
|
LL | fn bar() -> () {}
|
||||||
| ^^
|
| ^^
|
||||||
|
|
|
|
||||||
|
= note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
|
||||||
help: replace the return type so that it matches the trait
|
help: replace the return type so that it matches the trait
|
||||||
|
|
|
|
||||||
LL | fn bar() -> impl Sized {}
|
LL | fn bar() -> impl Sized {}
|
||||||
|
@ -54,6 +57,7 @@ LL | fn bar<'a>(&'a self) -> impl Sized + 'a;
|
||||||
LL | fn bar(&self) -> impl Copy + '_ {}
|
LL | fn bar(&self) -> impl Copy + '_ {}
|
||||||
| ^^^^ this bound is stronger than that defined on the trait
|
| ^^^^ this bound is stronger than that defined on the trait
|
||||||
|
|
|
|
||||||
|
= note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
|
||||||
help: replace the return type so that it matches the trait
|
help: replace the return type so that it matches the trait
|
||||||
|
|
|
|
||||||
LL | fn bar(&self) -> impl Sized + '_ {}
|
LL | fn bar(&self) -> impl Sized + '_ {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue