-
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.
Auto merge of #117984 - compiler-errors:implied-bounds-entailment, r=…
…<try> Make `IMPLIED_BOUNDS_ENTAILMENT` into a hard error from a lint closes #105572 Removes the `IMPLIED_BOUNDS_ENTAILMENT` and makes the `compare_method_predicate_entailment` logic just run once. r? lcnr
- Loading branch information
Showing
8 changed files
with
89 additions
and
299 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 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 str, ()) -> &'static str` | ||
found `fn(&str, ()) -> &'static str` | ||
= 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 previous error | ||
|
||
For more information about this error, try `rustc --explain E0495`. |
Oops, something went wrong.