提交 36903d79 编写于 作者: H Hameer Abbasi

Add revisions to const generic default UI tests.

上级 2815db18
error: type parameters must be declared prior to const parameters
--> $DIR/complex-unord-param.rs:9: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>`
error: aborting due to previous error
// run-pass
// [full] run-pass
// revisions: full min
// Checks a complicated usage of unordered params
#![feature(const_generics)]
#![allow(incomplete_features)]
#![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> {
//[min]~^ ERROR type parameters must be declared prior to const parameters
args: &'a [&'a [T; M]; N],
specifier: A,
}
......
error: lifetime parameters must be declared prior to const parameters
--> $DIR/intermixed-lifetime.rs:6:28
--> $DIR/intermixed-lifetime.rs:7: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:9:37
--> $DIR/intermixed-lifetime.rs:11: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>`
......
error: lifetime parameters must be declared prior to const parameters
--> $DIR/intermixed-lifetime.rs:7: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
|
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
|
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
|
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: aborting due to 4 previous errors
// revisions: full min
// Checks that lifetimes cannot be interspersed between consts and types.
#![feature(const_generics)]
#![allow(incomplete_features)]
#![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
//[min]~^^ Error type parameters must be declared prior to const parameters
struct Bar<const N: usize, T = u32, 'a>(&'a (), T);
//~^ Error lifetime parameters must be declared prior to type parameters
//[full]~^ Error lifetime parameters must be declared prior to type parameters
//[min]~^^ Error type parameters must be declared prior to const parameters
//[min]~| Error lifetime parameters must be declared prior to const parameters
fn main() {}
error: type parameters must be declared prior to const parameters
--> $DIR/simple-defaults.rs:9:40
|
LL | struct FixedOutput<'a, const N: usize, T=u32> {
| ---------------------^----- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T, const N: usize>`
error: aborting due to previous error
// run-pass
// [full] run-pass
// revisions: min full
// Checks some basic test cases for defaults.
#![feature(const_generics)]
#![allow(incomplete_features)]
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
#![allow(dead_code)]
struct FixedOutput<'a, const N: usize, T=u32> {
//[min]~^ ERROR type parameters must be declared prior to const parameters
out: &'a [T; N],
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册