Skip to content

Commit b151e06

Browse files
committed
add test for ICE: min_specialization: Ok(['?0, Const { ty: usize, kind: Leaf(0x0000000000000000) }]) is not fully resolved #113045
Fixes #113045
1 parent cdea6d8 commit b151e06

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// ICE min_specialization:
2+
// Ok(['?0, Const { ty: usize, kind: Leaf(0x0000000000000000) }]) is not fully resolved
3+
// issue: rust-lang/rust#113045
4+
5+
#![feature(min_specialization)]
6+
7+
trait X {}
8+
9+
impl<'a, const N: usize> X for [(); N] {}
10+
11+
impl<'a, Unconstrained> X for [(); 0] {}
12+
//~^ ERROR the type parameter `Unconstrained` is not constrained by the impl trait, self type, or predicates
13+
//~| ERROR specialization impl does not specialize any associated items
14+
15+
fn main() {}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
error[E0207]: the type parameter `Unconstrained` is not constrained by the impl trait, self type, or predicates
2+
--> $DIR/ice-const-not-fully-resolved-113045.rs:11:10
3+
|
4+
LL | impl<'a, Unconstrained> X for [(); 0] {}
5+
| ^^^^^^^^^^^^^ unconstrained type parameter
6+
7+
error: specialization impl does not specialize any associated items
8+
--> $DIR/ice-const-not-fully-resolved-113045.rs:11:1
9+
|
10+
LL | impl<'a, Unconstrained> X for [(); 0] {}
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
|
13+
note: impl is a specialization of this impl
14+
--> $DIR/ice-const-not-fully-resolved-113045.rs:9:1
15+
|
16+
LL | impl<'a, const N: usize> X for [(); N] {}
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18+
19+
error: aborting due to 2 previous errors
20+
21+
For more information about this error, try `rustc --explain E0207`.

0 commit comments

Comments
 (0)