diff options
| author | varkor <github@varkor.com> | 2019-02-16 13:03:58 +0000 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-02-16 13:03:58 +0000 |
| commit | 425fb58cacb9dbded92e46ee1bdeaa9dda4a219e (patch) | |
| tree | 59343aa4461b52f4e139406cbe60dabb527b4144 /src/test | |
| parent | 2a1b6c52d34aa021a3930fdea954b3228fba0f71 (diff) | |
| download | rust-425fb58cacb9dbded92e46ee1bdeaa9dda4a219e.tar.gz rust-425fb58cacb9dbded92e46ee1bdeaa9dda4a219e.zip | |
Don't abort early when collecting const generics
Diffstat (limited to 'src/test')
4 files changed, 16 insertions, 2 deletions
diff --git a/src/test/ui/const-generics/const-param-before-other-params.rs b/src/test/ui/const-generics/const-param-before-other-params.rs index 3f120cbc4d3..47f826789e0 100644 --- a/src/test/ui/const-generics/const-param-before-other-params.rs +++ b/src/test/ui/const-generics/const-param-before-other-params.rs @@ -8,6 +8,7 @@ fn foo<const X: (), T>(_: T) { fn bar<const X: (), 'a>(_: &'a ()) { //~^ ERROR lifetime parameters must be declared prior to const parameters + //~^^ ERROR const generics in any position are currently unsupported } fn main() {} diff --git a/src/test/ui/const-generics/const-param-before-other-params.stderr b/src/test/ui/const-generics/const-param-before-other-params.stderr index aedcaf52e26..a43415d0e5a 100644 --- a/src/test/ui/const-generics/const-param-before-other-params.stderr +++ b/src/test/ui/const-generics/const-param-before-other-params.stderr @@ -22,5 +22,11 @@ error: const generics in any position are currently unsupported LL | fn foo<const X: (), T>(_: T) { | ^ -error: aborting due to 3 previous errors +error: const generics in any position are currently unsupported + --> $DIR/const-param-before-other-params.rs:9:14 + | +LL | fn bar<const X: (), 'a>(_: &'a ()) { + | ^ + +error: aborting due to 4 previous errors diff --git a/src/test/ui/feature-gates/feature-gate-const_generics.rs b/src/test/ui/feature-gates/feature-gate-const_generics.rs index a8a4ed57722..907e00b11e5 100644 --- a/src/test/ui/feature-gates/feature-gate-const_generics.rs +++ b/src/test/ui/feature-gates/feature-gate-const_generics.rs @@ -2,5 +2,6 @@ fn foo<const X: ()>() {} //~ ERROR const generics are unstable //~^ const generics in any position are currently unsupported struct Foo<const X: usize>([(); X]); //~ ERROR const generics are unstable +//~^ const generics in any position are currently unsupported fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-const_generics.stderr b/src/test/ui/feature-gates/feature-gate-const_generics.stderr index 905cc07b6a1..3ab1aa2367f 100644 --- a/src/test/ui/feature-gates/feature-gate-const_generics.stderr +++ b/src/test/ui/feature-gates/feature-gate-const_generics.stderr @@ -20,6 +20,12 @@ error: const generics in any position are currently unsupported LL | fn foo<const X: ()>() {} //~ ERROR const generics are unstable | ^ -error: aborting due to 3 previous errors +error: const generics in any position are currently unsupported + --> $DIR/feature-gate-const_generics.rs:4:18 + | +LL | struct Foo<const X: usize>([(); X]); //~ ERROR const generics are unstable + | ^ + +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0658`. |
