update tests

This commit is contained in:
Bastian Kauschke 2020-11-17 11:44:21 +01:00
parent 18fa7789cd
commit c4ba60a191
449 changed files with 658 additions and 950 deletions

View File

@ -1,6 +1,5 @@
// check-pass
// edition:2018
#![feature(min_const_generics)]
trait ValidTrait {}
/// This has docs

View File

@ -1,7 +1,5 @@
// ignore-tidy-linelength
// edition:2018
#![feature(min_const_generics)]
// @has async_fn/fn.foo.html '//pre[@class="rust fn"]' 'pub async fn foo() -> Option<Foo>'
pub async fn foo() -> Option<Foo> {
None

View File

@ -1,6 +1,4 @@
// edition:2018
#![feature(min_const_generics)]
pub fn extern_fn<const N: usize>() -> impl Iterator<Item = [u8; N]> {
[[0; N]; N].iter().copied()
}

View File

@ -1,6 +1,5 @@
// edition:2018
// aux-build: extern_crate.rs
#![feature(min_const_generics)]
#![crate_name = "foo"]
extern crate extern_crate;

View File

@ -1,5 +1,4 @@
// ignore-tidy-linelength
#![feature(min_const_generics)]
#![crate_name = "foo"]
// @has foo/type.CellIndex.html '//pre[@class="rust typedef"]' 'type CellIndex<const D: usize> = [i64; D];'

View File

@ -6,7 +6,6 @@ LL | #![feature(const_generics)]
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error[E0308]: mismatched types
--> $DIR/match_arr_unknown_len.rs:6:9

View File

@ -14,8 +14,7 @@ impl Foo for Def {
pub fn test<A: Foo, B: Foo>() {
let _array: [u32; <A as Foo>::Y];
//~^ ERROR the trait bound `A: Foo` is not satisfied [E0277]
//~^ ERROR generic parameters may not be used
}
fn main() {
}
fn main() {}

View File

@ -1,17 +1,11 @@
error[E0277]: the trait bound `A: Foo` is not satisfied
--> $DIR/associated-const-type-parameter-arrays.rs:16:23
error: generic parameters may not be used in const operations
--> $DIR/associated-const-type-parameter-arrays.rs:16:24
|
LL | const Y: usize;
| --------------- required by `Foo::Y`
...
LL | let _array: [u32; <A as Foo>::Y];
| ^^^^^^^^^^^^^ the trait `Foo` is not implemented for `A`
| ^ cannot perform const operation using `A`
|
help: consider further restricting this bound
|
LL | pub fn test<A: Foo + Foo, B: Foo>() {
| ^^^^^
= note: type parameters may not be used in const expressions
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.

View File

@ -5,7 +5,7 @@ trait Adapter {
struct Foo<A: Adapter> {
adapter: A,
links: [u32; A::LINKS], // Shouldn't suggest bounds already there.
//~^ ERROR: no associated item named `LINKS` found
//~^ ERROR generic parameters may not be used in const operations
}
fn main() {}

View File

@ -1,11 +1,11 @@
error[E0599]: no associated item named `LINKS` found for type parameter `A` in the current scope
--> $DIR/associated-item-duplicate-bounds.rs:7:21
error: generic parameters may not be used in const operations
--> $DIR/associated-item-duplicate-bounds.rs:7:18
|
LL | links: [u32; A::LINKS], // Shouldn't suggest bounds already there.
| ^^^^^ associated item not found in `A`
| ^^^^^^^^ cannot perform const operation using `A`
|
= help: items from traits can only be used if the type parameter is bounded by the trait
= note: type parameters may not be used in const expressions
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.

View File

@ -1,11 +1,11 @@
error[E0573]: expected type, found built-in attribute `feature`
--> $DIR/issue-78654.rs:10:15
--> $DIR/issue-78654.rs:9:15
|
LL | impl<const H: feature> Foo {
| ^^^^^^^ not a type
error[E0207]: the const parameter `H` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-78654.rs:10:12
--> $DIR/issue-78654.rs:9:12
|
LL | impl<const H: feature> Foo {
| ^ unconstrained const parameter

View File

@ -1,11 +1,11 @@
error[E0573]: expected type, found built-in attribute `feature`
--> $DIR/issue-78654.rs:10:15
--> $DIR/issue-78654.rs:9:15
|
LL | impl<const H: feature> Foo {
| ^^^^^^^ not a type
error[E0207]: the const parameter `H` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-78654.rs:10:12
--> $DIR/issue-78654.rs:9:12
|
LL | impl<const H: feature> Foo {
| ^ unconstrained const parameter

View File

@ -3,7 +3,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
struct Foo;

View File

@ -0,0 +1,9 @@
error[E0158]: const parameters cannot be referenced in patterns
--> $DIR/const-param.rs:8:9
|
LL | N => {}
| ^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0158`.

View File

@ -0,0 +1,9 @@
error[E0158]: const parameters cannot be referenced in patterns
--> $DIR/const-param.rs:8:9
|
LL | N => {}
| ^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0158`.

View File

@ -1,6 +1,7 @@
// Identifier pattern referring to a const generic parameter is an error (issue #68853).
#![feature(const_generics)] //~ WARN the feature `const_generics` is incomplete
// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
fn check<const N: usize>() {
match 1 {

View File

@ -1,19 +0,0 @@
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-param.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error[E0158]: const parameters cannot be referenced in patterns
--> $DIR/const-param.rs:7:9
|
LL | N => {}
| ^
error: aborting due to previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0158`.

View File

@ -3,7 +3,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
trait Trait {}

View File

@ -1,11 +1,11 @@
error: lifetime parameters must be declared prior to const parameters
--> $DIR/argument_order.rs:12:32
--> $DIR/argument_order.rs:11:32
|
LL | struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
| -----------------^^-----^^-------------------- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, const N: usize, T, const M: usize, U>`
error[E0747]: lifetime provided when a type was expected
--> $DIR/argument_order.rs:20:23
--> $DIR/argument_order.rs:19:23
|
LL | let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
| ^^^^^^^

View File

@ -1,23 +1,23 @@
error: type parameters must be declared prior to const parameters
--> $DIR/argument_order.rs:6:28
--> $DIR/argument_order.rs:5:28
|
LL | struct Bad<const N: usize, T> {
| -----------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const N: usize>`
error: lifetime parameters must be declared prior to const parameters
--> $DIR/argument_order.rs:12:32
--> $DIR/argument_order.rs:11:32
|
LL | struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
| -----------------^^-----^^-------------------- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T, U, const N: usize, const M: usize>`
error: type parameters must be declared prior to const parameters
--> $DIR/argument_order.rs:12:36
--> $DIR/argument_order.rs:11:36
|
LL | struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
| ---------------------^----------------------^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T, U, const N: usize, const M: usize>`
error[E0747]: lifetime provided when a type was expected
--> $DIR/argument_order.rs:20:23
--> $DIR/argument_order.rs:19:23
|
LL | let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
| ^^^^^^^

View File

@ -1,7 +1,6 @@
// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
struct Bad<const N: usize, T> {
//[min]~^ ERROR type parameters must be declared prior to const parameters

View File

@ -1,5 +1,5 @@
error: constant expression depends on a generic parameter
--> $DIR/array-size-in-generic-struct-param.rs:9:38
--> $DIR/array-size-in-generic-struct-param.rs:8:38
|
LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
| ^^^^^^^^^^^^
@ -7,7 +7,7 @@ LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
= note: this may fail depending on what value the parameter takes
error: constant expression depends on a generic parameter
--> $DIR/array-size-in-generic-struct-param.rs:20:10
--> $DIR/array-size-in-generic-struct-param.rs:19:10
|
LL | arr: [u8; CFG.arr_size],
| ^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: generic parameters may not be used in const operations
--> $DIR/array-size-in-generic-struct-param.rs:9:48
--> $DIR/array-size-in-generic-struct-param.rs:8:48
|
LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
| ^ cannot perform const operation using `N`
@ -8,7 +8,7 @@ LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/array-size-in-generic-struct-param.rs:20:15
--> $DIR/array-size-in-generic-struct-param.rs:19:15
|
LL | arr: [u8; CFG.arr_size],
| ^^^ cannot perform const operation using `CFG`
@ -17,7 +17,7 @@ LL | arr: [u8; CFG.arr_size],
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
error: `Config` is forbidden as the type of a const generic parameter
--> $DIR/array-size-in-generic-struct-param.rs:18:21
--> $DIR/array-size-in-generic-struct-param.rs:17:21
|
LL | struct B<const CFG: Config> {
| ^^^^^^

View File

@ -3,7 +3,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
#[allow(dead_code)]
struct ArithArrayLen<const N: usize>([u32; 0 + N]);

View File

@ -2,7 +2,6 @@
// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
#![allow(dead_code)]

View File

@ -1,5 +1,5 @@
error[E0277]: the trait bound `u16: Bar<N>` is not satisfied
--> $DIR/associated-type-bound-fail.rs:14:5
--> $DIR/associated-type-bound-fail.rs:13:5
|
LL | type Assoc: Bar<N>;
| ------ required by this bound in `Foo::Assoc`

View File

@ -1,5 +1,5 @@
error[E0277]: the trait bound `u16: Bar<N>` is not satisfied
--> $DIR/associated-type-bound-fail.rs:14:5
--> $DIR/associated-type-bound-fail.rs:13:5
|
LL | type Assoc: Bar<N>;
| ------ required by this bound in `Foo::Assoc`

View File

@ -1,7 +1,6 @@
// revisions: full min
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(min, feature(min_const_generics))]
trait Bar<const N: usize> {}

View File

@ -2,7 +2,6 @@
// revisions: full min
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(min, feature(min_const_generics))]
trait Bar<const N: usize> {}

View File

@ -1,6 +1,5 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
pub struct Struct<const N: usize>(pub [u8; N]);

View File

@ -1,7 +1,6 @@
// edition:2018
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
pub trait Foo<const N: usize> {}
struct Local;

View File

@ -1,6 +1,5 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
pub struct Num<const N: usize>;

View File

@ -3,7 +3,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
pub trait Foo {
fn foo(&self);

View File

@ -3,7 +3,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
use std::fmt::Debug;

View File

@ -2,7 +2,6 @@
// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
// This test confirms that the types can be inferred correctly for this example with const
// generics. Previously this would ICE, and more recently error.

View File

@ -1,5 +1,5 @@
error: expressions must be enclosed in braces to be used as const generic arguments
--> $DIR/closing-args-token.rs:11:9
--> $DIR/closing-args-token.rs:10:9
|
LL | S::<5 + 2 >> 7>;
| ^^^^^
@ -10,7 +10,7 @@ LL | S::<{ 5 + 2 } >> 7>;
| ^ ^
error: comparison operators cannot be chained
--> $DIR/closing-args-token.rs:11:16
--> $DIR/closing-args-token.rs:10:16
|
LL | S::<5 + 2 >> 7>;
| ^ ^
@ -21,7 +21,7 @@ LL | S::<5 + 2 >> 7 && 7>;
| ^^^^
error: comparison operators cannot be chained
--> $DIR/closing-args-token.rs:17:20
--> $DIR/closing-args-token.rs:16:20
|
LL | S::<{ 5 + 2 } >> 7>;
| ^ ^
@ -32,13 +32,13 @@ LL | S::<{ 5 + 2 } >> 7 && 7>;
| ^^^^
error: expected expression, found `;`
--> $DIR/closing-args-token.rs:22:16
--> $DIR/closing-args-token.rs:21:16
|
LL | T::<0 >= 3>;
| ^ expected expression
error: comparison operators cannot be chained
--> $DIR/closing-args-token.rs:28:12
--> $DIR/closing-args-token.rs:27:12
|
LL | T::<x >>= 2 > 0>;
| ^^ ^

View File

@ -1,5 +1,5 @@
error: expressions must be enclosed in braces to be used as const generic arguments
--> $DIR/closing-args-token.rs:11:9
--> $DIR/closing-args-token.rs:10:9
|
LL | S::<5 + 2 >> 7>;
| ^^^^^
@ -10,7 +10,7 @@ LL | S::<{ 5 + 2 } >> 7>;
| ^ ^
error: comparison operators cannot be chained
--> $DIR/closing-args-token.rs:11:16
--> $DIR/closing-args-token.rs:10:16
|
LL | S::<5 + 2 >> 7>;
| ^ ^
@ -21,7 +21,7 @@ LL | S::<5 + 2 >> 7 && 7>;
| ^^^^
error: comparison operators cannot be chained
--> $DIR/closing-args-token.rs:17:20
--> $DIR/closing-args-token.rs:16:20
|
LL | S::<{ 5 + 2 } >> 7>;
| ^ ^
@ -32,13 +32,13 @@ LL | S::<{ 5 + 2 } >> 7 && 7>;
| ^^^^
error: expected expression, found `;`
--> $DIR/closing-args-token.rs:22:16
--> $DIR/closing-args-token.rs:21:16
|
LL | T::<0 >= 3>;
| ^ expected expression
error: comparison operators cannot be chained
--> $DIR/closing-args-token.rs:28:12
--> $DIR/closing-args-token.rs:27:12
|
LL | T::<x >>= 2 > 0>;
| ^^ ^

View File

@ -2,7 +2,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
struct S<const X: u32>;
struct T<const X: bool>;

View File

@ -3,7 +3,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
fn foo<const N: usize>(v: &[u8; N]) -> &[u8] {
v

View File

@ -4,7 +4,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
struct A<const N: usize>; // ok

View File

@ -5,7 +5,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
pub struct A<const N: u32>;

View File

@ -4,7 +4,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
trait IsZeroTrait<const IS_ZERO: bool>{}

View File

@ -1,5 +1,5 @@
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:14:23
--> $DIR/const-arg-in-const-arg.rs:13:23
|
LL | let _: [u8; foo::<T>()];
| ^ cannot perform const operation using `T`
@ -8,7 +8,7 @@ LL | let _: [u8; foo::<T>()];
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:15:23
--> $DIR/const-arg-in-const-arg.rs:14:23
|
LL | let _: [u8; bar::<N>()];
| ^ cannot perform const operation using `N`
@ -17,7 +17,7 @@ LL | let _: [u8; bar::<N>()];
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:25:23
--> $DIR/const-arg-in-const-arg.rs:24:23
|
LL | let _ = [0; bar::<N>()];
| ^ cannot perform const operation using `N`
@ -26,7 +26,7 @@ LL | let _ = [0; bar::<N>()];
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:30:24
--> $DIR/const-arg-in-const-arg.rs:29:24
|
LL | let _: Foo<{ foo::<T>() }>;
| ^ cannot perform const operation using `T`
@ -35,7 +35,7 @@ LL | let _: Foo<{ foo::<T>() }>;
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:31:24
--> $DIR/const-arg-in-const-arg.rs:30:24
|
LL | let _: Foo<{ bar::<N>() }>;
| ^ cannot perform const operation using `N`
@ -44,7 +44,7 @@ LL | let _: Foo<{ bar::<N>() }>;
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:36:27
--> $DIR/const-arg-in-const-arg.rs:35:27
|
LL | let _ = Foo::<{ foo::<T>() }>;
| ^ cannot perform const operation using `T`
@ -53,7 +53,7 @@ LL | let _ = Foo::<{ foo::<T>() }>;
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:37:27
--> $DIR/const-arg-in-const-arg.rs:36:27
|
LL | let _ = Foo::<{ bar::<N>() }>;
| ^ cannot perform const operation using `N`
@ -62,7 +62,7 @@ LL | let _ = Foo::<{ bar::<N>() }>;
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:16:23
--> $DIR/const-arg-in-const-arg.rs:15:23
|
LL | let _: [u8; faz::<'a>(&())];
| ^^
@ -71,7 +71,7 @@ LL | let _: [u8; faz::<'a>(&())];
= help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:17:23
--> $DIR/const-arg-in-const-arg.rs:16:23
|
LL | let _: [u8; baz::<'a>(&())];
| ^^
@ -80,7 +80,7 @@ LL | let _: [u8; baz::<'a>(&())];
= help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:18:23
--> $DIR/const-arg-in-const-arg.rs:17:23
|
LL | let _: [u8; faz::<'b>(&())];
| ^^
@ -89,7 +89,7 @@ LL | let _: [u8; faz::<'b>(&())];
= help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:19:23
--> $DIR/const-arg-in-const-arg.rs:18:23
|
LL | let _: [u8; baz::<'b>(&())];
| ^^
@ -98,7 +98,7 @@ LL | let _: [u8; baz::<'b>(&())];
= help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:26:23
--> $DIR/const-arg-in-const-arg.rs:25:23
|
LL | let _ = [0; faz::<'a>(&())];
| ^^
@ -107,7 +107,7 @@ LL | let _ = [0; faz::<'a>(&())];
= help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:27:23
--> $DIR/const-arg-in-const-arg.rs:26:23
|
LL | let _ = [0; baz::<'a>(&())];
| ^^
@ -116,7 +116,7 @@ LL | let _ = [0; baz::<'a>(&())];
= help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:28:23
--> $DIR/const-arg-in-const-arg.rs:27:23
|
LL | let _ = [0; faz::<'b>(&())];
| ^^
@ -125,7 +125,7 @@ LL | let _ = [0; faz::<'b>(&())];
= help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:29:23
--> $DIR/const-arg-in-const-arg.rs:28:23
|
LL | let _ = [0; baz::<'b>(&())];
| ^^
@ -134,7 +134,7 @@ LL | let _ = [0; baz::<'b>(&())];
= help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:32:24
--> $DIR/const-arg-in-const-arg.rs:31:24
|
LL | let _: Foo<{ faz::<'a>(&()) }>;
| ^^
@ -143,7 +143,7 @@ LL | let _: Foo<{ faz::<'a>(&()) }>;
= help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:33:24
--> $DIR/const-arg-in-const-arg.rs:32:24
|
LL | let _: Foo<{ baz::<'a>(&()) }>;
| ^^
@ -152,7 +152,7 @@ LL | let _: Foo<{ baz::<'a>(&()) }>;
= help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:34:24
--> $DIR/const-arg-in-const-arg.rs:33:24
|
LL | let _: Foo<{ faz::<'b>(&()) }>;
| ^^
@ -161,7 +161,7 @@ LL | let _: Foo<{ faz::<'b>(&()) }>;
= help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:35:24
--> $DIR/const-arg-in-const-arg.rs:34:24
|
LL | let _: Foo<{ baz::<'b>(&()) }>;
| ^^
@ -170,7 +170,7 @@ LL | let _: Foo<{ baz::<'b>(&()) }>;
= help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:38:27
--> $DIR/const-arg-in-const-arg.rs:37:27
|
LL | let _ = Foo::<{ faz::<'a>(&()) }>;
| ^^
@ -179,7 +179,7 @@ LL | let _ = Foo::<{ faz::<'a>(&()) }>;
= help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:39:27
--> $DIR/const-arg-in-const-arg.rs:38:27
|
LL | let _ = Foo::<{ baz::<'a>(&()) }>;
| ^^
@ -188,7 +188,7 @@ LL | let _ = Foo::<{ baz::<'a>(&()) }>;
= help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:40:27
--> $DIR/const-arg-in-const-arg.rs:39:27
|
LL | let _ = Foo::<{ faz::<'b>(&()) }>;
| ^^
@ -197,7 +197,7 @@ LL | let _ = Foo::<{ faz::<'b>(&()) }>;
= help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:41:27
--> $DIR/const-arg-in-const-arg.rs:40:27
|
LL | let _ = Foo::<{ baz::<'b>(&()) }>;
| ^^

View File

@ -2,7 +2,6 @@
// FIXME(const_generics): This test currently causes an ICE because
// we don't yet correctly deal with lifetimes, reenable this test once
// this is fixed.
#![cfg_attr(min, feature(min_const_generics))]
const fn foo<T>() -> usize { std::mem::size_of::<T>() }
const fn bar<const N: usize>() -> usize { N }

View File

@ -3,7 +3,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
fn const_u32_identity<const X: u32>() -> u32 {
X

View File

@ -1,5 +1,5 @@
error[E0747]: constant provided when a type was expected
--> $DIR/const-arg-type-arg-misordered.rs:8:35
--> $DIR/const-arg-type-arg-misordered.rs:7:35
|
LL | fn foo<const N: usize>() -> Array<N, ()> {
| ^

View File

@ -1,5 +1,5 @@
error[E0747]: constant provided when a type was expected
--> $DIR/const-arg-type-arg-misordered.rs:8:35
--> $DIR/const-arg-type-arg-misordered.rs:7:35
|
LL | fn foo<const N: usize>() -> Array<N, ()> {
| ^

View File

@ -1,7 +1,6 @@
// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
type Array<T, const N: usize> = [T; N];

View File

@ -1,5 +1,5 @@
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/const-argument-if-length.rs:8:28
--> $DIR/const-argument-if-length.rs:7:28
|
LL | pub const fn is_zst<T: ?Sized>() -> usize {
| - this type parameter needs to be `Sized`
@ -12,7 +12,7 @@ LL | pub const fn size_of<T>() -> usize {
| - required by this bound in `std::mem::size_of`
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/const-argument-if-length.rs:17:12
--> $DIR/const-argument-if-length.rs:16:12
|
LL | pub struct AtLeastByte<T: ?Sized> {
| - this type parameter needs to be `Sized`

View File

@ -1,5 +1,5 @@
error: generic parameters may not be used in const operations
--> $DIR/const-argument-if-length.rs:19:24
--> $DIR/const-argument-if-length.rs:18:24
|
LL | pad: [u8; is_zst::<T>()],
| ^ cannot perform const operation using `T`
@ -8,7 +8,7 @@ LL | pad: [u8; is_zst::<T>()],
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/const-argument-if-length.rs:17:12
--> $DIR/const-argument-if-length.rs:16:12
|
LL | pub struct AtLeastByte<T: ?Sized> {
| - this type parameter needs to be `Sized`

View File

@ -2,7 +2,6 @@
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(min, feature(min_const_generics))]
pub const fn is_zst<T: ?Sized>() -> usize {
if std::mem::size_of::<T>() == 0 {

View File

@ -1,5 +1,5 @@
error: expressions must be enclosed in braces to be used as const generic arguments
--> $DIR/const-expression-parameter.rs:16:20
--> $DIR/const-expression-parameter.rs:15:20
|
LL | i32_identity::<1 + 2>();
| ^^^^^

View File

@ -1,5 +1,5 @@
error: expressions must be enclosed in braces to be used as const generic arguments
--> $DIR/const-expression-parameter.rs:16:20
--> $DIR/const-expression-parameter.rs:15:20
|
LL | i32_identity::<1 + 2>();
| ^^^^^

View File

@ -2,7 +2,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
fn i32_identity<const X: i32>() -> i32 {
5

View File

@ -4,7 +4,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
const fn const_u32_identity<const X: u32>() -> u32 {
X

View File

@ -3,7 +3,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
struct Foo<T, const N: usize>([T; N]);

View File

@ -3,7 +3,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
#[derive(Debug)]
struct S<const N: usize>;

View File

@ -3,7 +3,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
struct Foo<const A: usize, const B: usize>;

View File

@ -1,5 +1,5 @@
error: lifetime parameters must be declared prior to const parameters
--> $DIR/const-param-before-other-params.rs:6:21
--> $DIR/const-param-before-other-params.rs:5:21
|
LL | fn bar<const X: (), 'a>(_: &'a ()) {
| --------------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, const X: ()>`

View File

@ -1,17 +1,17 @@
error: lifetime parameters must be declared prior to const parameters
--> $DIR/const-param-before-other-params.rs:6:21
--> $DIR/const-param-before-other-params.rs:5:21
|
LL | fn bar<const X: (), 'a>(_: &'a ()) {
| --------------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, const X: ()>`
error: type parameters must be declared prior to const parameters
--> $DIR/const-param-before-other-params.rs:11:21
--> $DIR/const-param-before-other-params.rs:10:21
|
LL | fn foo<const X: (), T>(_: &T) {}
| --------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const X: ()>`
error: `()` is forbidden as the type of a const generic parameter
--> $DIR/const-param-before-other-params.rs:6:17
--> $DIR/const-param-before-other-params.rs:5:17
|
LL | fn bar<const X: (), 'a>(_: &'a ()) {
| ^^
@ -20,7 +20,7 @@ LL | fn bar<const X: (), 'a>(_: &'a ()) {
= help: more complex types are supported with `#[feature(const_generics)]`
error: `()` is forbidden as the type of a const generic parameter
--> $DIR/const-param-before-other-params.rs:11:17
--> $DIR/const-param-before-other-params.rs:10:17
|
LL | fn foo<const X: (), T>(_: &T) {}
| ^^

View File

@ -1,7 +1,6 @@
// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
fn bar<const X: (), 'a>(_: &'a ()) {
//~^ ERROR lifetime parameters must be declared prior to const parameters

View File

@ -1,29 +1,29 @@
error[E0637]: `&` without an explicit lifetime name cannot be used here
--> $DIR/const-param-elided-lifetime.rs:11:19
--> $DIR/const-param-elided-lifetime.rs:10:19
|
LL | struct A<const N: &u8>;
| ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used here
--> $DIR/const-param-elided-lifetime.rs:16:15
--> $DIR/const-param-elided-lifetime.rs:15:15
|
LL | impl<const N: &u8> A<N> {
| ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used here
--> $DIR/const-param-elided-lifetime.rs:19:21
--> $DIR/const-param-elided-lifetime.rs:18:21
|
LL | fn foo<const M: &u8>(&self) {}
| ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used here
--> $DIR/const-param-elided-lifetime.rs:24:15
--> $DIR/const-param-elided-lifetime.rs:23:15
|
LL | impl<const N: &u8> B for A<N> {}
| ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used here
--> $DIR/const-param-elided-lifetime.rs:28:17
--> $DIR/const-param-elided-lifetime.rs:27:17
|
LL | fn bar<const N: &u8>() {}
| ^ explicit lifetime name needed here

View File

@ -1,35 +1,35 @@
error[E0637]: `&` without an explicit lifetime name cannot be used here
--> $DIR/const-param-elided-lifetime.rs:11:19
--> $DIR/const-param-elided-lifetime.rs:10:19
|
LL | struct A<const N: &u8>;
| ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used here
--> $DIR/const-param-elided-lifetime.rs:16:15
--> $DIR/const-param-elided-lifetime.rs:15:15
|
LL | impl<const N: &u8> A<N> {
| ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used here
--> $DIR/const-param-elided-lifetime.rs:19:21
--> $DIR/const-param-elided-lifetime.rs:18:21
|
LL | fn foo<const M: &u8>(&self) {}
| ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used here
--> $DIR/const-param-elided-lifetime.rs:24:15
--> $DIR/const-param-elided-lifetime.rs:23:15
|
LL | impl<const N: &u8> B for A<N> {}
| ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used here
--> $DIR/const-param-elided-lifetime.rs:28:17
--> $DIR/const-param-elided-lifetime.rs:27:17
|
LL | fn bar<const N: &u8>() {}
| ^ explicit lifetime name needed here
error: `&'static u8` is forbidden as the type of a const generic parameter
--> $DIR/const-param-elided-lifetime.rs:11:19
--> $DIR/const-param-elided-lifetime.rs:10:19
|
LL | struct A<const N: &u8>;
| ^^^
@ -38,7 +38,7 @@ LL | struct A<const N: &u8>;
= help: more complex types are supported with `#[feature(const_generics)]`
error: `&'static u8` is forbidden as the type of a const generic parameter
--> $DIR/const-param-elided-lifetime.rs:16:15
--> $DIR/const-param-elided-lifetime.rs:15:15
|
LL | impl<const N: &u8> A<N> {
| ^^^
@ -47,7 +47,7 @@ LL | impl<const N: &u8> A<N> {
= help: more complex types are supported with `#[feature(const_generics)]`
error: `&'static u8` is forbidden as the type of a const generic parameter
--> $DIR/const-param-elided-lifetime.rs:24:15
--> $DIR/const-param-elided-lifetime.rs:23:15
|
LL | impl<const N: &u8> B for A<N> {}
| ^^^
@ -56,7 +56,7 @@ LL | impl<const N: &u8> B for A<N> {}
= help: more complex types are supported with `#[feature(const_generics)]`
error: `&'static u8` is forbidden as the type of a const generic parameter
--> $DIR/const-param-elided-lifetime.rs:28:17
--> $DIR/const-param-elided-lifetime.rs:27:17
|
LL | fn bar<const N: &u8>() {}
| ^^^
@ -65,7 +65,7 @@ LL | fn bar<const N: &u8>() {}
= help: more complex types are supported with `#[feature(const_generics)]`
error: `&'static u8` is forbidden as the type of a const generic parameter
--> $DIR/const-param-elided-lifetime.rs:19:21
--> $DIR/const-param-elided-lifetime.rs:18:21
|
LL | fn foo<const M: &u8>(&self) {}
| ^^^

View File

@ -6,7 +6,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
struct A<const N: &u8>;
//~^ ERROR `&` without an explicit lifetime name cannot be used here

View File

@ -1,5 +1,5 @@
error[E0401]: can't use generic parameters from outer function
--> $DIR/const-param-from-outer-fn.rs:9:9
--> $DIR/const-param-from-outer-fn.rs:8:9
|
LL | fn foo<const X: u32>() {
| - const parameter from outer function

View File

@ -1,5 +1,5 @@
error[E0401]: can't use generic parameters from outer function
--> $DIR/const-param-from-outer-fn.rs:9:9
--> $DIR/const-param-from-outer-fn.rs:8:9
|
LL | fn foo<const X: u32>() {
| - const parameter from outer function

View File

@ -2,7 +2,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
fn foo<const X: u32>() {
fn bar() -> u32 {

View File

@ -3,7 +3,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
macro_rules! bar {
($($t:tt)*) => { impl<const N: usize> $($t)* };

View File

@ -3,7 +3,6 @@
// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
async fn foo<const N: usize>(arg: [u8; N]) -> usize { arg.len() }

View File

@ -4,7 +4,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
trait Trait<const T: u8> {}

View File

@ -1,5 +1,3 @@
#![feature(min_const_generics)]
type N = u32;
struct Foo<const M: usize>;
fn test<const N: usize>() -> Foo<N> { //~ ERROR type provided when

View File

@ -1,5 +1,5 @@
error[E0747]: type provided when a constant was expected
--> $DIR/const-param-shadowing.rs:5:34
--> $DIR/const-param-shadowing.rs:3:34
|
LL | fn test<const N: usize>() -> Foo<N> {
| ^

View File

@ -1,11 +1,11 @@
error[E0770]: the type of const parameters must not depend on other generic parameters
--> $DIR/const-param-type-depends-on-const-param.rs:12:52
--> $DIR/const-param-type-depends-on-const-param.rs:11:52
|
LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
| ^ the type must not depend on the parameter `N`
error[E0770]: the type of const parameters must not depend on other generic parameters
--> $DIR/const-param-type-depends-on-const-param.rs:16:40
--> $DIR/const-param-type-depends-on-const-param.rs:15:40
|
LL | pub struct SelfDependent<const N: [u8; N]>;
| ^ the type must not depend on the parameter `N`

View File

@ -1,17 +1,17 @@
error[E0770]: the type of const parameters must not depend on other generic parameters
--> $DIR/const-param-type-depends-on-const-param.rs:12:52
--> $DIR/const-param-type-depends-on-const-param.rs:11:52
|
LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
| ^ the type must not depend on the parameter `N`
error[E0770]: the type of const parameters must not depend on other generic parameters
--> $DIR/const-param-type-depends-on-const-param.rs:16:40
--> $DIR/const-param-type-depends-on-const-param.rs:15:40
|
LL | pub struct SelfDependent<const N: [u8; N]>;
| ^ the type must not depend on the parameter `N`
error: `[u8; _]` is forbidden as the type of a const generic parameter
--> $DIR/const-param-type-depends-on-const-param.rs:12:47
--> $DIR/const-param-type-depends-on-const-param.rs:11:47
|
LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
| ^^^^^^^
@ -20,7 +20,7 @@ LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
= help: more complex types are supported with `#[feature(const_generics)]`
error: `[u8; _]` is forbidden as the type of a const generic parameter
--> $DIR/const-param-type-depends-on-const-param.rs:16:35
--> $DIR/const-param-type-depends-on-const-param.rs:15:35
|
LL | pub struct SelfDependent<const N: [u8; N]>;
| ^^^^^^^

View File

@ -2,7 +2,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
// Currently, const parameters cannot depend on other generic parameters,
// as our current implementation can't really support this.

View File

@ -3,7 +3,7 @@
use std::marker::PhantomData;
struct B<T, const N: T>(PhantomData<[T; N]>); //~ ERROR const generics are unstable
struct B<T, const N: T>(PhantomData<[T; N]>);
//~^ ERROR the type of const parameters must not depend on other generic parameters
fn main() {}

View File

@ -4,16 +4,6 @@ error[E0770]: the type of const parameters must not depend on other generic para
LL | struct B<T, const N: T>(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:6:19
|
LL | struct B<T, const N: T>(PhantomData<[T; N]>);
| ^
|
= note: see issue #74878 <https://github.com/rust-lang/rust/issues/74878> for more information
= help: add `#![feature(min_const_generics)]` to the crate attributes to enable
error: aborting due to previous error
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0658, E0770.
For more information about an error, try `rustc --explain E0658`.
For more information about this error, try `rustc --explain E0770`.

View File

@ -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.rs:12:34
--> $DIR/const-param-type-depends-on-type-param.rs:11:34
|
LL | pub struct Dependent<T, const X: T>([(); X]);
| ^ the type must not depend on the parameter `T`
error[E0392]: parameter `T` is never used
--> $DIR/const-param-type-depends-on-type-param.rs:12:22
--> $DIR/const-param-type-depends-on-type-param.rs:11:22
|
LL | pub struct Dependent<T, const X: T>([(); X]);
| ^ unused parameter

View File

@ -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.rs:12:34
--> $DIR/const-param-type-depends-on-type-param.rs:11:34
|
LL | pub struct Dependent<T, const X: T>([(); X]);
| ^ the type must not depend on the parameter `T`
error[E0392]: parameter `T` is never used
--> $DIR/const-param-type-depends-on-type-param.rs:12:22
--> $DIR/const-param-type-depends-on-type-param.rs:11:22
|
LL | pub struct Dependent<T, const X: T>([(); X]);
| ^ unused parameter

View File

@ -2,7 +2,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
// Currently, const parameters cannot depend on other generic parameters,
// as our current implementation can't really support this.

View File

@ -1,11 +1,11 @@
error: const parameter `x` should have an upper case name
--> $DIR/const-parameter-uppercase-lint.rs:9:15
--> $DIR/const-parameter-uppercase-lint.rs:8:15
|
LL | fn noop<const x: u32>() {
| ^ help: convert the identifier to upper case (notice the capitalization): `X`
|
note: the lint level is defined here
--> $DIR/const-parameter-uppercase-lint.rs:7:9
--> $DIR/const-parameter-uppercase-lint.rs:6:9
|
LL | #![deny(non_upper_case_globals)]
| ^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,11 +1,11 @@
error: const parameter `x` should have an upper case name
--> $DIR/const-parameter-uppercase-lint.rs:9:15
--> $DIR/const-parameter-uppercase-lint.rs:8:15
|
LL | fn noop<const x: u32>() {
| ^ help: convert the identifier to upper case (notice the capitalization): `X`
|
note: the lint level is defined here
--> $DIR/const-parameter-uppercase-lint.rs:7:9
--> $DIR/const-parameter-uppercase-lint.rs:6:9
|
LL | #![deny(non_upper_case_globals)]
| ^^^^^^^^^^^^^^^^^^^^^^

View File

@ -2,7 +2,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
#![deny(non_upper_case_globals)]

View File

@ -4,7 +4,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
#![allow(dead_code, unused_variables)]

View File

@ -1,5 +1,5 @@
error: constant expression depends on a generic parameter
--> $DIR/feature-gate-const_evaluatable_checked.rs:9:30
--> $DIR/feature-gate-const_evaluatable_checked.rs:8:30
|
LL | fn test<const N: usize>() -> Arr<N> where Arr<N>: Default {
| ^^^^^^

View File

@ -1,5 +1,5 @@
error: generic parameters may not be used in const operations
--> $DIR/feature-gate-const_evaluatable_checked.rs:6:33
--> $DIR/feature-gate-const_evaluatable_checked.rs:5:33
|
LL | type Arr<const N: usize> = [u8; N - 1];
| ^ cannot perform const operation using `N`

View File

@ -1,7 +1,6 @@
// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
type Arr<const N: usize> = [u8; N - 1];
//[min]~^ ERROR generic parameters may not be used in const operations

View File

@ -1,5 +1,5 @@
error: generic parameters may not be used in const operations
--> $DIR/simple.rs:8:53
--> $DIR/simple.rs:7:53
|
LL | fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default {
| ^ cannot perform const operation using `N`
@ -8,7 +8,7 @@ LL | fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default {
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/simple.rs:8:35
--> $DIR/simple.rs:7:35
|
LL | fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default {
| ^ cannot perform const operation using `N`

View File

@ -1,7 +1,6 @@
// [full] run-pass
// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(min, feature(min_const_generics))]
#![feature(const_evaluatable_checked)]
#![allow(incomplete_features)]

View File

@ -1,5 +1,5 @@
error[E0080]: evaluation of constant value failed
--> $DIR/simple_fail.rs:7:33
--> $DIR/simple_fail.rs:6:33
|
LL | type Arr<const N: usize> = [u8; N - 1];
| ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow

View File

@ -1,5 +1,5 @@
error: generic parameters may not be used in const operations
--> $DIR/simple_fail.rs:7:33
--> $DIR/simple_fail.rs:6:33
|
LL | type Arr<const N: usize> = [u8; N - 1];
| ^ cannot perform const operation using `N`

View File

@ -1,6 +1,5 @@
// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(min, feature(min_const_generics))]
#![feature(const_evaluatable_checked)]
#![allow(incomplete_features)]

View File

@ -4,7 +4,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
struct A<const N: u8>;
struct B<const N: u16>;

View File

@ -5,7 +5,6 @@
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
extern crate crayte;
use crayte::*;

View File

@ -1,5 +1,5 @@
error: type parameters must be declared prior to const parameters
--> $DIR/complex-unord-param.rs:9:41
--> $DIR/complex-unord-param.rs:8:41
|
LL | struct NestedArrays<'a, const N: usize, A: 'a, const M: usize, T:'a =u32> {
| ---------------------^----------------------^--------- help: reorder the parameters: lifetimes, then types, then consts: `<'a, A: 'a, T: 'a, const N: usize, const M: usize>`

View File

@ -3,7 +3,6 @@
// Checks a complicated usage of unordered params
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
#![allow(dead_code)]
struct NestedArrays<'a, const N: usize, A: 'a, const M: usize, T:'a =u32> {

View File

@ -1,11 +1,11 @@
error: lifetime parameters must be declared prior to const parameters
--> $DIR/intermixed-lifetime.rs:7:28
--> $DIR/intermixed-lifetime.rs:6:28
|
LL | struct Foo<const N: usize, 'a, T = u32>(&'a (), T);
| -----------------^^---------- help: reorder the parameters: lifetimes, then consts and types: `<'a, const N: usize, T>`
error: lifetime parameters must be declared prior to type parameters
--> $DIR/intermixed-lifetime.rs:11:37
--> $DIR/intermixed-lifetime.rs:10:37
|
LL | struct Bar<const N: usize, T = u32, 'a>(&'a (), T);
| --------------------------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, const N: usize, T>`

View File

@ -1,23 +1,23 @@
error: lifetime parameters must be declared prior to const parameters
--> $DIR/intermixed-lifetime.rs:7:28
--> $DIR/intermixed-lifetime.rs:6:28
|
LL | struct Foo<const N: usize, 'a, T = u32>(&'a (), T);
| -----------------^^---------- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T, const N: usize>`
error: type parameters must be declared prior to const parameters
--> $DIR/intermixed-lifetime.rs:7:32
--> $DIR/intermixed-lifetime.rs:6:32
|
LL | struct Foo<const N: usize, 'a, T = u32>(&'a (), T);
| ---------------------^------- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T, const N: usize>`
error: lifetime parameters must be declared prior to const parameters
--> $DIR/intermixed-lifetime.rs:11:37
--> $DIR/intermixed-lifetime.rs:10:37
|
LL | struct Bar<const N: usize, T = u32, 'a>(&'a (), T);
| --------------------------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T, const N: usize>`
error: type parameters must be declared prior to const parameters
--> $DIR/intermixed-lifetime.rs:11:28
--> $DIR/intermixed-lifetime.rs:10:28
|
LL | struct Bar<const N: usize, T = u32, 'a>(&'a (), T);
| -----------------^----------- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T, const N: usize>`

View File

@ -2,7 +2,6 @@
// Checks that lifetimes cannot be interspersed between consts and types.
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
struct Foo<const N: usize, 'a, T = u32>(&'a (), T);
//~^ Error lifetime parameters must be declared prior to const parameters

View File

@ -1,5 +1,5 @@
error: type parameters must be declared prior to const parameters
--> $DIR/needs-feature.rs:10:26
--> $DIR/needs-feature.rs:9:26
|
LL | struct A<const N: usize, T=u32>(T);
| -----------------^----- help: reorder the parameters: lifetimes, then types, then consts: `<T, const N: usize>`

Some files were not shown because too many files have changed in this diff Show More