Skip to content

Commit

Permalink
add regression test for rust-lang#73120
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Jul 16, 2020
1 parent de8d2e8 commit 946cb11
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
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 = ();
}
8 changes: 8 additions & 0 deletions src/test/ui/const-generics/issues/issue-73120.rs
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() {}

0 comments on commit 946cb11

Please sign in to comment.