diff options
Diffstat (limited to 'tests/ui/const-generics/issues')
17 files changed, 36 insertions, 46 deletions
diff --git a/tests/ui/const-generics/issues/issue-105821.rs b/tests/ui/const-generics/issues/issue-105821.rs index cba2e22c4..6cfabb65e 100644 --- a/tests/ui/const-generics/issues/issue-105821.rs +++ b/tests/ui/const-generics/issues/issue-105821.rs @@ -1,7 +1,7 @@ // check-pass #![allow(incomplete_features)] -#![feature(adt_const_params, const_ptr_read, generic_const_exprs)] +#![feature(adt_const_params, generic_const_exprs)] #![allow(dead_code)] const fn catone<const M: usize>(_a: &[u8; M]) -> [u8; M + 1] diff --git a/tests/ui/const-generics/issues/issue-56445-1.full.stderr b/tests/ui/const-generics/issues/issue-56445-1.full.stderr index 179643a75..5fc0ec260 100644 --- a/tests/ui/const-generics/issues/issue-56445-1.full.stderr +++ b/tests/ui/const-generics/issues/issue-56445-1.full.stderr @@ -1,11 +1,11 @@ -error[E0771]: use of non-static lifetime `'a` in const generic +error[E0770]: the type of const parameters must not depend on other generic parameters --> $DIR/issue-56445-1.rs:9:26 | LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>); - | ^^ + | ^^ the type must not depend on the parameter `'a` | - = note: for more information, see issue #74052 <https://github.com/rust-lang/rust/issues/74052> + = note: lifetime parameters may not be used in the type of const parameters error: aborting due to previous error -For more information about this error, try `rustc --explain E0771`. +For more information about this error, try `rustc --explain E0770`. diff --git a/tests/ui/const-generics/issues/issue-56445-1.min.stderr b/tests/ui/const-generics/issues/issue-56445-1.min.stderr index 9f8801341..71a7051f2 100644 --- a/tests/ui/const-generics/issues/issue-56445-1.min.stderr +++ b/tests/ui/const-generics/issues/issue-56445-1.min.stderr @@ -1,10 +1,10 @@ -error[E0771]: use of non-static lifetime `'a` in const generic +error[E0770]: the type of const parameters must not depend on other generic parameters --> $DIR/issue-56445-1.rs:9:26 | LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>); - | ^^ + | ^^ the type must not depend on the parameter `'a` | - = note: for more information, see issue #74052 <https://github.com/rust-lang/rust/issues/74052> + = note: lifetime parameters may not be used in the type of const parameters error: `&str` is forbidden as the type of a const generic parameter --> $DIR/issue-56445-1.rs:9:25 @@ -17,4 +17,4 @@ LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>); error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0771`. +For more information about this error, try `rustc --explain E0770`. diff --git a/tests/ui/const-generics/issues/issue-56445-1.rs b/tests/ui/const-generics/issues/issue-56445-1.rs index 0741c3796..d862bf24a 100644 --- a/tests/ui/const-generics/issues/issue-56445-1.rs +++ b/tests/ui/const-generics/issues/issue-56445-1.rs @@ -7,7 +7,7 @@ use std::marker::PhantomData; struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>); -//~^ ERROR: use of non-static lifetime `'a` in const generic +//~^ ERROR: the type of const parameters must not depend on other generic parameters //[min]~| ERROR: `&str` is forbidden as the type of a const generic parameter impl Bug<'_, ""> {} diff --git a/tests/ui/const-generics/issues/issue-62878.full.stderr b/tests/ui/const-generics/issues/issue-62878.full.stderr index 3a2b291d7..c658b5a6e 100644 --- a/tests/ui/const-generics/issues/issue-62878.full.stderr +++ b/tests/ui/const-generics/issues/issue-62878.full.stderr @@ -3,6 +3,8 @@ error[E0770]: the type of const parameters must not depend on other generic para | LL | fn foo<const N: usize, const A: [u8; N]>() {} | ^ the type must not depend on the parameter `N` + | + = note: const parameters may not be used in the type of const parameters error: aborting due to previous error diff --git a/tests/ui/const-generics/issues/issue-62878.min.stderr b/tests/ui/const-generics/issues/issue-62878.min.stderr index 5a721720d..9c0e5179c 100644 --- a/tests/ui/const-generics/issues/issue-62878.min.stderr +++ b/tests/ui/const-generics/issues/issue-62878.min.stderr @@ -3,6 +3,8 @@ error[E0770]: the type of const parameters must not depend on other generic para | LL | fn foo<const N: usize, const A: [u8; N]>() {} | ^ the type must not depend on the parameter `N` + | + = note: const parameters may not be used in the type of const parameters error: `[u8; N]` is forbidden as the type of a const generic parameter --> $DIR/issue-62878.rs:5:33 diff --git a/tests/ui/const-generics/issues/issue-71169.full.stderr b/tests/ui/const-generics/issues/issue-71169.full.stderr index 1f5880f36..ccdfbbd54 100644 --- a/tests/ui/const-generics/issues/issue-71169.full.stderr +++ b/tests/ui/const-generics/issues/issue-71169.full.stderr @@ -3,6 +3,8 @@ error[E0770]: the type of const parameters must not depend on other generic para | LL | fn foo<const LEN: usize, const DATA: [u8; LEN]>() {} | ^^^ the type must not depend on the parameter `LEN` + | + = note: const parameters may not be used in the type of const parameters error: aborting due to previous error diff --git a/tests/ui/const-generics/issues/issue-71169.min.stderr b/tests/ui/const-generics/issues/issue-71169.min.stderr index 998b16a79..ebfb24bec 100644 --- a/tests/ui/const-generics/issues/issue-71169.min.stderr +++ b/tests/ui/const-generics/issues/issue-71169.min.stderr @@ -3,6 +3,8 @@ error[E0770]: the type of const parameters must not depend on other generic para | LL | fn foo<const LEN: usize, const DATA: [u8; LEN]>() {} | ^^^ the type must not depend on the parameter `LEN` + | + = note: const parameters may not be used in the type of const parameters error: `[u8; LEN]` is forbidden as the type of a const generic parameter --> $DIR/issue-71169.rs:5:38 diff --git a/tests/ui/const-generics/issues/issue-71381.full.stderr b/tests/ui/const-generics/issues/issue-71381.full.stderr index e17cf96aa..962eaf75b 100644 --- a/tests/ui/const-generics/issues/issue-71381.full.stderr +++ b/tests/ui/const-generics/issues/issue-71381.full.stderr @@ -3,12 +3,16 @@ error[E0770]: the type of const parameters must not depend on other generic para | LL | pub fn call_me<Args: Sized, const IDX: usize, const FN: unsafe extern "C" fn(Args)>(&self) { | ^^^^ the type must not depend on the parameter `Args` + | + = note: type parameters may not be used in the type of const parameters error[E0770]: the type of const parameters must not depend on other generic parameters --> $DIR/issue-71381.rs:23:40 | LL | const FN: unsafe extern "C" fn(Args), | ^^^^ the type must not depend on the parameter `Args` + | + = note: type parameters may not be used in the type of const parameters error[E0741]: using function pointers as const generic parameters is forbidden --> $DIR/issue-71381.rs:14:61 diff --git a/tests/ui/const-generics/issues/issue-71381.min.stderr b/tests/ui/const-generics/issues/issue-71381.min.stderr index 3950317b3..e1e140071 100644 --- a/tests/ui/const-generics/issues/issue-71381.min.stderr +++ b/tests/ui/const-generics/issues/issue-71381.min.stderr @@ -3,12 +3,16 @@ error[E0770]: the type of const parameters must not depend on other generic para | LL | pub fn call_me<Args: Sized, const IDX: usize, const FN: unsafe extern "C" fn(Args)>(&self) { | ^^^^ the type must not depend on the parameter `Args` + | + = note: type parameters may not be used in the type of const parameters error[E0770]: the type of const parameters must not depend on other generic parameters --> $DIR/issue-71381.rs:23:40 | LL | const FN: unsafe extern "C" fn(Args), | ^^^^ the type must not depend on the parameter `Args` + | + = note: type parameters may not be used in the type of const parameters error: using function pointers as const generic parameters is forbidden --> $DIR/issue-71381.rs:14:61 diff --git a/tests/ui/const-generics/issues/issue-71611.full.stderr b/tests/ui/const-generics/issues/issue-71611.full.stderr index 656aa29e1..e109459f2 100644 --- a/tests/ui/const-generics/issues/issue-71611.full.stderr +++ b/tests/ui/const-generics/issues/issue-71611.full.stderr @@ -3,6 +3,8 @@ error[E0770]: the type of const parameters must not depend on other generic para | LL | fn func<A, const F: fn(inner: A)>(outer: A) { | ^ the type must not depend on the parameter `A` + | + = note: type parameters may not be used in the type of const parameters error[E0741]: using function pointers as const generic parameters is forbidden --> $DIR/issue-71611.rs:5:21 diff --git a/tests/ui/const-generics/issues/issue-71611.min.stderr b/tests/ui/const-generics/issues/issue-71611.min.stderr index 01a85b745..b33d7cf98 100644 --- a/tests/ui/const-generics/issues/issue-71611.min.stderr +++ b/tests/ui/const-generics/issues/issue-71611.min.stderr @@ -3,6 +3,8 @@ error[E0770]: the type of const parameters must not depend on other generic para | LL | fn func<A, const F: fn(inner: A)>(outer: A) { | ^ the type must not depend on the parameter `A` + | + = note: type parameters may not be used in the type of const parameters error: using function pointers as const generic parameters is forbidden --> $DIR/issue-71611.rs:5:21 diff --git a/tests/ui/const-generics/issues/issue-77357.rs b/tests/ui/const-generics/issues/issue-77357.rs deleted file mode 100644 index 3cb8d3846..000000000 --- a/tests/ui/const-generics/issues/issue-77357.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -trait MyTrait<T> {} - -fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> { - //~^ ERROR overly complex generic constant - todo!() -} - -fn main() {} diff --git a/tests/ui/const-generics/issues/issue-77357.stderr b/tests/ui/const-generics/issues/issue-77357.stderr deleted file mode 100644 index 68b35a38b..000000000 --- a/tests/ui/const-generics/issues/issue-77357.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: overly complex generic constant - --> $DIR/issue-77357.rs:6:46 - | -LL | fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ blocks are not supported in generic constants - | - = help: consider moving this anonymous constant into a `const` function - = note: this operation may be supported in the future - -error: aborting due to previous error - diff --git a/tests/ui/const-generics/issues/issue-83993.rs b/tests/ui/const-generics/issues/issue-83993.rs deleted file mode 100644 index f2f05d952..000000000 --- a/tests/ui/const-generics/issues/issue-83993.rs +++ /dev/null @@ -1,14 +0,0 @@ -// check-pass - -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -fn bug<'a>() -where - for<'b> [(); { - let x: &'b (); - 0 - }]: -{} - -fn main() {} diff --git a/tests/ui/const-generics/issues/issue-88997.stderr b/tests/ui/const-generics/issues/issue-88997.stderr index 505ba0da2..b49d52dd0 100644 --- a/tests/ui/const-generics/issues/issue-88997.stderr +++ b/tests/ui/const-generics/issues/issue-88997.stderr @@ -3,12 +3,16 @@ error[E0770]: the type of const parameters must not depend on other generic para | LL | struct Range<T: PartialOrd, const MIN: T, const MAX: T>(T) | ^ the type must not depend on the parameter `T` + | + = note: type parameters may not be used in the type of const parameters error[E0770]: the type of const parameters must not depend on other generic parameters --> $DIR/issue-88997.rs:8:54 | LL | struct Range<T: PartialOrd, const MIN: T, const MAX: T>(T) | ^ the type must not depend on the parameter `T` + | + = note: type parameters may not be used in the type of const parameters error: aborting due to 2 previous errors diff --git a/tests/ui/const-generics/issues/issue-90364.stderr b/tests/ui/const-generics/issues/issue-90364.stderr index e85bd136e..23424d7b9 100644 --- a/tests/ui/const-generics/issues/issue-90364.stderr +++ b/tests/ui/const-generics/issues/issue-90364.stderr @@ -3,6 +3,8 @@ error[E0770]: the type of const parameters must not depend on other generic para | LL | pub struct Foo<T, const H: T>(T) | ^ the type must not depend on the parameter `T` + | + = note: type parameters may not be used in the type of const parameters error: aborting due to previous error |