forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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 rust-lang#91551 - b-naber:const-eval-normalization-ic…
…e, r=oli-obk Allow for failure of subst_normalize_erasing_regions in const_eval Fixes rust-lang#72845 Using associated types that cannot be normalized previously resulted in an ICE. We now allow for normalization failure and return a "TooGeneric" error in that case. r? ``@RalfJung`` maybe?
- Loading branch information
Showing
9 changed files
with
129 additions
and
12 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
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
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,49 @@ | ||
#![feature(generic_const_exprs)] | ||
#![feature(specialization)] | ||
#![allow(incomplete_features)] | ||
|
||
//-------------------------------------------------- | ||
|
||
trait Depth { | ||
const C: usize; | ||
} | ||
|
||
trait Type { | ||
type AT: Depth; | ||
} | ||
|
||
//-------------------------------------------------- | ||
|
||
enum Predicate<const B: bool> {} | ||
|
||
trait Satisfied {} | ||
|
||
impl Satisfied for Predicate<true> {} | ||
|
||
//-------------------------------------------------- | ||
|
||
trait Spec1 {} | ||
|
||
impl<T: Type> Spec1 for T where Predicate<{T::AT::C > 0}>: Satisfied {} | ||
|
||
trait Spec2 {} | ||
|
||
//impl<T: Type > Spec2 for T where Predicate<{T::AT::C > 1}>: Satisfied {} | ||
impl<T: Type > Spec2 for T where Predicate<true>: Satisfied {} | ||
|
||
//-------------------------------------------------- | ||
|
||
trait Foo { | ||
fn Bar(); | ||
} | ||
|
||
impl<T: Spec1> Foo for T { | ||
default fn Bar() {} | ||
} | ||
|
||
impl<T: Spec2> Foo for T { | ||
//~^ ERROR conflicting implementations of trait | ||
fn Bar() {} | ||
} | ||
|
||
fn main() {} |
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 @@ | ||
error[E0119]: conflicting implementations of trait `Foo` | ||
--> $DIR/issue-72845.rs:44:1 | ||
| | ||
LL | impl<T: Spec1> Foo for T { | ||
| ------------------------ first implementation here | ||
... | ||
LL | impl<T: Spec2> Foo for T { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0119`. |
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