-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop using translate_args in the new solver
- Loading branch information
1 parent
91c0823
commit c3cb059
Showing
8 changed files
with
311 additions
and
21 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
190 changes: 190 additions & 0 deletions
190
tests/ui/specialization/source-impl-requires-constraining-predicates-ambig.current.stderr
Large diffs are not rendered by default.
Oops, something went wrong.
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:13: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 | ||
|
28 changes: 28 additions & 0 deletions
28
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,28 @@ | ||
//@ 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 | ||
|
||
// 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; | ||
} |