forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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 rust-lang#125776 - compiler-errors:translate-args, r=…
…lcnr Stop using `translate_args` in the new solver It was unnecessary and also sketchy, since it was doing an out-of-search-graph fulfillment loop. Added a test for the only really minor subtlety of translating args, though not sure if it was being tested before, though I wouldn't be surprised if it wasn't. r? lcnr
- Loading branch information
Showing
7 changed files
with
168 additions
and
57 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
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; | ||
} |