-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make IMPLIED_BOUNDS_ENTAILMENT into a hard error from a lint
- Loading branch information
1 parent
ca5c68a
commit 629d351
Showing
8 changed files
with
91 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 20 additions & 23 deletions
43
tests/ui/implied-bounds/impl-implied-bounds-compatibility-unnormalized.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,28 @@ | ||
error: impl method assumes more implied bounds than the corresponding trait method | ||
--> $DIR/impl-implied-bounds-compatibility-unnormalized.rs:13:31 | ||
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter 's in generic type due to conflicting requirements | ||
--> $DIR/impl-implied-bounds-compatibility-unnormalized.rs:11:5 | ||
| | ||
LL | fn get<'s>(s: &'s str, _: <&'static &'s () as Project>::Ty) -> &'static str { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this type to make the impl signature compatible: `()` | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #105572 <https://github.com/rust-lang/rust/issues/105572> | ||
note: the lint level is defined here | ||
--> $DIR/impl-implied-bounds-compatibility-unnormalized.rs:1:9 | ||
| | ||
LL | #![deny(implied_bounds_entailment)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
Future incompatibility report: Future breakage diagnostic: | ||
error: impl method assumes more implied bounds than the corresponding trait method | ||
--> $DIR/impl-implied-bounds-compatibility-unnormalized.rs:13:31 | ||
note: first, the lifetime cannot outlive the lifetime `'s` as defined here... | ||
--> $DIR/impl-implied-bounds-compatibility-unnormalized.rs:11:12 | ||
| | ||
LL | fn get<'s>(s: &'s str, _: <&'static &'s () as Project>::Ty) -> &'static str { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this type to make the impl signature compatible: `()` | ||
| ^^ | ||
note: ...so that the method type is compatible with trait | ||
--> $DIR/impl-implied-bounds-compatibility-unnormalized.rs:11:5 | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #105572 <https://github.com/rust-lang/rust/issues/105572> | ||
note: the lint level is defined here | ||
--> $DIR/impl-implied-bounds-compatibility-unnormalized.rs:1:9 | ||
LL | fn get<'s>(s: &'s str, _: <&'static &'s () as Project>::Ty) -> &'static str { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= note: expected `fn(&'s _, ()) -> &'static _` | ||
found `fn(&_, ()) -> &'static _` | ||
= note: but, the lifetime must be valid for the static lifetime... | ||
note: ...so that the reference type `&'static &()` does not outlive the data it points at | ||
--> $DIR/impl-implied-bounds-compatibility-unnormalized.rs:11:5 | ||
| | ||
LL | #![deny(implied_bounds_entailment)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | fn get<'s>(s: &'s str, _: <&'static &'s () as Project>::Ty) -> &'static str { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0495`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.