-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add revisions to const generic default UI tests.
- Loading branch information
1 parent
2815db1
commit 36903d7
Showing
7 changed files
with
64 additions
and
13 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
src/test/ui/const-generics/defaults/complex-unord-param.min.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...erics/defaults/intermixed-lifetime.stderr → .../defaults/intermixed-lifetime.full.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/test/ui/const-generics/defaults/intermixed-lifetime.min.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
// 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() {} |
8 changes: 8 additions & 0 deletions
8
src/test/ui/const-generics/defaults/simple-defaults.min.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters