-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test min_const_generics using revisions
- Loading branch information
Showing
24 changed files
with
154 additions
and
52 deletions.
There are no files selected for viewing
8 changes: 4 additions & 4 deletions
8
...onst-generics/defaults/wrong-order.stderr → ...generics/defaults/wrong-order.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
10 changes: 10 additions & 0 deletions
10
src/test/ui/const-generics/defaults/wrong-order.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,10 @@ | ||
error: type parameters with a default must be trailing | ||
--> $DIR/wrong-order.rs:5:10 | ||
| | ||
LL | struct A<T = u32, const N: usize> { | ||
| ^ | ||
| | ||
= note: using type defaults and const parameters in the same parameter list is currently not permitted | ||
|
||
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
6 changes: 3 additions & 3 deletions
6
.../const-generics/issues/issue-56445.stderr → ...t-generics/issues/issue-56445.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
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,20 @@ | ||
error[E0771]: use of non-static lifetime `'a` in const generic | ||
--> $DIR/issue-56445.rs:9:26 | ||
| | ||
LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>); | ||
| ^^ | ||
| | ||
= note: for more information, see issue #74052 <https://github.com/rust-lang/rust/issues/74052> | ||
|
||
error: using `&'static str` as const generic parameters is forbidden | ||
--> $DIR/issue-56445.rs:9:25 | ||
| | ||
LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>); | ||
| ^^^^^^^ | ||
| | ||
= note: the only supported types are integers, `bool` and `char` | ||
= note: more complex types are supported with `#[feature(const_generics)]` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0771`. |
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,13 @@ | ||
// Regression test for https://github.com/rust-lang/rust/issues/56445#issuecomment-518402995. | ||
|
||
#![feature(const_generics)] | ||
//~^ WARN: the feature `const_generics` is incomplete | ||
// revisions: full min | ||
#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete | ||
#![cfg_attr(min, feature(min_const_generics))] | ||
#![crate_type = "lib"] | ||
|
||
use std::marker::PhantomData; | ||
|
||
struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>); | ||
//~^ ERROR: use of non-static lifetime `'a` in const generic | ||
//[min]~| ERROR: using `&'static str` as const | ||
|
||
impl Bug<'_, ""> {} |
6 changes: 3 additions & 3 deletions
6
...onst-generics/issues/issue-61336-1.stderr → ...sue-60818-struct-constructors.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
6 changes: 3 additions & 3 deletions
6
src/test/ui/const-generics/issues/issue-60818-struct-constructors.rs
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
6 changes: 3 additions & 3 deletions
6
...es/issue-60818-struct-constructors.stderr → ...generics/issues/issue-61336-1.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
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
8 changes: 4 additions & 4 deletions
8
...onst-generics/issues/issue-61336-2.stderr → ...generics/issues/issue-61336-2.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
15 changes: 15 additions & 0 deletions
15
src/test/ui/const-generics/issues/issue-61336-2.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,15 @@ | ||
error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied | ||
--> $DIR/issue-61336-2.rs:10:5 | ||
| | ||
LL | [x; { N }] | ||
| ^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T` | ||
| | ||
= note: the `Copy` trait is required because the repeated element will be copied | ||
help: consider restricting type parameter `T` | ||
| | ||
LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] { | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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
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,24 @@ | ||
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/issue-61336.rs:2:27 | ||
| | ||
LL | #![cfg_attr(full, 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 | ||
|
||
error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied | ||
--> $DIR/issue-61336.rs:10:5 | ||
| | ||
LL | [x; N] | ||
| ^^^^^^ the trait `std::marker::Copy` is not implemented for `T` | ||
| | ||
= note: the `Copy` trait is required because the repeated element will be copied | ||
help: consider restricting type parameter `T` | ||
| | ||
LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] { | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error; 1 warning emitted | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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,15 @@ | ||
error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied | ||
--> $DIR/issue-61336.rs:10:5 | ||
| | ||
LL | [x; N] | ||
| ^^^^^^ the trait `std::marker::Copy` is not implemented for `T` | ||
| | ||
= note: the `Copy` trait is required because the repeated element will be copied | ||
help: consider restricting type parameter `T` | ||
| | ||
LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] { | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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
6 changes: 3 additions & 3 deletions
6
.../const-generics/issues/issue-61432.stderr → ...t-generics/issues/issue-61422.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
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
6 changes: 3 additions & 3 deletions
6
.../const-generics/issues/issue-61422.stderr → ...t-generics/issues/issue-61432.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
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
8 changes: 4 additions & 4 deletions
8
.../const-generics/issues/issue-61747.stderr → ...t-generics/issues/issue-61747.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
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,10 @@ | ||
error: generic parameters must not be used inside of non trivial constant values | ||
--> $DIR/issue-61747.rs:8:30 | ||
| | ||
LL | fn successor() -> Const<{C + 1}> { | ||
| ^ non-trivial anonymous constants must not depend on the parameter `C` | ||
| | ||
= help: it is currently only allowed to use either `C` or `{ C }` as generic constants | ||
|
||
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
5 changes: 3 additions & 2 deletions
5
src/test/ui/const-generics/type-dependent/const-arg-in-const-arg.rs
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