-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Stop using translate_args
in the new solver
#125776
Merged
Merged
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions
12
tests/ui/specialization/source-impl-requires-constraining-predicates-ambig.next.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,12 @@ | ||
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/source-impl-requires-constraining-predicates-ambig.rs:14:12 | ||
| | ||
LL | #![feature(specialization)] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information | ||
= help: consider using `min_specialization` instead, which is more stable and complete | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|
29 changes: 29 additions & 0 deletions
29
tests/ui/specialization/source-impl-requires-constraining-predicates-ambig.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,29 @@ | ||
//@ revisions: current next | ||
//@ ignore-compare-mode-next-solver (explicit revisions) | ||
//@[next] compile-flags: -Znext-solver | ||
//@[next] check-pass | ||
//@[current] known-bug: unknown | ||
//@[current] failure-status: 101 | ||
//@[current] dont-check-compiler-stderr | ||
|
||
// Tests that rebasing from the concrete impl to the default impl also processes the | ||
// `[u32; 0]: IntoIterator<Item = ?U>` predicate to constrain the `?U` impl arg. | ||
// This test also makes sure that we don't do anything weird when rebasing the args | ||
// is ambiguous. | ||
|
||
#![feature(specialization)] | ||
//[next]~^ WARN the feature `specialization` is incomplete | ||
|
||
trait Spec { | ||
type Assoc; | ||
} | ||
|
||
default impl<T, U> Spec for T where T: IntoIterator<Item = U> { | ||
type Assoc = U; | ||
} | ||
|
||
impl<T> Spec for [T; 0] {} | ||
|
||
fn main() { | ||
let x: <[_; 0] as Spec>::Assoc = 1; | ||
} |
12 changes: 12 additions & 0 deletions
12
tests/ui/specialization/source-impl-requires-constraining-predicates.current.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,12 @@ | ||
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/source-impl-requires-constraining-predicates.rs:9:12 | ||
| | ||
LL | #![feature(specialization)] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information | ||
= help: consider using `min_specialization` instead, which is more stable and complete | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|
12 changes: 12 additions & 0 deletions
12
tests/ui/specialization/source-impl-requires-constraining-predicates.next.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,12 @@ | ||
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/source-impl-requires-constraining-predicates.rs:9:12 | ||
| | ||
LL | #![feature(specialization)] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information | ||
= help: consider using `min_specialization` instead, which is more stable and complete | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|
24 changes: 24 additions & 0 deletions
24
tests/ui/specialization/source-impl-requires-constraining-predicates.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,24 @@ | ||
//@ check-pass | ||
//@ revisions: current next | ||
//@ ignore-compare-mode-next-solver (explicit revisions) | ||
//@[next] compile-flags: -Znext-solver | ||
|
||
// Tests that rebasing from the concrete impl to the default impl also processes the | ||
// `[u32; 0]: IntoIterator<Item = ?U>` predicate to constrain the `?U` impl arg. | ||
|
||
#![feature(specialization)] | ||
//~^ WARN the feature `specialization` is incomplete | ||
|
||
trait Spec { | ||
type Assoc; | ||
} | ||
|
||
default impl<T, U> Spec for T where T: IntoIterator<Item = U> { | ||
type Assoc = U; | ||
} | ||
|
||
impl<T> Spec for [T; 0] {} | ||
|
||
fn main() { | ||
let x: <[u32; 0] as Spec>::Assoc = 1; | ||
} |
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.
you're not testing the
[_; 0]
ice?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.
No, because it's not fixed in the old solver. Could add one for the new solver if you want?
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.
Added a test for the ambiguity case, and known-bug:unknown in the old solver