-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #112783 - compiler-errors:nlb-fnptr-reject-ice, r=fee…
…1-dead Don't ICE on bound var in `reject_fn_ptr_impls` We may try to use an impl like `impl<T: FnPtr> PartialEq {}` to satisfy a predicate like `for<T> T: PartialEq` -- don't ICE in that case. Fixes #112735
- Loading branch information
Showing
3 changed files
with
43 additions
and
5 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
12 changes: 12 additions & 0 deletions
12
tests/ui/traits/non_lifetime_binders/foreach-partial-eq.rs
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#![feature(non_lifetime_binders)] | ||
//~^ WARN the feature `non_lifetime_binders` is incomplete | ||
|
||
fn auto_trait() | ||
where | ||
for<T> T: PartialEq + PartialOrd, | ||
{} | ||
|
||
fn main() { | ||
auto_trait(); | ||
//~^ ERROR can't compare `T` with `T` | ||
} |
28 changes: 28 additions & 0 deletions
28
tests/ui/traits/non_lifetime_binders/foreach-partial-eq.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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/foreach-partial-eq.rs:1:12 | ||
| | ||
LL | #![feature(non_lifetime_binders)] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error[E0277]: can't compare `T` with `T` | ||
--> $DIR/foreach-partial-eq.rs:10:5 | ||
| | ||
LL | auto_trait(); | ||
| ^^^^^^^^^^ no implementation for `T < T` and `T > T` | ||
| | ||
= help: the trait `PartialOrd` is not implemented for `T` | ||
note: required by a bound in `auto_trait` | ||
--> $DIR/foreach-partial-eq.rs:6:27 | ||
| | ||
LL | fn auto_trait() | ||
| ---------- required by a bound in this function | ||
LL | where | ||
LL | for<T> T: PartialEq + PartialOrd, | ||
| ^^^^^^^^^^ required by this bound in `auto_trait` | ||
|
||
error: aborting due to previous error; 1 warning emitted | ||
|
||
For more information about this error, try `rustc --explain E0277`. |