-
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.
make
const_generics_defaults
use the unstable syntax mechanism
This is important to not accidentally stabilize the parsing of the syntax while it still is experimental and not formally accepted
- Loading branch information
Showing
9 changed files
with
45 additions
and
35 deletions.
There are no files selected for viewing
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
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
2 changes: 1 addition & 1 deletion
2
src/test/ui/const-generics/min_const_generics/default_function_param.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
fn foo<const SIZE: usize = 5>() {} | ||
//~^ ERROR default values for const generic parameters are unstable | ||
//~^ ERROR default values for const generic parameters are experimental | ||
|
||
fn main() {} |
8 changes: 5 additions & 3 deletions
8
src/test/ui/const-generics/min_const_generics/default_function_param.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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
error: default values for const generic parameters are unstable | ||
--> $DIR/default_function_param.rs:1:28 | ||
error[E0658]: default values for const generic parameters are experimental | ||
--> $DIR/default_function_param.rs:1:26 | ||
| | ||
LL | fn foo<const SIZE: usize = 5>() {} | ||
| ^ | ||
| ^^^ | ||
| | ||
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information | ||
= help: add `#![feature(const_generics_defaults)]` to the crate attributes to enable | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
2 changes: 1 addition & 1 deletion
2
src/test/ui/const-generics/min_const_generics/default_trait_param.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
trait Foo<const KIND: bool = true> {} | ||
//~^ ERROR default values for const generic parameters are unstable | ||
//~^ ERROR default values for const generic parameters are experimental | ||
|
||
fn main() {} |
8 changes: 5 additions & 3 deletions
8
src/test/ui/const-generics/min_const_generics/default_trait_param.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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
error: default values for const generic parameters are unstable | ||
--> $DIR/default_trait_param.rs:1:30 | ||
error[E0658]: default values for const generic parameters are experimental | ||
--> $DIR/default_trait_param.rs:1:28 | ||
| | ||
LL | trait Foo<const KIND: bool = true> {} | ||
| ^^^^ | ||
| ^^^^^^ | ||
| | ||
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information | ||
= help: add `#![feature(const_generics_defaults)]` to the crate attributes to enable | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
8 changes: 5 additions & 3 deletions
8
src/test/ui/feature-gates/feature-gate-const_generics_defaults.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
#[cfg(FALSE)] | ||
struct A<const N: usize = 3>; | ||
//~^ ERROR default values for const generic parameters are unstable | ||
//~^ ERROR default values for const generic parameters are experimental | ||
|
||
fn foo<const N: u8 = 6>() {} | ||
//~^ ERROR default values for const generic parameters are unstable | ||
#[cfg(FALSE)] | ||
fn foo<const B: bool = false>() {} | ||
//~^ ERROR default values for const generic parameters are experimental | ||
|
||
fn main() {} |
17 changes: 10 additions & 7 deletions
17
src/test/ui/feature-gates/feature-gate-const_generics_defaults.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 |
---|---|---|
@@ -1,18 +1,21 @@ | ||
error: default values for const generic parameters are unstable | ||
--> $DIR/feature-gate-const_generics_defaults.rs:1:27 | ||
error[E0658]: default values for const generic parameters are experimental | ||
--> $DIR/feature-gate-const_generics_defaults.rs:2:25 | ||
| | ||
LL | struct A<const N: usize = 3>; | ||
| ^ | ||
| ^^^ | ||
| | ||
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information | ||
= help: add `#![feature(const_generics_defaults)]` to the crate attributes to enable | ||
|
||
error: default values for const generic parameters are unstable | ||
--> $DIR/feature-gate-const_generics_defaults.rs:4:22 | ||
error[E0658]: default values for const generic parameters are experimental | ||
--> $DIR/feature-gate-const_generics_defaults.rs:6:22 | ||
| | ||
LL | fn foo<const N: u8 = 6>() {} | ||
| ^ | ||
LL | fn foo<const B: bool = false>() {} | ||
| ^^^^^^^ | ||
| | ||
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information | ||
= help: add `#![feature(const_generics_defaults)]` to the crate attributes to enable | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |