Skip to content

Commit

Permalink
add test for ICE: min_specialization: Ok(['?0, Const { ty: usize, kin…
Browse files Browse the repository at this point in the history
…d: Leaf(0x0000000000000000) }]) is not fully resolved #113045

Fixes #113045
  • Loading branch information
matthiaskrgr committed Mar 24, 2024
1 parent cdea6d8 commit b151e06
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
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() {}
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`.

0 comments on commit b151e06

Please sign in to comment.