rust/tests/ui/attributes/malformed-attrs.stderr
Keith-Cancel 73a991fb9d Allow provisional mgca syntax of type const <IDENT> = <EXPR> to be reconized.
Revert, but without type const.

Update symbol for feature err, then update suggestion output, and lastly update tests that change because of those.

Update these new tests with the correct syntax, and few existing tests with the new outputs the merge with main added.

Fix for tidyfmt and some errors when manually resolving a merge conflicts.

Update these tests to use update error messages and type const syntax.

Update comments and error message to use new syntax instead of old type_const attribute.

Remove the type_const attribute

update some more tests to use the new syntax.

Update these test cases.

update feature gate test

Change gate logic for `mgca_type_const_syntax` to work also if `min_generic_const_args` is enabled.

Create a new feature gate that checks for the feature before expansion.

Make rustfmt handle the `type const` syntax correctly.

Add a convience method to check if a RhsKind is type const.

Rename `Const` discriminant to `Body` for `ConstItemRhsKind`

Give the `TraitItemKind` flag an enum instead of a simple bool to better describe what the flag is for.

Update formatting for these match statements.

Update clippy test to use type const syntax.

Update test to use type const syntax.

update rustfmt to match ast items.

Update clippy to match ast and hir items.

Few more test cases that used old attribute, instead of 'type const'

Update to match the output from the feature gate checks.

tidyfmt adjustments.

Update the is_type_const, so I can constrain record!(..) in encoder.rs

Update conditional compilation test.

Move the feature gate to after expansion to allow for cfg(...) to work.

Update some more tests to use the new syntax.

Update type const tests in associated-const-bindings to use new syntax.

Don't check based off the attribute, but the item here.

Update some tests outside of the const_generics folder that were using #[type_const]

update the tests in associated consts that use #[type_const] to use type const

Update these mgca tests with the type const syntax.

Add a flag to TraitItemKind for detecting type const for now. Maybe later change ItemConstRhs to have optional consts but that touches a lot more lines of code.

Don't need into for these now that it's a query.

Add is_type_const query to handle foreign def ids.

update this test to use type const syntax.

Fix logic here, we only want to lower if there is expression in this case.

Update built-in macros to use ConstItemRhsKind

Update more instance of the old ConstItemRhs.

Rename ConstItemKind to ConstItemRhsKind, I noticed there is a typed called ConstantItemKind, so add the Rhs to the name to avoid confusion.

Update lower to use ConstItemKind

Add an other helper method to check if the rhs kinda has an expr.

Update item parse to use ConstItemKind enum.

Felt the field name could a be little clear when editing a few other things.

Change the ConstItem struct see know if we have a type const or regular const.

Make sure this syntax is properly feature gated.
2026-02-09 07:59:24 -08:00

884 lines
29 KiB
Text

error[E0539]: malformed `cfg` attribute input
--> $DIR/malformed-attrs.rs:107:1
|
LL | #[cfg]
| ^^^^^^
| |
| expected this to be a list
| help: must be of the form: `#[cfg(predicate)]`
|
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
error[E0539]: malformed `cfg_attr` attribute input
--> $DIR/malformed-attrs.rs:109:1
|
LL | #[cfg_attr]
| ^^^^^^^^^^^
| |
| expected this to be a list
| help: must be of the form: `#[cfg_attr(predicate, attr1, attr2, ...)]`
|
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>
error[E0463]: can't find crate for `wloop`
--> $DIR/malformed-attrs.rs:215:1
|
LL | extern crate wloop;
| ^^^^^^^^^^^^^^^^^^^ can't find crate
error: malformed `allow` attribute input
--> $DIR/malformed-attrs.rs:181:1
|
LL | #[allow]
| ^^^^^^^^
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: the following are the possible correct uses
|
LL | #[allow(lint1)]
| +++++++
LL | #[allow(lint1, lint2, ...)]
| +++++++++++++++++++
LL | #[allow(lint1, lint2, lint3, reason = "...")]
| +++++++++++++++++++++++++++++++++++++
error: malformed `expect` attribute input
--> $DIR/malformed-attrs.rs:183:1
|
LL | #[expect]
| ^^^^^^^^^
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: the following are the possible correct uses
|
LL | #[expect(lint1)]
| +++++++
LL | #[expect(lint1, lint2, ...)]
| +++++++++++++++++++
LL | #[expect(lint1, lint2, lint3, reason = "...")]
| +++++++++++++++++++++++++++++++++++++
error: malformed `warn` attribute input
--> $DIR/malformed-attrs.rs:185:1
|
LL | #[warn]
| ^^^^^^^
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: the following are the possible correct uses
|
LL | #[warn(lint1)]
| +++++++
LL | #[warn(lint1, lint2, ...)]
| +++++++++++++++++++
LL | #[warn(lint1, lint2, lint3, reason = "...")]
| +++++++++++++++++++++++++++++++++++++
error: malformed `deny` attribute input
--> $DIR/malformed-attrs.rs:187:1
|
LL | #[deny]
| ^^^^^^^
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: the following are the possible correct uses
|
LL | #[deny(lint1)]
| +++++++
LL | #[deny(lint1, lint2, ...)]
| +++++++++++++++++++
LL | #[deny(lint1, lint2, lint3, reason = "...")]
| +++++++++++++++++++++++++++++++++++++
error: malformed `forbid` attribute input
--> $DIR/malformed-attrs.rs:189:1
|
LL | #[forbid]
| ^^^^^^^^^
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: the following are the possible correct uses
|
LL | #[forbid(lint1)]
| +++++++
LL | #[forbid(lint1, lint2, ...)]
| +++++++++++++++++++
LL | #[forbid(lint1, lint2, lint3, reason = "...")]
| +++++++++++++++++++++++++++++++++++++
error: the `#[proc_macro]` attribute is only usable with crates of the `proc-macro` crate type
--> $DIR/malformed-attrs.rs:104:1
|
LL | #[proc_macro = 18]
| ^^^^^^^^^^^^^^^^^^
error: the `#[proc_macro_attribute]` attribute is only usable with crates of the `proc-macro` crate type
--> $DIR/malformed-attrs.rs:121:1
|
LL | #[proc_macro_attribute = 19]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type
--> $DIR/malformed-attrs.rs:128:1
|
LL | #[proc_macro_derive]
| ^^^^^^^^^^^^^^^^^^^^
error[E0658]: allow_internal_unsafe side-steps the unsafe_code lint
--> $DIR/malformed-attrs.rs:220:1
|
LL | #[allow_internal_unsafe = 1]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(allow_internal_unsafe)]` 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[E0539]: malformed `windows_subsystem` attribute input
--> $DIR/malformed-attrs.rs:27:1
|
LL | #![windows_subsystem]
| ^^^-----------------^
| |
| expected this to be of the form `windows_subsystem = "..."`
|
= note: for more information, visit <https://doc.rust-lang.org/reference/runtime.html#the-windows_subsystem-attribute>
help: try changing it to one of the following valid forms of the attribute
|
LL | #![windows_subsystem = "console"]
| +++++++++++
LL | #![windows_subsystem = "windows"]
| +++++++++++
error[E0539]: malformed `export_name` attribute input
--> $DIR/malformed-attrs.rs:30:1
|
LL | #[unsafe(export_name)]
| ^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[export_name = "name"]`
error: `rustc_allow_const_fn_unstable` expects a list of feature names
--> $DIR/malformed-attrs.rs:32:1
|
LL | #[rustc_allow_const_fn_unstable]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `allow_internal_unstable` expects a list of feature names
--> $DIR/malformed-attrs.rs:35:1
|
LL | #[allow_internal_unstable]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0539]: malformed `rustc_confusables` attribute input
--> $DIR/malformed-attrs.rs:37:1
|
LL | #[rustc_confusables]
| ^^^^^^^^^^^^^^^^^^^^
| |
| expected this to be a list
| help: must be of the form: `#[rustc_confusables("name1", "name2", ...)]`
error: `#[rustc_confusables]` attribute cannot be used on functions
--> $DIR/malformed-attrs.rs:37:1
|
LL | #[rustc_confusables]
| ^^^^^^^^^^^^^^^^^^^^
|
= help: `#[rustc_confusables]` can only be applied to inherent methods
error[E0539]: malformed `deprecated` attribute input
--> $DIR/malformed-attrs.rs:40:1
|
LL | #[deprecated = 5]
| ^^^^^^^^^^^^^^^-^
| |
| expected a string literal here
error[E0539]: malformed `rustc_macro_transparency` attribute input
--> $DIR/malformed-attrs.rs:44:1
|
LL | #[rustc_macro_transparency]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try changing it to one of the following valid forms of the attribute
|
LL | #[rustc_macro_transparency = "opaque"]
| ++++++++++
LL | #[rustc_macro_transparency = "semiopaque"]
| ++++++++++++++
LL | #[rustc_macro_transparency = "transparent"]
| +++++++++++++++
error: `#[rustc_macro_transparency]` attribute cannot be used on functions
--> $DIR/malformed-attrs.rs:44:1
|
LL | #[rustc_macro_transparency]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `#[rustc_macro_transparency]` can only be applied to macro defs
error[E0539]: malformed `repr` attribute input
--> $DIR/malformed-attrs.rs:47:1
|
LL | #[repr]
| ^^^^^^^ expected this to be a list
|
= note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations>
error[E0565]: malformed `rustc_as_ptr` attribute input
--> $DIR/malformed-attrs.rs:50:1
|
LL | #[rustc_as_ptr = 5]
| ^^^^^^^^^^^^^^^---^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[rustc_as_ptr]`
error[E0539]: malformed `rustc_align` attribute input
--> $DIR/malformed-attrs.rs:55:1
|
LL | #[rustc_align]
| ^^^^^^^^^^^^^^
| |
| expected this to be a list
| help: must be of the form: `#[rustc_align(<alignment in bytes>)]`
error[E0539]: malformed `optimize` attribute input
--> $DIR/malformed-attrs.rs:57:1
|
LL | #[optimize]
| ^^^^^^^^^^^ expected this to be a list
|
help: try changing it to one of the following valid forms of the attribute
|
LL | #[optimize(none)]
| ++++++
LL | #[optimize(size)]
| ++++++
LL | #[optimize(speed)]
| +++++++
error[E0565]: malformed `cold` attribute input
--> $DIR/malformed-attrs.rs:59:1
|
LL | #[cold = 1]
| ^^^^^^^---^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[cold]`
error[E0539]: malformed `must_use` attribute input
--> $DIR/malformed-attrs.rs:61:1
|
LL | #[must_use()]
| ^^^^^^^^^^--^
| |
| didn't expect a list here
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute>
help: try changing it to one of the following valid forms of the attribute
|
LL - #[must_use()]
LL + #[must_use = "reason"]
|
LL - #[must_use()]
LL + #[must_use]
|
error[E0565]: malformed `no_mangle` attribute input
--> $DIR/malformed-attrs.rs:63:1
|
LL | #[no_mangle = 1]
| ^^^^^^^^^^^^---^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[no_mangle]`
error[E0565]: malformed `naked` attribute input
--> $DIR/malformed-attrs.rs:65:1
|
LL | #[unsafe(naked())]
| ^^^^^^^^^^^^^^--^^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[naked]`
error[E0565]: malformed `track_caller` attribute input
--> $DIR/malformed-attrs.rs:67:1
|
LL | #[track_caller()]
| ^^^^^^^^^^^^^^--^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[track_caller]`
error[E0539]: malformed `export_name` attribute input
--> $DIR/malformed-attrs.rs:69:1
|
LL | #[export_name()]
| ^^^^^^^^^^^^^^^^ help: must be of the form: `#[export_name = "name"]`
error[E0805]: malformed `used` attribute input
--> $DIR/malformed-attrs.rs:71:1
|
LL | #[used()]
| ^^^^^^--^
| |
| expected a single argument here
|
help: try changing it to one of the following valid forms of the attribute
|
LL | #[used(compiler)]
| ++++++++
LL | #[used(linker)]
| ++++++
LL - #[used()]
LL + #[used]
|
error: `#[used]` attribute cannot be used on functions
--> $DIR/malformed-attrs.rs:71:1
|
LL | #[used()]
| ^^^^^^^^^
|
= help: `#[used]` can only be applied to statics
error[E0539]: malformed `crate_name` attribute input
--> $DIR/malformed-attrs.rs:74:1
|
LL | #[crate_name]
| ^^^^^^^^^^^^^ help: must be of the form: `#[crate_name = "name"]`
error[E0539]: malformed `target_feature` attribute input
--> $DIR/malformed-attrs.rs:79:1
|
LL | #[target_feature]
| ^^^^^^^^^^^^^^^^^
| |
| expected this to be a list
| help: must be of the form: `#[target_feature(enable = "feat1, feat2")]`
error[E0565]: malformed `export_stable` attribute input
--> $DIR/malformed-attrs.rs:81:1
|
LL | #[export_stable = 1]
| ^^^^^^^^^^^^^^^^---^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[export_stable]`
error[E0539]: malformed `link` attribute input
--> $DIR/malformed-attrs.rs:83:1
|
LL | #[link]
| ^^^^^^^ expected this to be a list
|
= note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link-attribute>
error[E0539]: malformed `link_name` attribute input
--> $DIR/malformed-attrs.rs:87:1
|
LL | #[link_name]
| ^^^^^^^^^^^^ help: must be of the form: `#[link_name = "name"]`
|
= note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_name-attribute>
error[E0539]: malformed `link_section` attribute input
--> $DIR/malformed-attrs.rs:91:1
|
LL | #[link_section]
| ^^^^^^^^^^^^^^^ help: must be of the form: `#[link_section = "name"]`
|
= note: for more information, visit <https://doc.rust-lang.org/reference/abi.html#the-link_section-attribute>
error[E0539]: malformed `coverage` attribute input
--> $DIR/malformed-attrs.rs:93:1
|
LL | #[coverage]
| ^^^^^^^^^^^ this attribute is only valid with either `on` or `off` as an argument
|
help: try changing it to one of the following valid forms of the attribute
|
LL | #[coverage(off)]
| +++++
LL | #[coverage(on)]
| ++++
error[E0539]: malformed `sanitize` attribute input
--> $DIR/malformed-attrs.rs:95:1
|
LL | #[sanitize]
| ^^^^^^^^^^^ expected this to be a list
error[E0565]: malformed `no_implicit_prelude` attribute input
--> $DIR/malformed-attrs.rs:100:1
|
LL | #[no_implicit_prelude = 23]
| ^^^^^^^^^^^^^^^^^^^^^^----^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[no_implicit_prelude]`
error[E0565]: malformed `proc_macro` attribute input
--> $DIR/malformed-attrs.rs:104:1
|
LL | #[proc_macro = 18]
| ^^^^^^^^^^^^^----^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[proc_macro]`
error[E0539]: malformed `instruction_set` attribute input
--> $DIR/malformed-attrs.rs:111:1
|
LL | #[instruction_set]
| ^^^^^^^^^^^^^^^^^^
| |
| valid arguments are `arm::a32` or `arm::t32`
| help: must be of the form: `#[instruction_set(set)]`
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/codegen.html#the-instruction_set-attribute>
error[E0539]: malformed `patchable_function_entry` attribute input
--> $DIR/malformed-attrs.rs:113:1
|
LL | #[patchable_function_entry]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected this to be a list
| help: must be of the form: `#[patchable_function_entry(prefix_nops = m, entry_nops = n)]`
error[E0565]: malformed `coroutine` attribute input
--> $DIR/malformed-attrs.rs:116:5
|
LL | #[coroutine = 63] || {}
| ^^^^^^^^^^^^----^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[coroutine]`
error[E0565]: malformed `proc_macro_attribute` attribute input
--> $DIR/malformed-attrs.rs:121:1
|
LL | #[proc_macro_attribute = 19]
| ^^^^^^^^^^^^^^^^^^^^^^^----^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[proc_macro_attribute]`
error[E0539]: malformed `must_use` attribute input
--> $DIR/malformed-attrs.rs:124:1
|
LL | #[must_use = 1]
| ^^^^^^^^^^^^^-^
| |
| expected a string literal here
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute>
help: try changing it to one of the following valid forms of the attribute
|
LL - #[must_use = 1]
LL + #[must_use = "reason"]
|
LL - #[must_use = 1]
LL + #[must_use]
|
error[E0539]: malformed `proc_macro_derive` attribute input
--> $DIR/malformed-attrs.rs:128:1
|
LL | #[proc_macro_derive]
| ^^^^^^^^^^^^^^^^^^^^ expected this to be a list
|
= note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros>
help: try changing it to one of the following valid forms of the attribute
|
LL | #[proc_macro_derive(TraitName)]
| +++++++++++
LL | #[proc_macro_derive(TraitName, attributes(name1, name2, ...))]
| ++++++++++++++++++++++++++++++++++++++++++
error[E0539]: malformed `rustc_layout_scalar_valid_range_start` attribute input
--> $DIR/malformed-attrs.rs:133:1
|
LL | #[rustc_layout_scalar_valid_range_start]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected this to be a list
| help: must be of the form: `#[rustc_layout_scalar_valid_range_start(start)]`
error[E0539]: malformed `rustc_layout_scalar_valid_range_end` attribute input
--> $DIR/malformed-attrs.rs:135:1
|
LL | #[rustc_layout_scalar_valid_range_end]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected this to be a list
| help: must be of the form: `#[rustc_layout_scalar_valid_range_end(end)]`
error[E0539]: malformed `must_not_suspend` attribute input
--> $DIR/malformed-attrs.rs:137:1
|
LL | #[must_not_suspend()]
| ^^^^^^^^^^^^^^^^^^--^
| |
| didn't expect a list here
|
help: try changing it to one of the following valid forms of the attribute
|
LL | #[must_not_suspend(count)]
| +++++
LL - #[must_not_suspend()]
LL + #[must_not_suspend]
|
error[E0539]: malformed `cfi_encoding` attribute input
--> $DIR/malformed-attrs.rs:139:1
|
LL | #[cfi_encoding = ""]
| ^^^^^^^^^^^^^^^^^--^
| | |
| | string is not allowed to be empty
| help: must be of the form: `#[cfi_encoding = "encoding"]`
error[E0565]: malformed `marker` attribute input
--> $DIR/malformed-attrs.rs:158:1
|
LL | #[marker = 3]
| ^^^^^^^^^---^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[marker]`
error[E0565]: malformed `fundamental` attribute input
--> $DIR/malformed-attrs.rs:160:1
|
LL | #[fundamental()]
| ^^^^^^^^^^^^^--^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[fundamental]`
error[E0565]: malformed `ffi_pure` attribute input
--> $DIR/malformed-attrs.rs:168:5
|
LL | #[unsafe(ffi_pure = 1)]
| ^^^^^^^^^^^^^^^^^^---^^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[ffi_pure]`
error[E0539]: malformed `link_ordinal` attribute input
--> $DIR/malformed-attrs.rs:170:5
|
LL | #[link_ordinal]
| ^^^^^^^^^^^^^^^
| |
| expected this to be a list
| help: must be of the form: `#[link_ordinal(ordinal)]`
|
= note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_ordinal-attribute>
error[E0565]: malformed `ffi_const` attribute input
--> $DIR/malformed-attrs.rs:174:5
|
LL | #[unsafe(ffi_const = 1)]
| ^^^^^^^^^^^^^^^^^^^---^^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[ffi_const]`
error[E0539]: malformed `linkage` attribute input
--> $DIR/malformed-attrs.rs:176:5
|
LL | #[linkage]
| ^^^^^^^^^^ expected this to be of the form `linkage = "..."`
error[E0539]: malformed `debugger_visualizer` attribute input
--> $DIR/malformed-attrs.rs:191:1
|
LL | #[debugger_visualizer]
| ^^^^^^^^^^^^^^^^^^^^^^
| |
| expected this to be a list
| help: must be of the form: `#[debugger_visualizer(natvis_file = "...", gdb_script_file = "...")]`
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/debugger.html#the-debugger_visualizer-attribute>
error[E0565]: malformed `automatically_derived` attribute input
--> $DIR/malformed-attrs.rs:193:1
|
LL | #[automatically_derived = 18]
| ^^^^^^^^^^^^^^^^^^^^^^^^----^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[automatically_derived]`
error[E0565]: malformed `non_exhaustive` attribute input
--> $DIR/malformed-attrs.rs:201:1
|
LL | #[non_exhaustive = 1]
| ^^^^^^^^^^^^^^^^^---^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[non_exhaustive]`
error[E0565]: malformed `thread_local` attribute input
--> $DIR/malformed-attrs.rs:207:1
|
LL | #[thread_local()]
| ^^^^^^^^^^^^^^--^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[thread_local]`
error[E0565]: malformed `no_link` attribute input
--> $DIR/malformed-attrs.rs:211:1
|
LL | #[no_link()]
| ^^^^^^^^^--^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[no_link]`
error[E0539]: malformed `macro_use` attribute input
--> $DIR/malformed-attrs.rs:213:1
|
LL | #[macro_use = 1]
| ^^^^^^^^^^^^---^
| |
| expected a list or no arguments here
|
= note: for more information, visit <https://doc.rust-lang.org/reference/macros-by-example.html#the-macro_use-attribute>
help: try changing it to one of the following valid forms of the attribute
|
LL - #[macro_use = 1]
LL + #[macro_use(name1, name2, ...)]
|
LL - #[macro_use = 1]
LL + #[macro_use]
|
error[E0539]: malformed `macro_export` attribute input
--> $DIR/malformed-attrs.rs:218:1
|
LL | #[macro_export = 18]
| ^^^^^^^^^^^^^^^----^
| |
| expected a list or no arguments here
|
help: try changing it to one of the following valid forms of the attribute
|
LL - #[macro_export = 18]
LL + #[macro_export(local_inner_macros)]
|
LL - #[macro_export = 18]
LL + #[macro_export]
|
error[E0565]: malformed `allow_internal_unsafe` attribute input
--> $DIR/malformed-attrs.rs:220:1
|
LL | #[allow_internal_unsafe = 1]
| ^^^^^^^^^^^^^^^^^^^^^^^^---^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[allow_internal_unsafe]`
error: attribute should be applied to `const fn`
--> $DIR/malformed-attrs.rs:32:1
|
LL | #[rustc_allow_const_fn_unstable]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
LL | / fn test() {
LL | | #[coroutine = 63] || {}
... |
LL | | }
| |_- not a `const fn`
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/malformed-attrs.rs:83:1
|
LL | #[link]
| ^^^^^^^
...
LL | / fn test() {
LL | | #[coroutine = 63] || {}
... |
LL | | }
| |_- not an `extern` block
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: requested on the command line with `-W unused-attributes`
error: `#[repr(align(...))]` is not supported on functions
--> $DIR/malformed-attrs.rs:47:1
|
LL | #[repr]
| ^^^^^^^
|
help: use `#[rustc_align(...)]` instead
--> $DIR/malformed-attrs.rs:47:1
|
LL | #[repr]
| ^^^^^^^
warning: missing options for `on_unimplemented` attribute
--> $DIR/malformed-attrs.rs:143:1
|
LL | #[diagnostic::on_unimplemented]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: at least one of the `message`, `note` and `label` options are expected
= note: `#[warn(malformed_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default
warning: malformed `on_unimplemented` attribute
--> $DIR/malformed-attrs.rs:145:1
|
LL | #[diagnostic::on_unimplemented = 1]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid option found here
|
= help: only `message`, `note` and `label` are allowed as options
error: valid forms for the attribute are `#[doc = "string"]`, `#[doc(alias)]`, `#[doc(attribute)]`, `#[doc(auto_cfg)]`, `#[doc(cfg)]`, `#[doc(fake_variadic)]`, `#[doc(hidden)]`, `#[doc(html_favicon_url)]`, `#[doc(html_logo_url)]`, `#[doc(html_no_source)]`, `#[doc(html_playground_url)]`, `#[doc(html_root_url)]`, `#[doc(include)]`, `#[doc(inline)]`, `#[doc(issue_tracker_base_url)]`, `#[doc(keyword)]`, `#[doc(masked)]`, `#[doc(no_default_passes)]`, `#[doc(no_inline)]`, `#[doc(notable_trait)]`, `#[doc(passes)]`, `#[doc(plugins)]`, `#[doc(rust_logo)]`, `#[doc(search_unbox)]`, `#[doc(spotlight)]`, and `#[doc(test)]`
--> $DIR/malformed-attrs.rs:42:1
|
LL | #[doc]
| ^^^^^^
|
note: the lint level is defined here
--> $DIR/malformed-attrs.rs:3:9
|
LL | #![deny(invalid_doc_attributes)]
| ^^^^^^^^^^^^^^^^^^^^^^
error: valid forms for the attribute are `#[inline(always)]`, `#[inline(never)]`, and `#[inline]`
--> $DIR/malformed-attrs.rs:52:1
|
LL | #[inline = 5]
| ^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
= note: `#[deny(ill_formed_attribute_input)]` (part of `#[deny(future_incompatible)]`) on by default
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]`
--> $DIR/malformed-attrs.rs:74:1
|
LL | #[crate_name]
| ^^^^^^^^^^^^^
|
note: this attribute does not have an `!`, which means it is applied to this function
--> $DIR/malformed-attrs.rs:115:1
|
LL | / fn test() {
LL | | #[coroutine = 63] || {}
... |
LL | | }
| |_^
error: valid forms for the attribute are `#[doc = "string"]`, `#[doc(alias)]`, `#[doc(attribute)]`, `#[doc(auto_cfg)]`, `#[doc(cfg)]`, `#[doc(fake_variadic)]`, `#[doc(hidden)]`, `#[doc(html_favicon_url)]`, `#[doc(html_logo_url)]`, `#[doc(html_no_source)]`, `#[doc(html_playground_url)]`, `#[doc(html_root_url)]`, `#[doc(include)]`, `#[doc(inline)]`, `#[doc(issue_tracker_base_url)]`, `#[doc(keyword)]`, `#[doc(masked)]`, `#[doc(no_default_passes)]`, `#[doc(no_inline)]`, `#[doc(notable_trait)]`, `#[doc(passes)]`, `#[doc(plugins)]`, `#[doc(rust_logo)]`, `#[doc(search_unbox)]`, `#[doc(spotlight)]`, and `#[doc(test)]`
--> $DIR/malformed-attrs.rs:77:1
|
LL | #[doc]
| ^^^^^^
warning: `#[link_name]` attribute cannot be used on functions
--> $DIR/malformed-attrs.rs:87:1
|
LL | #[link_name]
| ^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[link_name]` can be applied to foreign functions and foreign statics
error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]`
--> $DIR/malformed-attrs.rs:97:1
|
LL | #[ignore()]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
warning: `#[no_implicit_prelude]` attribute cannot be used on functions
--> $DIR/malformed-attrs.rs:100:1
|
LL | #[no_implicit_prelude = 23]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[no_implicit_prelude]` can be applied to crates and modules
warning: `#[diagnostic::do_not_recommend]` does not expect any arguments
--> $DIR/malformed-attrs.rs:152:1
|
LL | #[diagnostic::do_not_recommend()]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: `#[automatically_derived]` attribute cannot be used on modules
--> $DIR/malformed-attrs.rs:193:1
|
LL | #[automatically_derived = 18]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[automatically_derived]` can only be applied to trait impl blocks
error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]`
--> $DIR/malformed-attrs.rs:227:1
|
LL | #[ignore = 1]
| ^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
error[E0308]: mismatched types
--> $DIR/malformed-attrs.rs:116:23
|
LL | fn test() {
| - help: a return type might be missing here: `-> _`
LL | #[coroutine = 63] || {}
| ^^^^^ expected `()`, found coroutine
|
= note: expected unit type `()`
found coroutine `{coroutine@$DIR/malformed-attrs.rs:116:23: 116:25}`
error: aborting due to 75 previous errors; 8 warnings emitted
Some errors have detailed explanations: E0308, E0463, E0539, E0565, E0658, E0805.
For more information about an error, try `rustc --explain E0308`.
Future incompatibility report: Future breakage diagnostic:
error: valid forms for the attribute are `#[inline(always)]`, `#[inline(never)]`, and `#[inline]`
--> $DIR/malformed-attrs.rs:52:1
|
LL | #[inline = 5]
| ^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
= note: `#[deny(ill_formed_attribute_input)]` (part of `#[deny(future_incompatible)]`) on by default
Future breakage diagnostic:
error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]`
--> $DIR/malformed-attrs.rs:97:1
|
LL | #[ignore()]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
= note: `#[deny(ill_formed_attribute_input)]` (part of `#[deny(future_incompatible)]`) on by default
Future breakage diagnostic:
error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]`
--> $DIR/malformed-attrs.rs:227:1
|
LL | #[ignore = 1]
| ^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
= note: `#[deny(ill_formed_attribute_input)]` (part of `#[deny(future_incompatible)]`) on by default