From 96fc98904f9e4b16e427f3e8988b7335cd60cf77 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Mon, 19 Aug 2019 19:33:49 +0300 Subject: [PATCH] test: add test for #61432. --- src/test/ui/const-generics/issue-61432.rs | 17 +++++++++++++++++ src/test/ui/const-generics/issue-61432.stderr | 8 ++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/test/ui/const-generics/issue-61432.rs create mode 100644 src/test/ui/const-generics/issue-61432.stderr diff --git a/src/test/ui/const-generics/issue-61432.rs b/src/test/ui/const-generics/issue-61432.rs new file mode 100644 index 0000000000000..832095ce54206 --- /dev/null +++ b/src/test/ui/const-generics/issue-61432.rs @@ -0,0 +1,17 @@ +// run-pass + +#![feature(const_generics)] +//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash + +fn promote() { + // works: + // + // let n = N; + // &n; + + &N; +} + +fn main() { + promote::<0>(); +} diff --git a/src/test/ui/const-generics/issue-61432.stderr b/src/test/ui/const-generics/issue-61432.stderr new file mode 100644 index 0000000000000..33f77b028104e --- /dev/null +++ b/src/test/ui/const-generics/issue-61432.stderr @@ -0,0 +1,8 @@ +warning: the feature `const_generics` is incomplete and may cause the compiler to crash + --> $DIR/issue-61432.rs:3:12 + | +LL | #![feature(const_generics)] + | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default +