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 // check-pass
// edition:2018 // edition:2018
#![feature(min_const_generics)]
trait ValidTrait {} trait ValidTrait {}
/// This has docs /// This has docs

View file

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

View file

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

View file

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

View file

@ -1,5 +1,4 @@
// ignore-tidy-linelength // ignore-tidy-linelength
#![feature(min_const_generics)]
#![crate_name = "foo"] #![crate_name = "foo"]
// @has foo/type.CellIndex.html '//pre[@class="rust typedef"]' 'type CellIndex<const D: usize> = [i64; D];' // @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: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = 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 error[E0308]: mismatched types
--> $DIR/match_arr_unknown_len.rs:6:9 --> $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>() { pub fn test<A: Foo, B: Foo>() {
let _array: [u32; <A as Foo>::Y]; 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 error: generic parameters may not be used in const operations
--> $DIR/associated-const-type-parameter-arrays.rs:16:23 --> $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]; 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 = 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
LL | pub fn test<A: Foo + Foo, B: Foo>() {
| ^^^^^
error: aborting due to previous error 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> { struct Foo<A: Adapter> {
adapter: A, adapter: A,
links: [u32; A::LINKS], // Shouldn't suggest bounds already there. 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() {} fn main() {}

View file

@ -1,11 +1,11 @@
error[E0599]: no associated item named `LINKS` found for type parameter `A` in the current scope error: generic parameters may not be used in const operations
--> $DIR/associated-item-duplicate-bounds.rs:7:21 --> $DIR/associated-item-duplicate-bounds.rs:7:18
| |
LL | links: [u32; A::LINKS], // Shouldn't suggest bounds already there. 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 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` 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 { LL | impl<const H: feature> Foo {
| ^^^^^^^ not a type | ^^^^^^^ not a type
error[E0207]: the const parameter `H` is not constrained by the impl trait, self type, or predicates 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 { LL | impl<const H: feature> Foo {
| ^ unconstrained const parameter | ^ unconstrained const parameter

View file

@ -1,11 +1,11 @@
error[E0573]: expected type, found built-in attribute `feature` 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 { LL | impl<const H: feature> Foo {
| ^^^^^^^ not a type | ^^^^^^^ not a type
error[E0207]: the const parameter `H` is not constrained by the impl trait, self type, or predicates 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 { LL | impl<const H: feature> Foo {
| ^ unconstrained const parameter | ^ unconstrained const parameter

View file

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

View file

@ -1,11 +1,11 @@
error: lifetime parameters must be declared prior to const parameters 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> { 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>` | -----------------^^-----^^-------------------- 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 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>; 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 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> { LL | struct Bad<const N: usize, T> {
| -----------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const N: usize>` | -----------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const N: usize>`
error: lifetime parameters must be declared prior to const parameters 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> { 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>` | -----------------^^-----^^-------------------- 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 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> { 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>` | ---------------------^----------------------^- 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 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>; LL | let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
| ^^^^^^^ | ^^^^^^^

View file

@ -1,7 +1,6 @@
// revisions: full min // revisions: full min
#![cfg_attr(full, feature(const_generics))] #![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))] #![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
struct Bad<const N: usize, T> { struct Bad<const N: usize, T> {
//[min]~^ ERROR type parameters must be declared prior to const parameters //[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 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]); 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 = note: this may fail depending on what value the parameter takes
error: constant expression depends on a generic parameter 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], LL | arr: [u8; CFG.arr_size],
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^

View file

@ -1,5 +1,5 @@
error: generic parameters may not be used in const operations 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]); LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
| ^ cannot perform const operation using `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 = 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 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], LL | arr: [u8; CFG.arr_size],
| ^^^ cannot perform const operation using `CFG` | ^^^ 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 = 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 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> { LL | struct B<const CFG: Config> {
| ^^^^^^ | ^^^^^^

View file

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

View file

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

View file

@ -1,5 +1,5 @@
error[E0277]: the trait bound `u16: Bar<N>` is not satisfied 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>; LL | type Assoc: Bar<N>;
| ------ required by this bound in `Foo::Assoc` | ------ required by this bound in `Foo::Assoc`

View file

@ -1,5 +1,5 @@
error[E0277]: the trait bound `u16: Bar<N>` is not satisfied 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>; LL | type Assoc: Bar<N>;
| ------ required by this bound in `Foo::Assoc` | ------ required by this bound in `Foo::Assoc`

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,7 +2,6 @@
// revisions: full min // revisions: full min
#![cfg_attr(full, feature(const_generics))] #![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))] #![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 // This test confirms that the types can be inferred correctly for this example with const
// generics. Previously this would ICE, and more recently error. // 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 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>; LL | S::<5 + 2 >> 7>;
| ^^^^^ | ^^^^^
@ -10,7 +10,7 @@ LL | S::<{ 5 + 2 } >> 7>;
| ^ ^ | ^ ^
error: comparison operators cannot be chained 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>; LL | S::<5 + 2 >> 7>;
| ^ ^ | ^ ^
@ -21,7 +21,7 @@ LL | S::<5 + 2 >> 7 && 7>;
| ^^^^ | ^^^^
error: comparison operators cannot be chained 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>; LL | S::<{ 5 + 2 } >> 7>;
| ^ ^ | ^ ^
@ -32,13 +32,13 @@ LL | S::<{ 5 + 2 } >> 7 && 7>;
| ^^^^ | ^^^^
error: expected expression, found `;` error: expected expression, found `;`
--> $DIR/closing-args-token.rs:22:16 --> $DIR/closing-args-token.rs:21:16
| |
LL | T::<0 >= 3>; LL | T::<0 >= 3>;
| ^ expected expression | ^ expected expression
error: comparison operators cannot be chained 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>; 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 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>; LL | S::<5 + 2 >> 7>;
| ^^^^^ | ^^^^^
@ -10,7 +10,7 @@ LL | S::<{ 5 + 2 } >> 7>;
| ^ ^ | ^ ^
error: comparison operators cannot be chained 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>; LL | S::<5 + 2 >> 7>;
| ^ ^ | ^ ^
@ -21,7 +21,7 @@ LL | S::<5 + 2 >> 7 && 7>;
| ^^^^ | ^^^^
error: comparison operators cannot be chained 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>; LL | S::<{ 5 + 2 } >> 7>;
| ^ ^ | ^ ^
@ -32,13 +32,13 @@ LL | S::<{ 5 + 2 } >> 7 && 7>;
| ^^^^ | ^^^^
error: expected expression, found `;` error: expected expression, found `;`
--> $DIR/closing-args-token.rs:22:16 --> $DIR/closing-args-token.rs:21:16
| |
LL | T::<0 >= 3>; LL | T::<0 >= 3>;
| ^ expected expression | ^ expected expression
error: comparison operators cannot be chained 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>; LL | T::<x >>= 2 > 0>;
| ^^ ^ | ^^ ^

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,5 @@
error: generic parameters may not be used in const operations 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>()]; LL | let _: [u8; foo::<T>()];
| ^ cannot perform const operation using `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 = 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 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>()]; LL | let _: [u8; bar::<N>()];
| ^ cannot perform const operation using `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 = 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 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>()]; LL | let _ = [0; bar::<N>()];
| ^ cannot perform const operation using `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 = 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 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>() }>; LL | let _: Foo<{ foo::<T>() }>;
| ^ cannot perform const operation using `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 = 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 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>() }>; LL | let _: Foo<{ bar::<N>() }>;
| ^ cannot perform const operation using `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 = 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 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>() }>; LL | let _ = Foo::<{ foo::<T>() }>;
| ^ cannot perform const operation using `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 = 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 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>() }>; LL | let _ = Foo::<{ bar::<N>() }>;
| ^ cannot perform const operation using `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 = 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` 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>(&())]; 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 = help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const` 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>(&())]; 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 = help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const` 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>(&())]; 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 = help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const` 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>(&())]; 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 = help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const` 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>(&())]; 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 = help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const` 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>(&())]; 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 = help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const` 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>(&())]; 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 = help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const` 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>(&())]; 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 = help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const` 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>(&()) }>; 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 = help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const` 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>(&()) }>; 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 = help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const` 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>(&()) }>; 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 = help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const` 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>(&()) }>; 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 = help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const` 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>(&()) }>; 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 = help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const` 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>(&()) }>; 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 = help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const` 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>(&()) }>; 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 = help: add `#![feature(const_generics)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const` 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>(&()) }>; LL | let _ = Foo::<{ baz::<'b>(&()) }>;
| ^^ | ^^

View file

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

View file

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

View file

@ -1,5 +1,5 @@
error[E0747]: constant provided when a type was expected 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, ()> { LL | fn foo<const N: usize>() -> Array<N, ()> {
| ^ | ^

View file

@ -1,5 +1,5 @@
error[E0747]: constant provided when a type was expected 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, ()> { LL | fn foo<const N: usize>() -> Array<N, ()> {
| ^ | ^

View file

@ -1,7 +1,6 @@
// revisions: full min // revisions: full min
#![cfg_attr(full, feature(const_generics))] #![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))] #![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
type Array<T, const N: usize> = [T; N]; 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 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 { LL | pub const fn is_zst<T: ?Sized>() -> usize {
| - this type parameter needs to be `Sized` | - 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` | - required by this bound in `std::mem::size_of`
error[E0277]: the size for values of type `T` cannot be known at compilation time 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> { LL | pub struct AtLeastByte<T: ?Sized> {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `Sized`

View file

@ -1,5 +1,5 @@
error: generic parameters may not be used in const operations 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>()], LL | pad: [u8; is_zst::<T>()],
| ^ cannot perform const operation using `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 = 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 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> { LL | pub struct AtLeastByte<T: ?Sized> {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `Sized`

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,5 @@
error: lifetime parameters must be declared prior to const parameters 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 ()) { LL | fn bar<const X: (), 'a>(_: &'a ()) {
| --------------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, const X: ()>` | --------------^^- 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 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 ()) { LL | fn bar<const X: (), 'a>(_: &'a ()) {
| --------------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, const X: ()>` | --------------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, const X: ()>`
error: type parameters must be declared prior to const parameters 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) {} LL | fn foo<const X: (), T>(_: &T) {}
| --------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const X: ()>` | --------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const X: ()>`
error: `()` is forbidden as the type of a const generic parameter 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 ()) { 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)]` = help: more complex types are supported with `#[feature(const_generics)]`
error: `()` is forbidden as the type of a const generic parameter 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) {} LL | fn foo<const X: (), T>(_: &T) {}
| ^^ | ^^

View file

@ -1,7 +1,6 @@
// revisions: full min // revisions: full min
#![cfg_attr(full, feature(const_generics))] #![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))] #![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
fn bar<const X: (), 'a>(_: &'a ()) { fn bar<const X: (), 'a>(_: &'a ()) {
//~^ ERROR lifetime parameters must be declared prior to const parameters //~^ 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 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>; LL | struct A<const N: &u8>;
| ^ explicit lifetime name needed here | ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used 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> { LL | impl<const N: &u8> A<N> {
| ^ explicit lifetime name needed here | ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used 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) {} LL | fn foo<const M: &u8>(&self) {}
| ^ explicit lifetime name needed here | ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used 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> {} LL | impl<const N: &u8> B for A<N> {}
| ^ explicit lifetime name needed here | ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used 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>() {} LL | fn bar<const N: &u8>() {}
| ^ explicit lifetime name needed here | ^ explicit lifetime name needed here

View file

@ -1,35 +1,35 @@
error[E0637]: `&` without an explicit lifetime name cannot be used here 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>; LL | struct A<const N: &u8>;
| ^ explicit lifetime name needed here | ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used 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> { LL | impl<const N: &u8> A<N> {
| ^ explicit lifetime name needed here | ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used 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) {} LL | fn foo<const M: &u8>(&self) {}
| ^ explicit lifetime name needed here | ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used 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> {} LL | impl<const N: &u8> B for A<N> {}
| ^ explicit lifetime name needed here | ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used 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>() {} LL | fn bar<const N: &u8>() {}
| ^ explicit lifetime name needed here | ^ explicit lifetime name needed here
error: `&'static u8` is forbidden as the type of a const generic parameter 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>; 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)]` = help: more complex types are supported with `#[feature(const_generics)]`
error: `&'static u8` is forbidden as the type of a const generic parameter 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> { 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)]` = help: more complex types are supported with `#[feature(const_generics)]`
error: `&'static u8` is forbidden as the type of a const generic parameter 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> {} 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)]` = help: more complex types are supported with `#[feature(const_generics)]`
error: `&'static u8` is forbidden as the type of a const generic parameter 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>() {} 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)]` = help: more complex types are supported with `#[feature(const_generics)]`
error: `&'static u8` is forbidden as the type of a const generic parameter 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) {} LL | fn foo<const M: &u8>(&self) {}
| ^^^ | ^^^

View file

@ -6,7 +6,6 @@
#![cfg_attr(full, feature(const_generics))] #![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))] #![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
struct A<const N: &u8>; struct A<const N: &u8>;
//~^ ERROR `&` without an explicit lifetime name cannot be used here //~^ 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 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>() { LL | fn foo<const X: u32>() {
| - const parameter from outer function | - const parameter from outer function

View file

@ -1,5 +1,5 @@
error[E0401]: can't use generic parameters from outer function 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>() { LL | fn foo<const X: u32>() {
| - const parameter from outer function | - const parameter from outer function

View file

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

View file

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

View file

@ -3,7 +3,6 @@
// revisions: full min // revisions: full min
#![cfg_attr(full, feature(const_generics))] #![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))] #![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() } 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, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))] #![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
trait Trait<const T: u8> {} trait Trait<const T: u8> {}

View file

@ -1,5 +1,3 @@
#![feature(min_const_generics)]
type N = u32; type N = u32;
struct Foo<const M: usize>; struct Foo<const M: usize>;
fn test<const N: usize>() -> Foo<N> { //~ ERROR type provided when 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 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> { 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 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]); LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
| ^ the type must not depend on the parameter `N` | ^ the type must not depend on the parameter `N`
error[E0770]: the type of const parameters must not depend on other generic parameters 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]>; LL | pub struct SelfDependent<const N: [u8; N]>;
| ^ the type must not depend on the parameter `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 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]); LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
| ^ the type must not depend on the parameter `N` | ^ the type must not depend on the parameter `N`
error[E0770]: the type of const parameters must not depend on other generic parameters 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]>; LL | pub struct SelfDependent<const N: [u8; N]>;
| ^ the type must not depend on the parameter `N` | ^ the type must not depend on the parameter `N`
error: `[u8; _]` is forbidden as the type of a const generic parameter 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]); 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)]` = help: more complex types are supported with `#[feature(const_generics)]`
error: `[u8; _]` is forbidden as the type of a const generic parameter 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]>; LL | pub struct SelfDependent<const N: [u8; N]>;
| ^^^^^^^ | ^^^^^^^

View file

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

View file

@ -3,7 +3,7 @@
use std::marker::PhantomData; 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 //~^ ERROR the type of const parameters must not depend on other generic parameters
fn main() {} 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]>); LL | struct B<T, const N: T>(PhantomData<[T; N]>);
| ^ the type must not depend on the parameter `T` | ^ the type must not depend on the parameter `T`
error[E0658]: const generics are unstable error: aborting due to previous error
--> $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 2 previous errors For more information about this error, try `rustc --explain E0770`.
Some errors have detailed explanations: E0658, E0770.
For more information about an error, try `rustc --explain E0658`.

View file

@ -1,11 +1,11 @@
error[E0770]: the type of const parameters must not depend on other generic parameters 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]); LL | pub struct Dependent<T, const X: T>([(); X]);
| ^ the type must not depend on the parameter `T` | ^ the type must not depend on the parameter `T`
error[E0392]: parameter `T` is never used 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]); LL | pub struct Dependent<T, const X: T>([(); X]);
| ^ unused parameter | ^ unused parameter

View file

@ -1,11 +1,11 @@
error[E0770]: the type of const parameters must not depend on other generic parameters 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]); LL | pub struct Dependent<T, const X: T>([(); X]);
| ^ the type must not depend on the parameter `T` | ^ the type must not depend on the parameter `T`
error[E0392]: parameter `T` is never used 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]); LL | pub struct Dependent<T, const X: T>([(); X]);
| ^ unused parameter | ^ unused parameter

View file

@ -2,7 +2,6 @@
#![cfg_attr(full, feature(const_generics))] #![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))] #![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
// Currently, const parameters cannot depend on other generic parameters, // Currently, const parameters cannot depend on other generic parameters,
// as our current implementation can't really support this. // 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 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>() { LL | fn noop<const x: u32>() {
| ^ help: convert the identifier to upper case (notice the capitalization): `X` | ^ help: convert the identifier to upper case (notice the capitalization): `X`
| |
note: the lint level is defined here 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)] LL | #![deny(non_upper_case_globals)]
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^

View file

@ -1,11 +1,11 @@
error: const parameter `x` should have an upper case name 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>() { LL | fn noop<const x: u32>() {
| ^ help: convert the identifier to upper case (notice the capitalization): `X` | ^ help: convert the identifier to upper case (notice the capitalization): `X`
| |
note: the lint level is defined here 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)] LL | #![deny(non_upper_case_globals)]
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^

View file

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

View file

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

View file

@ -1,5 +1,5 @@
error: constant expression depends on a generic parameter 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 { 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 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]; LL | type Arr<const N: usize> = [u8; N - 1];
| ^ cannot perform const operation using `N` | ^ cannot perform const operation using `N`

View file

@ -1,7 +1,6 @@
// revisions: full min // revisions: full min
#![cfg_attr(full, feature(const_generics))] #![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))] #![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
type Arr<const N: usize> = [u8; N - 1]; type Arr<const N: usize> = [u8; N - 1];
//[min]~^ ERROR generic parameters may not be used in const operations //[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 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 { LL | fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default {
| ^ cannot perform const operation using `N` | ^ 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 = 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 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 { LL | fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default {
| ^ cannot perform const operation using `N` | ^ cannot perform const operation using `N`

View file

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

View file

@ -1,5 +1,5 @@
error[E0080]: evaluation of constant value failed 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]; LL | type Arr<const N: usize> = [u8; N - 1];
| ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow | ^^^^^ 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 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]; LL | type Arr<const N: usize> = [u8; N - 1];
| ^ cannot perform const operation using `N` | ^ cannot perform const operation using `N`

View file

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

View file

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

View file

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

View file

@ -1,5 +1,5 @@
error: type parameters must be declared prior to const parameters 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> { 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>` | ---------------------^----------------------^--------- 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 // Checks a complicated usage of unordered params
#![cfg_attr(full, feature(const_generics))] #![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))] #![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
#![allow(dead_code)] #![allow(dead_code)]
struct NestedArrays<'a, const N: usize, A: 'a, const M: usize, T:'a =u32> { 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 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); 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>` | -----------------^^---------- help: reorder the parameters: lifetimes, then consts and types: `<'a, const N: usize, T>`
error: lifetime parameters must be declared prior to type parameters 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); 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>` | --------------------------^^- 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 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); 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>` | -----------------^^---------- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T, const N: usize>`
error: type parameters must be declared prior to const parameters 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); 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>` | ---------------------^------- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T, const N: usize>`
error: lifetime parameters must be declared prior to const parameters 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); 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>` | --------------------------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T, const N: usize>`
error: type parameters must be declared prior to const parameters 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); 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>` | -----------------^----------- 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. // Checks that lifetimes cannot be interspersed between consts and types.
#![cfg_attr(full, feature(const_generics))] #![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))] #![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
struct Foo<const N: usize, 'a, T = u32>(&'a (), T); struct Foo<const N: usize, 'a, T = u32>(&'a (), T);
//~^ Error lifetime parameters must be declared prior to const parameters //~^ 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 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); LL | struct A<const N: usize, T=u32>(T);
| -----------------^----- help: reorder the parameters: lifetimes, then types, then consts: `<T, const N: usize>` | -----------------^----- 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