Skip to content

Commit 701d464

Browse files
matthiaskrgrblyxyas
authored andcommitted
add test for const generic ty's with lifetimes cause opaque types to ICE
Fixes rust-lang#111911
1 parent bced44c commit 701d464

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ edition:2021
2+
// issues rust-lang/rust#111911
3+
// test for ICE opaque type with non-universal region substs
4+
5+
#![feature(adt_const_params)]
6+
#![allow(incomplete_features)]
7+
8+
pub async fn foo<const X: &'static str>() {}
9+
//~^ ERROR const parameter `X` is part of concrete type but not used in parameter list for the `impl Trait` type alias
10+
//~| ERROR const parameter `X` is part of concrete type but not used in parameter list for the `impl Trait` type alias
11+
fn bar<const N: &'static u8>() -> impl Sized {}
12+
13+
pub fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error: const parameter `X` is part of concrete type but not used in parameter list for the `impl Trait` type alias
2+
--> $DIR/opaque_type_with_non-universal_region_substs_ice-111911.rs:8:43
3+
|
4+
LL | pub async fn foo<const X: &'static str>() {}
5+
| ^^
6+
7+
error: const parameter `X` is part of concrete type but not used in parameter list for the `impl Trait` type alias
8+
--> $DIR/opaque_type_with_non-universal_region_substs_ice-111911.rs:8:43
9+
|
10+
LL | pub async fn foo<const X: &'static str>() {}
11+
| ^^
12+
|
13+
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
14+
15+
error: aborting due to 2 previous errors
16+

0 commit comments

Comments
 (0)