-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
add a few new solver normalization tests #156250
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e2ea0ba
add new solver revisions to already fixed normalization tests
lqd 4922210
add normalization test with field with diverging alias
lqd 6cc6a63
add normalization test with defaulted type param with diverging alias
lqd 130b1d8
move some normalization tests to the dedicated folder
lqd 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
2 changes: 1 addition & 1 deletion
2
...erent-types/normalization-overflow.stderr → ...pes/normalization-overflow.current.stderr
This file contains hidden or 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
9 changes: 9 additions & 0 deletions
9
tests/ui/associated-inherent-types/normalization-overflow.next.stderr
This file contains hidden or 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,9 @@ | ||
| error[E0271]: type mismatch resolving `T::This normalizes-to _` | ||
| --> $DIR/normalization-overflow.rs:14:5 | ||
| | | ||
| LL | type This = Self::This; | ||
| | ^^^^^^^^^ types differ | ||
|
|
||
| error: aborting due to 1 previous error | ||
|
|
||
| For more information about this error, try `rustc --explain E0271`. |
11 changes: 9 additions & 2 deletions
11
tests/ui/associated-inherent-types/normalization-overflow.rs
This file contains hidden or 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,12 +1,19 @@ | ||
| #![feature(inherent_associated_types)] | ||
| //@ revisions: current next | ||
| //@ ignore-compare-mode-next-solver (explicit revisions) | ||
| //@ [next] compile-flags: -Znext-solver | ||
|
|
||
| #![feature(inherent_associated_types, rustc_attrs)] | ||
| #![allow(incomplete_features)] | ||
| #![rustc_no_implicit_bounds] | ||
|
|
||
| // FIXME(fmease): I'd prefer to report a cycle error here instead of an overflow one. | ||
|
|
||
| struct T; | ||
|
|
||
| impl T { | ||
| type This = Self::This; //~ ERROR overflow evaluating associated type `T::This` | ||
| type This = Self::This; | ||
| //[current]~^ ERROR: overflow evaluating associated type `T::This` | ||
| //[next]~^^ ERROR: type mismatch resolving `T::This normalizes-to _` | ||
| } | ||
|
|
||
| fn main() {} |
21 changes: 21 additions & 0 deletions
21
tests/ui/infinite/infinite-type-alias-mutual-recursion.feature_new.stderr
This file contains hidden or 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,21 @@ | ||
| error[E0271]: type mismatch resolving `X3 normalizes-to _` | ||
| --> $DIR/infinite-type-alias-mutual-recursion.rs:12:1 | ||
| | | ||
| LL | type X1 = X2; | ||
| | ^^^^^^^ types differ | ||
|
|
||
| error[E0271]: type mismatch resolving `X1 normalizes-to _` | ||
| --> $DIR/infinite-type-alias-mutual-recursion.rs:16:1 | ||
| | | ||
| LL | type X2 = X3; | ||
| | ^^^^^^^ types differ | ||
|
|
||
| error[E0271]: type mismatch resolving `X2 normalizes-to _` | ||
| --> $DIR/infinite-type-alias-mutual-recursion.rs:19:1 | ||
| | | ||
| LL | type X3 = X1; | ||
| | ^^^^^^^ types differ | ||
|
|
||
| error: aborting due to 3 previous errors | ||
|
|
||
| For more information about this error, try `rustc --explain E0271`. |
27 changes: 27 additions & 0 deletions
27
tests/ui/infinite/infinite-type-alias-mutual-recursion.feature_old.stderr
This file contains hidden or 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,27 @@ | ||
| error[E0275]: overflow normalizing the type alias `X2` | ||
| --> $DIR/infinite-type-alias-mutual-recursion.rs:12:1 | ||
| | | ||
| LL | type X1 = X2; | ||
| | ^^^^^^^ | ||
| | | ||
| = note: in case this is a recursive type alias, consider using a struct, enum, or union instead | ||
|
|
||
| error[E0275]: overflow normalizing the type alias `X3` | ||
| --> $DIR/infinite-type-alias-mutual-recursion.rs:16:1 | ||
| | | ||
| LL | type X2 = X3; | ||
| | ^^^^^^^ | ||
| | | ||
| = note: in case this is a recursive type alias, consider using a struct, enum, or union instead | ||
|
|
||
| error[E0275]: overflow normalizing the type alias `X1` | ||
| --> $DIR/infinite-type-alias-mutual-recursion.rs:19:1 | ||
| | | ||
| LL | type X3 = X1; | ||
| | ^^^^^^^ | ||
| | | ||
| = note: in case this is a recursive type alias, consider using a struct, enum, or union instead | ||
|
|
||
| error: aborting due to 3 previous errors | ||
|
|
||
| For more information about this error, try `rustc --explain E0275`. |
30 changes: 30 additions & 0 deletions
30
tests/ui/infinite/infinite-type-alias-mutual-recursion.gated_new.stderr
This file contains hidden or 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,30 @@ | ||
| error[E0391]: cycle detected when expanding type alias `X1` | ||
| --> $DIR/infinite-type-alias-mutual-recursion.rs:12:11 | ||
| | | ||
| LL | type X1 = X2; | ||
| | ^^ | ||
| | | ||
| note: ...which requires expanding type alias `X2`... | ||
| --> $DIR/infinite-type-alias-mutual-recursion.rs:16:11 | ||
| | | ||
| LL | type X2 = X3; | ||
| | ^^ | ||
| note: ...which requires expanding type alias `X3`... | ||
| --> $DIR/infinite-type-alias-mutual-recursion.rs:19:11 | ||
| | | ||
| LL | type X3 = X1; | ||
| | ^^ | ||
| = note: ...which again requires expanding type alias `X1`, completing the cycle | ||
| = note: type aliases cannot be recursive | ||
| = help: consider using a struct, enum, or union instead to break the cycle | ||
| = help: see <https://doc.rust-lang.org/reference/types.html#recursive-types> for more information | ||
| note: cycle used when checking that `X1` is well-formed | ||
| --> $DIR/infinite-type-alias-mutual-recursion.rs:12:1 | ||
| | | ||
| LL | type X1 = X2; | ||
| | ^^^^^^^ | ||
| = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information | ||
|
|
||
| error: aborting due to 1 previous error | ||
|
|
||
| For more information about this error, try `rustc --explain E0391`. |
30 changes: 30 additions & 0 deletions
30
tests/ui/infinite/infinite-type-alias-mutual-recursion.gated_old.stderr
This file contains hidden or 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,30 @@ | ||
| error[E0391]: cycle detected when expanding type alias `X1` | ||
| --> $DIR/infinite-type-alias-mutual-recursion.rs:12:11 | ||
| | | ||
| LL | type X1 = X2; | ||
| | ^^ | ||
| | | ||
| note: ...which requires expanding type alias `X2`... | ||
| --> $DIR/infinite-type-alias-mutual-recursion.rs:16:11 | ||
| | | ||
| LL | type X2 = X3; | ||
| | ^^ | ||
| note: ...which requires expanding type alias `X3`... | ||
| --> $DIR/infinite-type-alias-mutual-recursion.rs:19:11 | ||
| | | ||
| LL | type X3 = X1; | ||
| | ^^ | ||
| = note: ...which again requires expanding type alias `X1`, completing the cycle | ||
| = note: type aliases cannot be recursive | ||
| = help: consider using a struct, enum, or union instead to break the cycle | ||
| = help: see <https://doc.rust-lang.org/reference/types.html#recursive-types> for more information | ||
| note: cycle used when checking that `X1` is well-formed | ||
| --> $DIR/infinite-type-alias-mutual-recursion.rs:12:1 | ||
| | | ||
| LL | type X1 = X2; | ||
| | ^^^^^^^ | ||
| = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information | ||
|
|
||
| error: aborting due to 1 previous error | ||
|
|
||
| For more information about this error, try `rustc --explain E0391`. |
This file contains hidden or 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,14 +1,23 @@ | ||
| //@ revisions: feature gated | ||
| //@ revisions: feature_old gated_old feature_new gated_new | ||
| //@ ignore-parallel-frontend query cycle | ||
| #![cfg_attr(feature, feature(lazy_type_alias))] | ||
| //@ ignore-compare-mode-next-solver (explicit revisions) | ||
| //@ [feature_new] compile-flags: -Znext-solver | ||
| //@ [gated_new] compile-flags: -Znext-solver | ||
|
|
||
| #![feature(rustc_attrs)] | ||
| #![rustc_no_implicit_bounds] | ||
| #![cfg_attr(any(feature_old, feature_new), feature(lazy_type_alias))] | ||
| #![allow(incomplete_features)] | ||
|
|
||
| type X1 = X2; | ||
| //[gated]~^ ERROR cycle detected when expanding type alias `X1` | ||
| //[feature]~^^ ERROR: overflow normalizing the type alias `X2` | ||
| //[gated_old,gated_new]~^ ERROR cycle detected when expanding type alias `X1` | ||
| //[feature_old]~^^ ERROR: overflow normalizing the type alias `X2` | ||
| //[feature_new]~^^^ ERROR: type mismatch resolving `X3 normalizes-to _` | ||
| type X2 = X3; | ||
| //[feature]~^ ERROR: overflow normalizing the type alias `X3` | ||
| //[feature_old]~^ ERROR: overflow normalizing the type alias `X3` | ||
| //[feature_new]~^^ ERROR: type mismatch resolving `X1 normalizes-to _` | ||
| type X3 = X1; | ||
| //[feature]~^ ERROR: overflow normalizing the type alias `X1` | ||
| //[feature_old]~^ ERROR: overflow normalizing the type alias `X1` | ||
| //[feature_new]~^^ ERROR: type mismatch resolving `X2 normalizes-to _` | ||
|
|
||
| fn main() {} | ||
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
just a note of the slightly suboptimal diagnostics here compared to the old solver mentioning X1 or X2
View changes since the review