Skip to content

Commit

Permalink
add test for const generic ty's with lifetimes cause opaque types to ICE
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Apr 27, 2024
1 parent 3d1a1db commit 6a5f02b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//@ edition:2021
// issues rust-lang/rust#111911
// test for ICE opaque type with non-universal region substs

#![feature(adt_const_params)]
#![allow(incomplete_features)]

pub async fn foo<const X: &'static str>() {}
//~^ ERROR const parameter `X` is part of concrete type but not used in parameter list for the `impl Trait` type alias
//~| ERROR const parameter `X` is part of concrete type but not used in parameter list for the `impl Trait` type alias
fn bar<const N: &'static u8>() -> impl Sized {}

pub fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
error: const parameter `X` is part of concrete type but not used in parameter list for the `impl Trait` type alias
--> $DIR/opaque_type_with_non-universal_region_substs_ice-111911.rs:8:43
|
LL | pub async fn foo<const X: &'static str>() {}
| ^^

error: const parameter `X` is part of concrete type but not used in parameter list for the `impl Trait` type alias
--> $DIR/opaque_type_with_non-universal_region_substs_ice-111911.rs:8:43
|
LL | pub async fn foo<const X: &'static str>() {}
| ^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: aborting due to 2 previous errors

0 comments on commit 6a5f02b

Please sign in to comment.