-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test for ICE: min_specialization: Ok(['?0, Const { ty: usize, kin…
- Loading branch information
1 parent
cdea6d8
commit b151e06
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
tests/ui/specialization/min_specialization/ice-const-not-fully-resolved-113045.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,15 @@ | ||
// ICE min_specialization: | ||
// Ok(['?0, Const { ty: usize, kind: Leaf(0x0000000000000000) }]) is not fully resolved | ||
// issue: rust-lang/rust#113045 | ||
|
||
#![feature(min_specialization)] | ||
|
||
trait X {} | ||
|
||
impl<'a, const N: usize> X for [(); N] {} | ||
|
||
impl<'a, Unconstrained> X for [(); 0] {} | ||
//~^ ERROR the type parameter `Unconstrained` is not constrained by the impl trait, self type, or predicates | ||
//~| ERROR specialization impl does not specialize any associated items | ||
|
||
fn main() {} |
21 changes: 21 additions & 0 deletions
21
tests/ui/specialization/min_specialization/ice-const-not-fully-resolved-113045.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,21 @@ | ||
error[E0207]: the type parameter `Unconstrained` is not constrained by the impl trait, self type, or predicates | ||
--> $DIR/ice-const-not-fully-resolved-113045.rs:11:10 | ||
| | ||
LL | impl<'a, Unconstrained> X for [(); 0] {} | ||
| ^^^^^^^^^^^^^ unconstrained type parameter | ||
|
||
error: specialization impl does not specialize any associated items | ||
--> $DIR/ice-const-not-fully-resolved-113045.rs:11:1 | ||
| | ||
LL | impl<'a, Unconstrained> X for [(); 0] {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: impl is a specialization of this impl | ||
--> $DIR/ice-const-not-fully-resolved-113045.rs:9:1 | ||
| | ||
LL | impl<'a, const N: usize> X for [(); N] {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0207`. |