summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/min_const_generics
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/const-generics/min_const_generics')
-rw-r--r--src/test/ui/const-generics/min_const_generics/assoc_const.rs16
-rw-r--r--src/test/ui/const-generics/min_const_generics/complex-expression.rs48
-rw-r--r--src/test/ui/const-generics/min_const_generics/complex-expression.stderr75
-rw-r--r--src/test/ui/const-generics/min_const_generics/complex-types.rs27
-rw-r--r--src/test/ui/const-generics/min_const_generics/complex-types.stderr65
-rw-r--r--src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.rs35
-rw-r--r--src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.stderr30
-rw-r--r--src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.rs47
-rw-r--r--src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.stderr140
-rw-r--r--src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.rs51
-rw-r--r--src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr143
-rw-r--r--src/test/ui/const-generics/min_const_generics/const_default_first.rs7
-rw-r--r--src/test/ui/const-generics/min_const_generics/const_default_first.stderr8
-rw-r--r--src/test/ui/const-generics/min_const_generics/const_fn_in_generics.rs15
-rw-r--r--src/test/ui/const-generics/min_const_generics/default_function_param.rs4
-rw-r--r--src/test/ui/const-generics/min_const_generics/default_function_param.stderr8
-rw-r--r--src/test/ui/const-generics/min_const_generics/default_trait_param.rs4
-rw-r--r--src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs25
-rw-r--r--src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr21
-rw-r--r--src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.rs15
-rw-r--r--src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.stderr14
-rw-r--r--src/test/ui/const-generics/min_const_generics/inferred_const.rs9
-rw-r--r--src/test/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr62
-rw-r--r--src/test/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr62
-rw-r--r--src/test/ui/const-generics/min_const_generics/invalid-patterns.rs47
-rw-r--r--src/test/ui/const-generics/min_const_generics/macro-fail.rs39
-rw-r--r--src/test/ui/const-generics/min_const_generics/macro-fail.stderr71
-rw-r--r--src/test/ui/const-generics/min_const_generics/macro.rs55
-rw-r--r--src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.rs25
-rw-r--r--src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr23
-rw-r--r--src/test/ui/const-generics/min_const_generics/self-ty-in-const-2.rs19
-rw-r--r--src/test/ui/const-generics/min_const_generics/self-ty-in-const-2.stderr14
-rw-r--r--src/test/ui/const-generics/min_const_generics/type_and_const_defaults.rs25
33 files changed, 0 insertions, 1249 deletions
diff --git a/src/test/ui/const-generics/min_const_generics/assoc_const.rs b/src/test/ui/const-generics/min_const_generics/assoc_const.rs
deleted file mode 100644
index 27e971b5b..000000000
--- a/src/test/ui/const-generics/min_const_generics/assoc_const.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// check-pass
-struct Foo<const N: usize>;
-
-impl<const N: usize> Foo<N> {
- const VALUE: usize = N * 2;
-}
-
-trait Bar {
- const ASSOC: usize;
-}
-
-impl<const N: usize> Bar for Foo<N> {
- const ASSOC: usize = N * 3;
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/min_const_generics/complex-expression.rs b/src/test/ui/const-generics/min_const_generics/complex-expression.rs
deleted file mode 100644
index 8e667aeba..000000000
--- a/src/test/ui/const-generics/min_const_generics/complex-expression.rs
+++ /dev/null
@@ -1,48 +0,0 @@
-// compile-flags: -Zdeduplicate-diagnostics=yes
-use std::mem::size_of;
-
-fn test<const N: usize>() {}
-
-fn ok<const M: usize>() -> [u8; M] {
- [0; { M }]
-}
-
-struct Break0<const N: usize>([u8; { N + 1 }]);
-//~^ ERROR generic parameters may not be used in const operations
-
-struct Break1<const N: usize>([u8; { { N } }]);
-//~^ ERROR generic parameters may not be used in const operations
-
-fn break2<const N: usize>() {
- let _: [u8; N + 1];
- //~^ ERROR generic parameters may not be used in const operations
-}
-
-fn break3<const N: usize>() {
- let _ = [0; N + 1];
- //~^ ERROR generic parameters may not be used in const operations
-}
-
-struct BreakTy0<T>(T, [u8; { size_of::<*mut T>() }]);
-//~^ ERROR generic parameters may not be used in const operations
-
-struct BreakTy1<T>(T, [u8; { { size_of::<*mut T>() } }]);
-//~^ ERROR generic parameters may not be used in const operations
-
-fn break_ty2<T>() {
- let _: [u8; size_of::<*mut T>() + 1];
- //~^ ERROR generic parameters may not be used in const operations
-}
-
-fn break_ty3<T>() {
- let _ = [0; size_of::<*mut T>() + 1];
- //~^ WARN cannot use constants which depend on generic parameters in types
- //~| WARN this was previously accepted by the compiler but is being phased out
-}
-
-
-trait Foo {
- const ASSOC: usize;
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr b/src/test/ui/const-generics/min_const_generics/complex-expression.stderr
deleted file mode 100644
index deabd05a6..000000000
--- a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr
+++ /dev/null
@@ -1,75 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/complex-expression.rs:10:38
- |
-LL | struct Break0<const N: usize>([u8; { N + 1 }]);
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/complex-expression.rs:13:40
- |
-LL | struct Break1<const N: usize>([u8; { { N } }]);
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/complex-expression.rs:17:17
- |
-LL | let _: [u8; N + 1];
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/complex-expression.rs:22:17
- |
-LL | let _ = [0; N + 1];
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/complex-expression.rs:26:45
- |
-LL | struct BreakTy0<T>(T, [u8; { size_of::<*mut T>() }]);
- | ^ cannot perform const operation using `T`
- |
- = note: type parameters may not be used in const expressions
- = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/complex-expression.rs:29:47
- |
-LL | struct BreakTy1<T>(T, [u8; { { size_of::<*mut T>() } }]);
- | ^ cannot perform const operation using `T`
- |
- = note: type parameters may not be used in const expressions
- = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/complex-expression.rs:33:32
- |
-LL | let _: [u8; size_of::<*mut T>() + 1];
- | ^ cannot perform const operation using `T`
- |
- = note: type parameters may not be used in const expressions
- = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
-
-warning: cannot use constants which depend on generic parameters in types
- --> $DIR/complex-expression.rs:38:17
- |
-LL | let _ = [0; size_of::<*mut T>() + 1];
- | ^^^^^^^^^^^^^^^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
- = note: `#[warn(const_evaluatable_unchecked)]` on by default
-
-error: aborting due to 7 previous errors; 1 warning emitted
-
diff --git a/src/test/ui/const-generics/min_const_generics/complex-types.rs b/src/test/ui/const-generics/min_const_generics/complex-types.rs
deleted file mode 100644
index 057bd5af8..000000000
--- a/src/test/ui/const-generics/min_const_generics/complex-types.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-#![feature(never_type)]
-
-struct Foo<const N: [u8; 0]>;
-//~^ ERROR `[u8; 0]` is forbidden
-
-struct Bar<const N: ()>;
-//~^ ERROR `()` is forbidden
-#[derive(PartialEq, Eq)]
-struct No;
-
-struct Fez<const N: No>;
-//~^ ERROR `No` is forbidden
-
-struct Faz<const N: &'static u8>;
-//~^ ERROR `&'static u8` is forbidden
-
-struct Fiz<const N: !>;
-//~^ ERROR `!` is forbidden
-
-enum Goo<const N: ()> { A, B }
-//~^ ERROR `()` is forbidden
-
-union Boo<const N: ()> { a: () }
-//~^ ERROR `()` is forbidden
-
-
-fn main() {}
diff --git a/src/test/ui/const-generics/min_const_generics/complex-types.stderr b/src/test/ui/const-generics/min_const_generics/complex-types.stderr
deleted file mode 100644
index 4ddbadb54..000000000
--- a/src/test/ui/const-generics/min_const_generics/complex-types.stderr
+++ /dev/null
@@ -1,65 +0,0 @@
-error: `[u8; 0]` is forbidden as the type of a const generic parameter
- --> $DIR/complex-types.rs:3:21
- |
-LL | struct Foo<const N: [u8; 0]>;
- | ^^^^^^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(adt_const_params)]`
-
-error: `()` is forbidden as the type of a const generic parameter
- --> $DIR/complex-types.rs:6:21
- |
-LL | struct Bar<const N: ()>;
- | ^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(adt_const_params)]`
-
-error: `No` is forbidden as the type of a const generic parameter
- --> $DIR/complex-types.rs:11:21
- |
-LL | struct Fez<const N: No>;
- | ^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(adt_const_params)]`
-
-error: `&'static u8` is forbidden as the type of a const generic parameter
- --> $DIR/complex-types.rs:14:21
- |
-LL | struct Faz<const N: &'static u8>;
- | ^^^^^^^^^^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(adt_const_params)]`
-
-error: `!` is forbidden as the type of a const generic parameter
- --> $DIR/complex-types.rs:17:21
- |
-LL | struct Fiz<const N: !>;
- | ^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(adt_const_params)]`
-
-error: `()` is forbidden as the type of a const generic parameter
- --> $DIR/complex-types.rs:20:19
- |
-LL | enum Goo<const N: ()> { A, B }
- | ^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(adt_const_params)]`
-
-error: `()` is forbidden as the type of a const generic parameter
- --> $DIR/complex-types.rs:23:20
- |
-LL | union Boo<const N: ()> { a: () }
- | ^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(adt_const_params)]`
-
-error: aborting due to 7 previous errors
-
diff --git a/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.rs b/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.rs
deleted file mode 100644
index e9d868093..000000000
--- a/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.rs
+++ /dev/null
@@ -1,35 +0,0 @@
-// check-pass
-// compile-flags: -Zdeduplicate-diagnostics=yes
-#![allow(dead_code)]
-
-fn foo<T>() {
- [0; std::mem::size_of::<*mut T>()];
- //~^ WARN cannot use constants which depend on generic parameters in types
- //~| WARN this was previously accepted by the compiler but is being phased out
-}
-
-struct Foo<T>(T);
-
-impl<T> Foo<T> {
- const ASSOC: usize = 4;
-
- fn test() {
- let _ = [0; Self::ASSOC];
- //~^ WARN cannot use constants which depend on generic parameters in types
- //~| WARN this was previously accepted by the compiler but is being phased out
- }
-}
-
-struct Bar<const N: usize>;
-
-impl<const N: usize> Bar<N> {
- const ASSOC: usize = 4;
-
- fn test() {
- let _ = [0; Self::ASSOC];
- //~^ WARN cannot use constants which depend on generic parameters in types
- //~| WARN this was previously accepted by the compiler but is being phased out
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.stderr b/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.stderr
deleted file mode 100644
index 8003dfa40..000000000
--- a/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.stderr
+++ /dev/null
@@ -1,30 +0,0 @@
-warning: cannot use constants which depend on generic parameters in types
- --> $DIR/const-evaluatable-unchecked.rs:6:9
- |
-LL | [0; std::mem::size_of::<*mut T>()];
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
- = note: `#[warn(const_evaluatable_unchecked)]` on by default
-
-warning: cannot use constants which depend on generic parameters in types
- --> $DIR/const-evaluatable-unchecked.rs:17:21
- |
-LL | let _ = [0; Self::ASSOC];
- | ^^^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
-
-warning: cannot use constants which depend on generic parameters in types
- --> $DIR/const-evaluatable-unchecked.rs:29:21
- |
-LL | let _ = [0; Self::ASSOC];
- | ^^^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
-
-warning: 3 warnings emitted
-
diff --git a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.rs b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.rs
deleted file mode 100644
index fac3777cf..000000000
--- a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.rs
+++ /dev/null
@@ -1,47 +0,0 @@
-fn foo<const C: usize>() {}
-
-const BAR: usize = 42;
-
-fn a() {
- foo<BAR + 3>(); //~ ERROR comparison operators cannot be chained
-}
-fn b() {
- foo<BAR + BAR>(); //~ ERROR comparison operators cannot be chained
-}
-fn c() {
- foo<3 + 3>(); //~ ERROR comparison operators cannot be chained
-}
-fn d() {
- foo<BAR - 3>(); //~ ERROR comparison operators cannot be chained
-}
-fn e() {
- foo<BAR - BAR>(); //~ ERROR comparison operators cannot be chained
-}
-fn f() {
- foo<100 - BAR>(); //~ ERROR comparison operators cannot be chained
-}
-fn g() {
- foo<bar<i32>()>(); //~ ERROR comparison operators cannot be chained
- //~^ ERROR expected one of `;` or `}`, found `>`
-}
-fn h() {
- foo<bar::<i32>()>(); //~ ERROR comparison operators cannot be chained
-}
-fn i() {
- foo<bar::<i32>() + BAR>(); //~ ERROR comparison operators cannot be chained
-}
-fn j() {
- foo<bar::<i32>() - BAR>(); //~ ERROR comparison operators cannot be chained
-}
-fn k() {
- foo<BAR - bar::<i32>()>(); //~ ERROR comparison operators cannot be chained
-}
-fn l() {
- foo<BAR - bar::<i32>()>(); //~ ERROR comparison operators cannot be chained
-}
-
-const fn bar<const C: usize>() -> usize {
- C
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.stderr b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.stderr
deleted file mode 100644
index a6825b845..000000000
--- a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.stderr
+++ /dev/null
@@ -1,140 +0,0 @@
-error: comparison operators cannot be chained
- --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:6:8
- |
-LL | foo<BAR + 3>();
- | ^ ^
- |
-help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
- |
-LL | foo::<BAR + 3>();
- | ++
-
-error: comparison operators cannot be chained
- --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:9:8
- |
-LL | foo<BAR + BAR>();
- | ^ ^
- |
-help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
- |
-LL | foo::<BAR + BAR>();
- | ++
-
-error: comparison operators cannot be chained
- --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:12:8
- |
-LL | foo<3 + 3>();
- | ^ ^
- |
-help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
- |
-LL | foo::<3 + 3>();
- | ++
-
-error: comparison operators cannot be chained
- --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:15:8
- |
-LL | foo<BAR - 3>();
- | ^ ^
- |
-help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
- |
-LL | foo::<BAR - 3>();
- | ++
-
-error: comparison operators cannot be chained
- --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:18:8
- |
-LL | foo<BAR - BAR>();
- | ^ ^
- |
-help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
- |
-LL | foo::<BAR - BAR>();
- | ++
-
-error: comparison operators cannot be chained
- --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:21:8
- |
-LL | foo<100 - BAR>();
- | ^ ^
- |
-help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
- |
-LL | foo::<100 - BAR>();
- | ++
-
-error: comparison operators cannot be chained
- --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:24:8
- |
-LL | foo<bar<i32>()>();
- | ^ ^
- |
-help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
- |
-LL | foo::<bar<i32>()>();
- | ++
-
-error: expected one of `;` or `}`, found `>`
- --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:24:19
- |
-LL | foo<bar<i32>()>();
- | ^ expected one of `;` or `}`
-
-error: comparison operators cannot be chained
- --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:28:8
- |
-LL | foo<bar::<i32>()>();
- | ^ ^
- |
-help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
- |
-LL | foo::<bar::<i32>()>();
- | ++
-
-error: comparison operators cannot be chained
- --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:31:8
- |
-LL | foo<bar::<i32>() + BAR>();
- | ^ ^
- |
-help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
- |
-LL | foo::<bar::<i32>() + BAR>();
- | ++
-
-error: comparison operators cannot be chained
- --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:34:8
- |
-LL | foo<bar::<i32>() - BAR>();
- | ^ ^
- |
-help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
- |
-LL | foo::<bar::<i32>() - BAR>();
- | ++
-
-error: comparison operators cannot be chained
- --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:37:8
- |
-LL | foo<BAR - bar::<i32>()>();
- | ^ ^
- |
-help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
- |
-LL | foo::<BAR - bar::<i32>()>();
- | ++
-
-error: comparison operators cannot be chained
- --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:40:8
- |
-LL | foo<BAR - bar::<i32>()>();
- | ^ ^
- |
-help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
- |
-LL | foo::<BAR - bar::<i32>()>();
- | ++
-
-error: aborting due to 13 previous errors
-
diff --git a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.rs b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.rs
deleted file mode 100644
index e12e07a28..000000000
--- a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.rs
+++ /dev/null
@@ -1,51 +0,0 @@
-fn foo<const C: usize>() {}
-
-const BAR: usize = 42;
-
-fn a() {
- foo::<BAR + 3>(); //~ ERROR expected one of
-}
-fn b() {
- // FIXME(const_generics): these diagnostics are awful, because trait objects without `dyn` were
- // a terrible mistake.
- foo::<BAR + BAR>();
- //~^ ERROR expected trait, found constant `BAR`
- //~| ERROR expected trait, found constant `BAR`
- //~| ERROR type provided when a constant was expected
-}
-fn c() {
- foo::<3 + 3>(); //~ ERROR expressions must be enclosed in braces
-}
-fn d() {
- foo::<BAR - 3>(); //~ ERROR expected one of
-}
-fn e() {
- foo::<BAR - BAR>(); //~ ERROR expected one of
-}
-fn f() {
- foo::<100 - BAR>(); //~ ERROR expressions must be enclosed in braces
-}
-fn g() {
- foo::<bar<i32>()>(); //~ ERROR expected one of
-}
-fn h() {
- foo::<bar::<i32>()>(); //~ ERROR expected one of
-}
-fn i() {
- foo::<bar::<i32>() + BAR>(); //~ ERROR expected one of
-}
-fn j() {
- foo::<bar::<i32>() - BAR>(); //~ ERROR expected one of
-}
-fn k() {
- foo::<BAR - bar::<i32>()>(); //~ ERROR expected one of
-}
-fn l() {
- foo::<BAR - bar::<i32>()>(); //~ ERROR expected one of
-}
-
-const fn bar<const C: usize>() -> usize {
- C
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr
deleted file mode 100644
index d9bcc523b..000000000
--- a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr
+++ /dev/null
@@ -1,143 +0,0 @@
-error: expected one of `,` or `>`, found `3`
- --> $DIR/const-expression-suggest-missing-braces.rs:6:17
- |
-LL | foo::<BAR + 3>();
- | ^ expected one of `,` or `>`
- |
-help: expressions must be enclosed in braces to be used as const generic arguments
- |
-LL | foo::<{ BAR + 3 }>();
- | + +
-
-error: expressions must be enclosed in braces to be used as const generic arguments
- --> $DIR/const-expression-suggest-missing-braces.rs:17:11
- |
-LL | foo::<3 + 3>();
- | ^^^^^
- |
-help: enclose the `const` expression in braces
- |
-LL | foo::<{ 3 + 3 }>();
- | + +
-
-error: expected one of `,` or `>`, found `-`
- --> $DIR/const-expression-suggest-missing-braces.rs:20:15
- |
-LL | foo::<BAR - 3>();
- | ^ expected one of `,` or `>`
- |
-help: expressions must be enclosed in braces to be used as const generic arguments
- |
-LL | foo::<{ BAR - 3 }>();
- | + +
-
-error: expected one of `,` or `>`, found `-`
- --> $DIR/const-expression-suggest-missing-braces.rs:23:15
- |
-LL | foo::<BAR - BAR>();
- | ^ expected one of `,` or `>`
- |
-help: expressions must be enclosed in braces to be used as const generic arguments
- |
-LL | foo::<{ BAR - BAR }>();
- | + +
-
-error: expressions must be enclosed in braces to be used as const generic arguments
- --> $DIR/const-expression-suggest-missing-braces.rs:26:11
- |
-LL | foo::<100 - BAR>();
- | ^^^^^^^^^
- |
-help: enclose the `const` expression in braces
- |
-LL | foo::<{ 100 - BAR }>();
- | + +
-
-error: expected one of `,` or `>`, found `(`
- --> $DIR/const-expression-suggest-missing-braces.rs:29:19
- |
-LL | foo::<bar<i32>()>();
- | ^ expected one of `,` or `>`
- |
-help: expressions must be enclosed in braces to be used as const generic arguments
- |
-LL | foo::<{ bar<i32>() }>();
- | + +
-
-error: expected one of `,` or `>`, found `(`
- --> $DIR/const-expression-suggest-missing-braces.rs:32:21
- |
-LL | foo::<bar::<i32>()>();
- | ^ expected one of `,` or `>`
- |
-help: expressions must be enclosed in braces to be used as const generic arguments
- |
-LL | foo::<{ bar::<i32>() }>();
- | + +
-
-error: expected one of `,` or `>`, found `(`
- --> $DIR/const-expression-suggest-missing-braces.rs:35:21
- |
-LL | foo::<bar::<i32>() + BAR>();
- | ^ expected one of `,` or `>`
- |
-help: expressions must be enclosed in braces to be used as const generic arguments
- |
-LL | foo::<{ bar::<i32>() + BAR }>();
- | + +
-
-error: expected one of `,` or `>`, found `(`
- --> $DIR/const-expression-suggest-missing-braces.rs:38:21
- |
-LL | foo::<bar::<i32>() - BAR>();
- | ^ expected one of `,` or `>`
- |
-help: expressions must be enclosed in braces to be used as const generic arguments
- |
-LL | foo::<{ bar::<i32>() - BAR }>();
- | + +
-
-error: expected one of `,` or `>`, found `-`
- --> $DIR/const-expression-suggest-missing-braces.rs:41:15
- |
-LL | foo::<BAR - bar::<i32>()>();
- | ^ expected one of `,` or `>`
- |
-help: expressions must be enclosed in braces to be used as const generic arguments
- |
-LL | foo::<{ BAR - bar::<i32>() }>();
- | + +
-
-error: expected one of `,` or `>`, found `-`
- --> $DIR/const-expression-suggest-missing-braces.rs:44:15
- |
-LL | foo::<BAR - bar::<i32>()>();
- | ^ expected one of `,` or `>`
- |
-help: expressions must be enclosed in braces to be used as const generic arguments
- |
-LL | foo::<{ BAR - bar::<i32>() }>();
- | + +
-
-error[E0404]: expected trait, found constant `BAR`
- --> $DIR/const-expression-suggest-missing-braces.rs:11:11
- |
-LL | foo::<BAR + BAR>();
- | ^^^ not a trait
-
-error[E0404]: expected trait, found constant `BAR`
- --> $DIR/const-expression-suggest-missing-braces.rs:11:17
- |
-LL | foo::<BAR + BAR>();
- | ^^^ not a trait
-
-error[E0747]: type provided when a constant was expected
- --> $DIR/const-expression-suggest-missing-braces.rs:11:11
- |
-LL | foo::<BAR + BAR>();
- | ^^^^^^^^^
-
-error: aborting due to 14 previous errors
-
-Some errors have detailed explanations: E0404, E0747.
-For more information about an error, try `rustc --explain E0404`.
diff --git a/src/test/ui/const-generics/min_const_generics/const_default_first.rs b/src/test/ui/const-generics/min_const_generics/const_default_first.rs
deleted file mode 100644
index eafafb8a2..000000000
--- a/src/test/ui/const-generics/min_const_generics/const_default_first.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-#![crate_type = "lib"]
-#![allow(dead_code)]
-
-struct Both<const N: usize=3, T> {
-//~^ ERROR: generic parameters with a default must be
- v: T
-}
diff --git a/src/test/ui/const-generics/min_const_generics/const_default_first.stderr b/src/test/ui/const-generics/min_const_generics/const_default_first.stderr
deleted file mode 100644
index 0d5a393cb..000000000
--- a/src/test/ui/const-generics/min_const_generics/const_default_first.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: generic parameters with a default must be trailing
- --> $DIR/const_default_first.rs:4:19
- |
-LL | struct Both<const N: usize=3, T> {
- | ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/min_const_generics/const_fn_in_generics.rs b/src/test/ui/const-generics/min_const_generics/const_fn_in_generics.rs
deleted file mode 100644
index 0c10af6c4..000000000
--- a/src/test/ui/const-generics/min_const_generics/const_fn_in_generics.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// run-pass
-
-const fn identity<const T: u32>() -> u32 { T }
-
-#[derive(Eq, PartialEq, Debug)]
-pub struct ConstU32<const U: u32>;
-
-pub fn new() -> ConstU32<{ identity::<3>() }> {
- ConstU32::<{ identity::<3>() }>
-}
-
-fn main() {
- let v = new();
- assert_eq!(v, ConstU32::<3>);
-}
diff --git a/src/test/ui/const-generics/min_const_generics/default_function_param.rs b/src/test/ui/const-generics/min_const_generics/default_function_param.rs
deleted file mode 100644
index 92d495ef6..000000000
--- a/src/test/ui/const-generics/min_const_generics/default_function_param.rs
+++ /dev/null
@@ -1,4 +0,0 @@
-#![crate_type = "lib"]
-
-fn foo<const SIZE: usize = 5usize>() {}
-//~^ ERROR defaults for const parameters are
diff --git a/src/test/ui/const-generics/min_const_generics/default_function_param.stderr b/src/test/ui/const-generics/min_const_generics/default_function_param.stderr
deleted file mode 100644
index dedad2880..000000000
--- a/src/test/ui/const-generics/min_const_generics/default_function_param.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
- --> $DIR/default_function_param.rs:3:8
- |
-LL | fn foo<const SIZE: usize = 5usize>() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/min_const_generics/default_trait_param.rs b/src/test/ui/const-generics/min_const_generics/default_trait_param.rs
deleted file mode 100644
index 9cd5e3279..000000000
--- a/src/test/ui/const-generics/min_const_generics/default_trait_param.rs
+++ /dev/null
@@ -1,4 +0,0 @@
-// check-pass
-trait Foo<const KIND: bool = true> {}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs
deleted file mode 100644
index 6215b7d93..000000000
--- a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-// This test checks that non-static lifetimes are prohibited under `min_const_generics`. It
-// currently emits an error with `min_const_generics`.
-
-fn test<const N: usize>() {}
-
-fn issue_75323_and_74447_1<'a>() -> &'a () {
- test::<{ let _: &'a (); 3 },>();
- //~^ ERROR a non-static lifetime is not allowed in a `const`
- &()
-}
-
-fn issue_75323_and_74447_2() {
- test::<{ let _: &(); 3 },>();
-}
-
-fn issue_75323_and_74447_3() {
- test::<{ let _: &'static (); 3 },>();
-}
-
-fn issue_73375<'a>() {
- [(); (|_: &'a u8| (), 0).1];
- //~^ ERROR a non-static lifetime is not allowed in a `const`
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr
deleted file mode 100644
index 5f641b070..000000000
--- a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0658]: a non-static lifetime is not allowed in a `const`
- --> $DIR/forbid-non-static-lifetimes.rs:7:22
- |
-LL | test::<{ let _: &'a (); 3 },>();
- | ^^
- |
- = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
- = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
-
-error[E0658]: a non-static lifetime is not allowed in a `const`
- --> $DIR/forbid-non-static-lifetimes.rs:21:16
- |
-LL | [(); (|_: &'a u8| (), 0).1];
- | ^^
- |
- = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
- = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.rs b/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.rs
deleted file mode 100644
index e1cf7b579..000000000
--- a/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-trait AlwaysApplicable {
- type Assoc;
-}
-impl<T: ?Sized> AlwaysApplicable for T {
- type Assoc = usize;
-}
-
-trait BindsParam<T> {
- type ArrayTy;
-}
-impl<T> BindsParam<T> for <T as AlwaysApplicable>::Assoc {
- type ArrayTy = [u8; Self::MAX]; //~ ERROR generic `Self` types
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.stderr b/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.stderr
deleted file mode 100644
index bda885970..000000000
--- a/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: generic `Self` types are currently not permitted in anonymous constants
- --> $DIR/forbid-self-no-normalize.rs:12:25
- |
-LL | type ArrayTy = [u8; Self::MAX];
- | ^^^^
- |
-note: not a concrete type
- --> $DIR/forbid-self-no-normalize.rs:11:27
- |
-LL | impl<T> BindsParam<T> for <T as AlwaysApplicable>::Assoc {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/min_const_generics/inferred_const.rs b/src/test/ui/const-generics/min_const_generics/inferred_const.rs
deleted file mode 100644
index 57d694158..000000000
--- a/src/test/ui/const-generics/min_const_generics/inferred_const.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-#![feature(generic_arg_infer)]
-// run-pass
-
-fn foo<const N: usize, const K: usize>(_data: [u32; N]) -> [u32; K] {
- [0; K]
-}
-fn main() {
- let _a = foo::<_, 2>([0, 1, 2]);
-}
diff --git a/src/test/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr b/src/test/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr
deleted file mode 100644
index be92429e3..000000000
--- a/src/test/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr
+++ /dev/null
@@ -1,62 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/invalid-patterns.rs:29:21
- |
-LL | get_flag::<false, 0xFF>();
- | ^^^^ expected `char`, found `u8`
-
-error[E0308]: mismatched types
- --> $DIR/invalid-patterns.rs:31:14
- |
-LL | get_flag::<7, 'c'>();
- | ^ expected `bool`, found integer
-
-error[E0308]: mismatched types
- --> $DIR/invalid-patterns.rs:33:14
- |
-LL | get_flag::<42, 0x5ad>();
- | ^^ expected `bool`, found integer
-
-error[E0308]: mismatched types
- --> $DIR/invalid-patterns.rs:33:18
- |
-LL | get_flag::<42, 0x5ad>();
- | ^^^^^ expected `char`, found `u8`
-
-error[E0080]: evaluation of constant value failed
- --> $DIR/invalid-patterns.rs:38:32
- |
-LL | get_flag::<false, { unsafe { char_raw.character } }>();
- | ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
-
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/invalid-patterns.rs:41:14
- |
-LL | get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean
- |
- = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
- = note: the raw bytes of the constant (size: 1, align: 1) {
- 42 │ B
- }
-
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/invalid-patterns.rs:43:14
- |
-LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean
- |
- = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
- = note: the raw bytes of the constant (size: 1, align: 1) {
- 42 │ B
- }
-
-error[E0080]: evaluation of constant value failed
- --> $DIR/invalid-patterns.rs:43:58
- |
-LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
- | ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
-
-error: aborting due to 8 previous errors
-
-Some errors have detailed explanations: E0080, E0308.
-For more information about an error, try `rustc --explain E0080`.
diff --git a/src/test/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr b/src/test/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr
deleted file mode 100644
index be92429e3..000000000
--- a/src/test/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr
+++ /dev/null
@@ -1,62 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/invalid-patterns.rs:29:21
- |
-LL | get_flag::<false, 0xFF>();
- | ^^^^ expected `char`, found `u8`
-
-error[E0308]: mismatched types
- --> $DIR/invalid-patterns.rs:31:14
- |
-LL | get_flag::<7, 'c'>();
- | ^ expected `bool`, found integer
-
-error[E0308]: mismatched types
- --> $DIR/invalid-patterns.rs:33:14
- |
-LL | get_flag::<42, 0x5ad>();
- | ^^ expected `bool`, found integer
-
-error[E0308]: mismatched types
- --> $DIR/invalid-patterns.rs:33:18
- |
-LL | get_flag::<42, 0x5ad>();
- | ^^^^^ expected `char`, found `u8`
-
-error[E0080]: evaluation of constant value failed
- --> $DIR/invalid-patterns.rs:38:32
- |
-LL | get_flag::<false, { unsafe { char_raw.character } }>();
- | ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
-
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/invalid-patterns.rs:41:14
- |
-LL | get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean
- |
- = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
- = note: the raw bytes of the constant (size: 1, align: 1) {
- 42 │ B
- }
-
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/invalid-patterns.rs:43:14
- |
-LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean
- |
- = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
- = note: the raw bytes of the constant (size: 1, align: 1) {
- 42 │ B
- }
-
-error[E0080]: evaluation of constant value failed
- --> $DIR/invalid-patterns.rs:43:58
- |
-LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
- | ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
-
-error: aborting due to 8 previous errors
-
-Some errors have detailed explanations: E0080, E0308.
-For more information about an error, try `rustc --explain E0080`.
diff --git a/src/test/ui/const-generics/min_const_generics/invalid-patterns.rs b/src/test/ui/const-generics/min_const_generics/invalid-patterns.rs
deleted file mode 100644
index 13b2cca2f..000000000
--- a/src/test/ui/const-generics/min_const_generics/invalid-patterns.rs
+++ /dev/null
@@ -1,47 +0,0 @@
-// stderr-per-bitwidth
-use std::mem::transmute;
-
-fn get_flag<const FlagSet: bool, const ShortName: char>() -> Option<char> {
- if FlagSet {
- Some(ShortName)
- } else {
- None
- }
-}
-
-union CharRaw {
- byte: u8,
- character: char,
-}
-
-union BoolRaw {
- byte: u8,
- boolean: bool,
-}
-
-const char_raw: CharRaw = CharRaw { byte: 0xFF };
-const bool_raw: BoolRaw = BoolRaw { byte: 0x42 };
-
-fn main() {
- // Test that basic cases don't work
- assert!(get_flag::<true, 'c'>().is_some());
- assert!(get_flag::<false, 'x'>().is_none());
- get_flag::<false, 0xFF>();
- //~^ ERROR mismatched types
- get_flag::<7, 'c'>();
- //~^ ERROR mismatched types
- get_flag::<42, 0x5ad>();
- //~^ ERROR mismatched types
- //~| ERROR mismatched types
-
-
- get_flag::<false, { unsafe { char_raw.character } }>();
- //~^ ERROR evaluation of constant value failed
- //~| uninitialized
- get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>();
- //~^ ERROR it is undefined behavior
- get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
- //~^ ERROR evaluation of constant value failed
- //~| uninitialized
- //~| ERROR it is undefined behavior
-}
diff --git a/src/test/ui/const-generics/min_const_generics/macro-fail.rs b/src/test/ui/const-generics/min_const_generics/macro-fail.rs
deleted file mode 100644
index 7fb69032e..000000000
--- a/src/test/ui/const-generics/min_const_generics/macro-fail.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-struct Example<const N: usize>;
-
-macro_rules! external_macro {
- () => {{
- //~^ ERROR expected type
- const X: usize = 1337;
- X
- }}
-}
-
-trait Marker<const N: usize> {}
-impl<const N: usize> Marker<N> for Example<N> {}
-
-fn make_marker() -> impl Marker<gimme_a_const!(marker)> {
- //~^ ERROR: type provided when a constant was expected
- Example::<gimme_a_const!(marker)>
-}
-
-fn from_marker(_: impl Marker<{
- #[macro_export]
- macro_rules! inline { () => {{ 3 }} }; inline!()
-}>) {}
-
-fn main() {
- let _ok = Example::<{
- #[macro_export]
- macro_rules! gimme_a_const {
- ($rusty: ident) => {{ let $rusty = 3; *&$rusty }}
- //~^ ERROR expected type
- //~| ERROR expected type
- };
- gimme_a_const!(run)
- }>;
-
- let _fail = Example::<external_macro!()>;
-
- let _fail = Example::<gimme_a_const!()>;
- //~^ ERROR unexpected end of macro invocation
-}
diff --git a/src/test/ui/const-generics/min_const_generics/macro-fail.stderr b/src/test/ui/const-generics/min_const_generics/macro-fail.stderr
deleted file mode 100644
index 9f73b91aa..000000000
--- a/src/test/ui/const-generics/min_const_generics/macro-fail.stderr
+++ /dev/null
@@ -1,71 +0,0 @@
-error: expected type, found `{`
- --> $DIR/macro-fail.rs:28:27
- |
-LL | fn make_marker() -> impl Marker<gimme_a_const!(marker)> {
- | ----------------------
- | |
- | this macro call doesn't expand to a type
- | in this macro invocation
-...
-LL | ($rusty: ident) => {{ let $rusty = 3; *&$rusty }}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type
- |
- = note: this error originates in the macro `gimme_a_const` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: expected type, found `{`
- --> $DIR/macro-fail.rs:28:27
- |
-LL | Example::<gimme_a_const!(marker)>
- | ----------------------
- | |
- | this macro call doesn't expand to a type
- | in this macro invocation
-...
-LL | ($rusty: ident) => {{ let $rusty = 3; *&$rusty }}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type
- |
- = note: this error originates in the macro `gimme_a_const` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: expected type, found `{`
- --> $DIR/macro-fail.rs:4:10
- |
-LL | () => {{
- | __________^
-LL | |
-LL | | const X: usize = 1337;
-LL | | X
-LL | | }}
- | |___^ expected type
-...
-LL | let _fail = Example::<external_macro!()>;
- | -----------------
- | |
- | this macro call doesn't expand to a type
- | in this macro invocation
- |
- = note: this error originates in the macro `external_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: unexpected end of macro invocation
- --> $DIR/macro-fail.rs:37:25
- |
-LL | macro_rules! gimme_a_const {
- | -------------------------- when calling this macro
-...
-LL | let _fail = Example::<gimme_a_const!()>;
- | ^^^^^^^^^^^^^^^^ missing tokens in macro arguments
- |
-note: while trying to match meta-variable `$rusty:ident`
- --> $DIR/macro-fail.rs:28:8
- |
-LL | ($rusty: ident) => {{ let $rusty = 3; *&$rusty }}
- | ^^^^^^^^^^^^^
-
-error[E0747]: type provided when a constant was expected
- --> $DIR/macro-fail.rs:14:33
- |
-LL | fn make_marker() -> impl Marker<gimme_a_const!(marker)> {
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 5 previous errors
-
-For more information about this error, try `rustc --explain E0747`.
diff --git a/src/test/ui/const-generics/min_const_generics/macro.rs b/src/test/ui/const-generics/min_const_generics/macro.rs
deleted file mode 100644
index 9b63f7698..000000000
--- a/src/test/ui/const-generics/min_const_generics/macro.rs
+++ /dev/null
@@ -1,55 +0,0 @@
-// run-pass
-struct Example<const N: usize>;
-
-macro_rules! external_macro {
- () => {{
- const X: usize = 1337;
- X
- }}
-}
-
-trait Marker<const N: usize> {}
-impl<const N: usize> Marker<N> for Example<N> {}
-
-fn make_marker() -> impl Marker<{
- #[macro_export]
- macro_rules! const_macro { () => {{ 3 }} } inline!()
-}> {
- Example::<{ const_macro!() }>
-}
-
-fn from_marker(_: impl Marker<{
- #[macro_export]
- macro_rules! inline { () => {{ 3 }} } inline!()
-}>) {}
-
-fn main() {
- let _ok = Example::<{
- #[macro_export]
- macro_rules! gimme_a_const {
- ($rusty: ident) => {{ let $rusty = 3; *&$rusty }}
- }
- gimme_a_const!(run)
- }>;
-
- let _ok = Example::<{ external_macro!() }>;
-
- let _ok: [_; gimme_a_const!(blah)] = [0,0,0];
- let _ok: [[u8; gimme_a_const!(blah)]; gimme_a_const!(blah)];
- let _ok: [u8; gimme_a_const!(blah)];
-
- let _ok: [u8; {
- #[macro_export]
- macro_rules! const_two { () => {{ 2 }} }
- const_two!()
- }];
-
- let _ok = [0; {
- #[macro_export]
- macro_rules! const_three { () => {{ 3 }} }
- const_three!()
- }];
- let _ok = [0; const_three!()];
-
- from_marker(make_marker());
-}
diff --git a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.rs b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.rs
deleted file mode 100644
index 9ef619365..000000000
--- a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-trait Foo {
- fn t1() -> [u8; std::mem::size_of::<Self>()]; //~ERROR generic parameters
-}
-
-struct Bar<T>(T);
-
-impl Bar<u8> {
- fn t2() -> [u8; std::mem::size_of::<Self>()] { todo!() } // ok
-}
-
-impl<T> Bar<T> {
- fn t3() -> [u8; std::mem::size_of::<Self>()] {} //~ERROR generic `Self`
-}
-
-trait Baz {
- fn hey();
-}
-
-impl Baz for u16 {
- fn hey() {
- let _: [u8; std::mem::size_of::<Self>()]; // ok
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr
deleted file mode 100644
index 16a7687c0..000000000
--- a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/self-ty-in-const-1.rs:2:41
- |
-LL | fn t1() -> [u8; std::mem::size_of::<Self>()];
- | ^^^^ cannot perform const operation using `Self`
- |
- = note: type parameters may not be used in const expressions
- = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
-
-error: generic `Self` types are currently not permitted in anonymous constants
- --> $DIR/self-ty-in-const-1.rs:12:41
- |
-LL | fn t3() -> [u8; std::mem::size_of::<Self>()] {}
- | ^^^^
- |
-note: not a concrete type
- --> $DIR/self-ty-in-const-1.rs:11:9
- |
-LL | impl<T> Bar<T> {
- | ^^^^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-2.rs b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-2.rs
deleted file mode 100644
index 286ec2d24..000000000
--- a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-2.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-struct Bar<T>(T);
-
-trait Baz {
- fn hey();
-}
-
-impl Baz for u16 {
- fn hey() {
- let _: [u8; std::mem::size_of::<Self>()]; // ok
- }
-}
-
-impl<T> Baz for Bar<T> {
- fn hey() {
- let _: [u8; std::mem::size_of::<Self>()]; //~ERROR generic `Self`
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-2.stderr b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-2.stderr
deleted file mode 100644
index 41546292c..000000000
--- a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-2.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: generic `Self` types are currently not permitted in anonymous constants
- --> $DIR/self-ty-in-const-2.rs:15:41
- |
-LL | let _: [u8; std::mem::size_of::<Self>()];
- | ^^^^
- |
-note: not a concrete type
- --> $DIR/self-ty-in-const-2.rs:13:17
- |
-LL | impl<T> Baz for Bar<T> {
- | ^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/min_const_generics/type_and_const_defaults.rs b/src/test/ui/const-generics/min_const_generics/type_and_const_defaults.rs
deleted file mode 100644
index fa119c59f..000000000
--- a/src/test/ui/const-generics/min_const_generics/type_and_const_defaults.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-// run-pass
-#![allow(dead_code)]
-
-struct Both<T=u32, const N: usize=3> {
- arr: [T; N]
-}
-
-trait BothTrait<T=u32, const N: usize=3> {}
-
-enum BothEnum<T=u32, const N: usize=3> {
- Dummy([T; N])
-}
-
-struct OppOrder<const N: usize=3, T=u32> {
- arr: [T; N]
-}
-
-fn main() {
- let _ = OppOrder::<3, u32> {
- arr: [0,0,0],
- };
- let _ = Both::<u8, 1> {
- arr: [0],
- };
-}