forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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 const generic ty's with lifetimes cause opaque types to ICE
Fixes rust-lang#111911
- Loading branch information
1 parent
bced44c
commit 701d464
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...onst-generics/adt_const_params/opaque_type_with_non-universal_region_substs_ice-111911.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,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() {} |
16 changes: 16 additions & 0 deletions
16
...-generics/adt_const_params/opaque_type_with_non-universal_region_substs_ice-111911.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,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 | ||
|