-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 #132001 - lcnr:stabilize-coherence-again, r=compiler-…
…errors fix coherence error for very large tuples™ see https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/diesel.20error for an in-depth explanation of this issue. We once again specialize `NormalizesTo` goals to avoid the impact of erasing their expected term. fixes #131969 r? `@compiler-errors`
- Loading branch information
Showing
7 changed files
with
94 additions
and
28 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
16 changes: 16 additions & 0 deletions
16
tests/ui/traits/next-solver/canonical/do-not-bail-due-to-placeholders.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,16 @@ | ||
//@ compile-flags: -Znext-solver | ||
//@ check-pass | ||
|
||
// When canonicalizing responses, we bail if there are too many inference variables. | ||
// We previously also counted placeholders, which is incorrect. | ||
#![recursion_limit = "8"] | ||
|
||
fn foo<T>() {} | ||
|
||
fn bar<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>() { | ||
// The query response will contain 10 placeholders, which previously | ||
// caused us to bail here. | ||
foo::<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)>(); | ||
} | ||
|
||
fn main() {} |
52 changes: 52 additions & 0 deletions
52
tests/ui/traits/next-solver/normalize/normalize-allow-too-many-vars.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,52 @@ | ||
//@ check-pass | ||
|
||
// When canonicalizing a response in the trait solver, we bail with overflow | ||
// if there are too many non-region inference variables. Doing so in normalizes-to | ||
// goals ends up hiding inference constraints in cases which we want to support, | ||
// see #131969. To prevent this issue we do not check for too many inference | ||
// variables in normalizes-to goals. | ||
#![recursion_limit = "8"] | ||
|
||
trait Bound {} | ||
trait Trait { | ||
type Assoc; | ||
} | ||
|
||
|
||
impl<T0, T1, T2, T3, T4, T5, T6, T7> Trait for (T0, T1, T2, T3, T4, T5, T6, T7) | ||
where | ||
T0: Trait, | ||
T1: Trait, | ||
T2: Trait, | ||
T3: Trait, | ||
T4: Trait, | ||
T5: Trait, | ||
T6: Trait, | ||
T7: Trait, | ||
( | ||
T0::Assoc, | ||
T1::Assoc, | ||
T2::Assoc, | ||
T3::Assoc, | ||
T4::Assoc, | ||
T5::Assoc, | ||
T6::Assoc, | ||
T7::Assoc, | ||
): Clone, | ||
{ | ||
type Assoc = ( | ||
T0::Assoc, | ||
T1::Assoc, | ||
T2::Assoc, | ||
T3::Assoc, | ||
T4::Assoc, | ||
T5::Assoc, | ||
T6::Assoc, | ||
T7::Assoc, | ||
); | ||
} | ||
|
||
trait Overlap {} | ||
impl<T: Trait<Assoc = ()>> Overlap for T {} | ||
impl<T0, T1, T2, T3, T4, T5, T6, T7> Overlap for (T0, T1, T2, T3, T4, T5, T6, T7) {} | ||
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
6 changes: 3 additions & 3 deletions
6
tests/ui/traits/next-solver/overflow/recursion-limit-zero-issue-115351.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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
//~ ERROR overflow evaluating the requirement `Self: Trait` | ||
//~^ ERROR overflow evaluating the requirement `Self well-formed` | ||
// This is a non-regression test for issue #115351, where a recursion limit of 0 caused an ICE. | ||
//@ check-pass | ||
//@ compile-flags: -Znext-solver --crate-type=lib | ||
|
||
// This is a non-regression test for issue #115351, where a recursion limit of 0 caused an ICE. | ||
|
||
#![recursion_limit = "0"] | ||
trait Trait {} | ||
impl Trait for u32 {} |
11 changes: 0 additions & 11 deletions
11
tests/ui/traits/next-solver/overflow/recursion-limit-zero-issue-115351.stderr
This file was deleted.
Oops, something went wrong.