Rollup merge of #67543 - JohnTitor:regression-tests, r=Centril

Add regression tests for fixed ICEs

Closes #61747 (fixed from 1.41.0-nightly (4007d4ef2 2019-12-01))
Closes #66205 (fixed from 1.41.0-nightly (4007d4ef2 2019-12-01))
Closes #66270 (fixed by #66246)
Closes #67424 (fixed by #67160)

Also picking a minor nit up from #67071 with 101dd7bad9

r? @Centril
This commit is contained in:
Mazdak Farrokhzad
2019-12-24 04:39:55 +01:00
committed by GitHub
8 changed files with 90 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
// check-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
struct Const<const N: usize>;
impl<const C: usize> Const<{C}> {
fn successor() -> Const<{C + 1}> {
Const
}
}
fn main() {
let _x: Const::<2> = Const::<1>::successor();
}

View File

@@ -0,0 +1,8 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
--> $DIR/issue-61747.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default

View File

@@ -0,0 +1,10 @@
// check-pass
#![allow(incomplete_features, dead_code, unconditional_recursion)]
#![feature(const_generics)]
fn fact<const N: usize>() {
fact::<{ N - 1 }>();
}
fn main() {}