Port #[type_const] to the new attribute system

This commit is contained in:
Pavel Grigorenko 2025-06-24 00:51:16 +03:00
parent 6f8e92d5aa
commit 813ec60744
9 changed files with 42 additions and 21 deletions

View file

@ -116,12 +116,6 @@ error: malformed `cfi_encoding` attribute input
LL | #[cfi_encoding]
| ^^^^^^^^^^^^^^^ help: must be of the form: `#[cfi_encoding = "encoding"]`
error: malformed `type_const` attribute input
--> $DIR/malformed-attrs.rs:143:5
|
LL | #[type_const = 1]
| ^^^^^^^^^^^^^^^^^ help: must be of the form: `#[type_const]`
error: malformed `marker` attribute input
--> $DIR/malformed-attrs.rs:155:1
|
@ -555,6 +549,15 @@ LL | #[non_exhaustive = 1]
| | didn't expect any arguments here
| help: must be of the form: `#[non_exhaustive]`
error[E0565]: malformed `type_const` attribute input
--> $DIR/malformed-attrs.rs:143:5
|
LL | #[type_const = 1]
| ^^^^^^^^^^^^^---^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[type_const]`
error: attribute should be applied to `const fn`
--> $DIR/malformed-attrs.rs:34:1
|

View file

@ -1,9 +1,3 @@
error: malformed `type_const` attribute input
--> $DIR/bad-type_const-syntax.rs:2:5
|
LL | #[type_const()]
| ^^^^^^^^^^^^^^^ help: must be of the form: `#[type_const]`
error[E0658]: the `#[type_const]` attribute is an experimental feature
--> $DIR/bad-type_const-syntax.rs:2:5
|
@ -24,6 +18,15 @@ LL | #[type_const]
= help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0565]: malformed `type_const` attribute input
--> $DIR/bad-type_const-syntax.rs:2:5
|
LL | #[type_const()]
| ^^^^^^^^^^^^--^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[type_const]`
error: `#[type_const]` must only be applied to trait associated constants
--> $DIR/bad-type_const-syntax.rs:11:5
|
@ -32,4 +35,5 @@ LL | #[type_const]
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0658`.
Some errors have detailed explanations: E0565, E0658.
For more information about an error, try `rustc --explain E0565`.