-
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.
- Loading branch information
Showing
9 changed files
with
207 additions
and
16 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
4 changes: 2 additions & 2 deletions
4
tests/ui/traits/next-solver/canonical/const-region-infer-to-static-in-binder.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
89 changes: 89 additions & 0 deletions
89
tests/ui/traits/next-solver/cycles/cycle-modulo-ambig-aliases.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,89 @@ | ||
//@ compile-flags: -Znext-solver | ||
|
||
// A regression test for #125269. We previously ended up | ||
// recursively proving `&<_ as SpeciesPackedElem>::Assoc: Typed` | ||
// for all aliases which ended up causing exponential blowup. | ||
// | ||
// This has been fixed by eagerly normalizing the associated | ||
// type before computing the nested goals, resulting in an | ||
// immediate inductive cycle. | ||
|
||
pub trait Typed {} | ||
|
||
pub struct SpeciesCases<E>(E); | ||
|
||
pub trait SpeciesPackedElim { | ||
type Ogre; | ||
type Cyclops; | ||
type Wendigo; | ||
type Cavetroll; | ||
type Mountaintroll; | ||
type Swamptroll; | ||
type Dullahan; | ||
type Werewolf; | ||
type Occultsaurok; | ||
type Mightysaurok; | ||
type Slysaurok; | ||
type Mindflayer; | ||
type Minotaur; | ||
type Tidalwarrior; | ||
type Yeti; | ||
type Harvester; | ||
type Blueoni; | ||
type Redoni; | ||
type Cultistwarlord; | ||
type Cultistwarlock; | ||
type Huskbrute; | ||
type Tursus; | ||
type Gigasfrost; | ||
type AdletElder; | ||
type SeaBishop; | ||
type HaniwaGeneral; | ||
type TerracottaBesieger; | ||
type TerracottaDemolisher; | ||
type TerracottaPunisher; | ||
type TerracottaPursuer; | ||
type Cursekeeper; | ||
} | ||
|
||
impl<'b, E: SpeciesPackedElim> Typed for &'b SpeciesCases<E> | ||
where | ||
&'b E::Ogre: Typed, | ||
&'b E::Cyclops: Typed, | ||
&'b E::Wendigo: Typed, | ||
&'b E::Cavetroll: Typed, | ||
&'b E::Mountaintroll: Typed, | ||
&'b E::Swamptroll: Typed, | ||
&'b E::Dullahan: Typed, | ||
&'b E::Werewolf: Typed, | ||
&'b E::Occultsaurok: Typed, | ||
&'b E::Mightysaurok: Typed, | ||
&'b E::Slysaurok: Typed, | ||
&'b E::Mindflayer: Typed, | ||
&'b E::Minotaur: Typed, | ||
&'b E::Tidalwarrior: Typed, | ||
&'b E::Yeti: Typed, | ||
&'b E::Harvester: Typed, | ||
&'b E::Blueoni: Typed, | ||
&'b E::Redoni: Typed, | ||
&'b E::Cultistwarlord: Typed, | ||
&'b E::Cultistwarlock: Typed, | ||
&'b E::Huskbrute: Typed, | ||
&'b E::Tursus: Typed, | ||
&'b E::Gigasfrost: Typed, | ||
&'b E::AdletElder: Typed, | ||
&'b E::SeaBishop: Typed, | ||
&'b E::HaniwaGeneral: Typed, | ||
&'b E::TerracottaBesieger: Typed, | ||
&'b E::TerracottaDemolisher: Typed, | ||
&'b E::TerracottaPunisher: Typed, | ||
&'b E::TerracottaPursuer: Typed, | ||
&'b E::Cursekeeper: Typed, | ||
{} | ||
|
||
fn foo<T: Typed>() {} | ||
|
||
fn main() { | ||
foo::<&_>(); | ||
//~^ ERROR overflow evaluating the requirement `&_: Typed` | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/ui/traits/next-solver/cycles/cycle-modulo-ambig-aliases.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,15 @@ | ||
error[E0275]: overflow evaluating the requirement `&_: Typed` | ||
--> $DIR/cycle-modulo-ambig-aliases.rs:87:11 | ||
| | ||
LL | foo::<&_>(); | ||
| ^^ | ||
| | ||
note: required by a bound in `foo` | ||
--> $DIR/cycle-modulo-ambig-aliases.rs:84:11 | ||
| | ||
LL | fn foo<T: Typed>() {} | ||
| ^^^^^ required by this bound in `foo` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0275`. |