-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix coherence error for very large tuples™ #132001
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | ||
lcnr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(i won't r-, you can if you want to or not)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verflow is actually a type-system specific concept :clueless:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah i see, it describes the way crates of different versions flow through the type system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed as part of #132026 :3