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 regression test for rust-lang#73120
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
src/test/ui/const-generics/issues/auxiliary/const_generic_issues_lib.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,14 @@ | ||
#![feature(const_generics)] | ||
|
||
// All of these three items must be in `lib2` to reproduce the error | ||
|
||
pub trait TypeFn { | ||
type Output; | ||
} | ||
|
||
pub struct GenericType<const B: i8>; | ||
|
||
// Removing the braces around `42` resolves the crash | ||
impl TypeFn for GenericType<{ 42 }> { | ||
type Output = (); | ||
} |
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,8 @@ | ||
// check-pass | ||
// aux-build:const_generic_issues_lib.rs | ||
extern crate const_generic_issues_lib as lib2; | ||
fn unused_function( | ||
_: <lib2::GenericType<42> as lib2::TypeFn>::Output | ||
) {} | ||
|
||
fn main() {} |