Skip to content

Tracking issue for future-incompatibility lint ill_formed_attribute_input #57571

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
2 of 3 tasks
petrochenkov opened this issue Jan 13, 2019 · 0 comments
Open
2 of 3 tasks
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-future-incompatibility Category: Future-incompatibility lints C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@petrochenkov
Copy link
Contributor

petrochenkov commented Jan 13, 2019

What is this lint about

Previously inputs for many built-in attributes weren't validated and nonsensical attributes like #[no_std(arbitraty, string = "foo")] were accepted.
#57321 introduced a check for top-level shape (#[attr] vs #[attr(...)] vs #[attr = ...]) for built-in attributes that produces an error by default, but produces a warning for incorrect attribute forms available on stable that were actually encountered in practice (during crater run).
Currently the list is

#[doc]
#[ignore(...)]
#[inline = "..."]
#[link]
#[link = "..."]

, but it can be extended if more regressions are reported.

How to fix this warning/error

Use one of the correct attribute forms suggested by the compiler.

Current status

@petrochenkov petrochenkov added A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-future-incompatibility Category: Future-incompatibility lints C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-lang Relevant to the language team, which will review and decide on the PR/issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 13, 2019
@Centril Centril removed the C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC label Jan 13, 2019
tesuji added a commit to tesuji/rustup that referenced this issue Apr 12, 2019
The full warning:

    warning: attribute must be of the form `#[ignore]` or `#[ignore = "reason"]`
    = note: #[warn(ill_formed_attribute_input)] on by default
    = 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 <rust-lang/rust#57571>
tesuji added a commit to tesuji/rustup that referenced this issue Apr 13, 2019
The full warning:

    warning: attribute must be of the form `#[ignore]` or `#[ignore = "reason"]`
    = note: #[warn(ill_formed_attribute_input)] on by default
    = 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 <rust-lang/rust#57571>
tesuji added a commit to tesuji/rustup that referenced this issue Apr 14, 2019
The full warning:

    warning: attribute must be of the form `#[ignore]` or `#[ignore = "reason"]`
    = note: #[warn(ill_formed_attribute_input)] on by default
    = 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 <rust-lang/rust#57571>
glandium added a commit to glandium/coreaudio-sys that referenced this issue Jul 26, 2019
They cause the following warnings:
warning: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...",
                                               /*opt*/ cfg = "...")]`
 --> /tmp/coreaudio-sys/target/x86_64-apple-darwin/debug/build/coreaudio-sys-0d8fd082e359c2ec/out/coreaudio.rs:3:1
  |
3 | #[link = "/tmp/MacOSX10.14.sdk/System/Library/Frameworks/AudioToolbox"]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: #[warn(ill_formed_attribute_input)] on by default
  = 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 <rust-lang/rust#57571>

And they are actually redundant with the cargo:rustc-link-lib lines the
build script prints already.
bors added a commit that referenced this issue Aug 3, 2019
Transition some C-future-compatibility lints to {ERROR, DENY}

Closes #40107 (ERROR).
Closes #39207 (ERROR).
Closes #37872 (ERROR).
Closes #36887 (ERROR).
Closes #36247 (ERROR.
Closes #42238 (ERROR).
Transitions #59014 (DENY).
Transitions #57571 (DENY).
Closes #60210 (ERROR).
Transitions #35203 (DENY).

r? @petrochenkov
Centril added a commit to Centril/rust that referenced this issue Nov 8, 2019
Transition future compat lints to {ERROR, DENY} - Take 2

Follow up to rust-lang#63247 implementing rust-lang#63247 (comment).

- `legacy_ctor_visibility` (ERROR) -- closes rust-lang#39207
- `legacy_directory_ownership` (ERROR) -- closes rust-lang#37872
- `safe_extern_static` (ERROR) -- closes rust-lang#36247
- `parenthesized_params_in_types_and_modules` (ERROR) -- closes rust-lang#42238
- `duplicate_macro_exports` (ERROR)
- `nested_impl_trait` (ERROR) -- closes rust-lang#59014
- `ill_formed_attribute_input` (DENY) -- transitions rust-lang#57571
- `patterns_in_fns_without_body` (DENY) -- transitions rust-lang#35203

r? @varkor
cc @petrochenkov
Centril added a commit to Centril/rust that referenced this issue Nov 8, 2019
Transition future compat lints to {ERROR, DENY} - Take 2

Follow up to rust-lang#63247 implementing rust-lang#63247 (comment).

- `legacy_ctor_visibility` (ERROR) -- closes rust-lang#39207
- `legacy_directory_ownership` (ERROR) -- closes rust-lang#37872
- `safe_extern_static` (ERROR) -- closes rust-lang#36247
- `parenthesized_params_in_types_and_modules` (ERROR) -- closes rust-lang#42238
- `duplicate_macro_exports` (ERROR)
- `nested_impl_trait` (ERROR) -- closes rust-lang#59014
- `ill_formed_attribute_input` (DENY) -- transitions rust-lang#57571
- `patterns_in_fns_without_body` (DENY) -- transitions rust-lang#35203

r? @varkor
cc @petrochenkov
@fmease fmease changed the title Tracking issue for ill_formed_attribute_input compatibility lint Tracking issue for future-incompatibility lint ill_formed_attribute_input Sep 14, 2024
@fmease fmease added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC A-attributes Area: Attributes (`#[…]`, `#![…]`) labels Sep 14, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-future-incompatibility Category: Future-incompatibility lints C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
Archived in project
Development

No branches or pull requests

3 participants