From f7979d3c9360ae6a4a688729fa518601029a7c76 Mon Sep 17 00:00:00 2001 From: Alex Macleod Date: Fri, 17 Jul 2020 15:45:50 +0100 Subject: [PATCH] Add regression test for #69414 Closes #69414 (no longer ICEs after #74159) --- .../const-param-type-depends-on-type-param-ungated.rs | 3 +++ .../const-param-type-depends-on-type-param-ungated.stderr | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.rs b/src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.rs index db15ececfa436..ea75a3d040358 100644 --- a/src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.rs +++ b/src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.rs @@ -1,3 +1,6 @@ +// compile-flags: -Zsave-analysis +// Regression test for #69414 ^ + use std::marker::PhantomData; struct B(PhantomData<[T; N]>); //~ ERROR const generics are unstable diff --git a/src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.stderr b/src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.stderr index 35996e833610d..616f0fa8f1af0 100644 --- a/src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.stderr +++ b/src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.stderr @@ -1,11 +1,11 @@ error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/const-param-type-depends-on-type-param-ungated.rs:3:22 + --> $DIR/const-param-type-depends-on-type-param-ungated.rs:6:22 | LL | struct B(PhantomData<[T; N]>); | ^ the type must not depend on the parameter `T` error[E0658]: const generics are unstable - --> $DIR/const-param-type-depends-on-type-param-ungated.rs:3:19 + --> $DIR/const-param-type-depends-on-type-param-ungated.rs:6:19 | LL | struct B(PhantomData<[T; N]>); | ^