-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect link attibute allowed #53901
Comments
Report error for #[link] without arguments - Report an error for `#[link = "foo"]` (rather than `#[link(name = "foo")]`). - Report an error for duplicate arguments. - Improve feature gate diagnostics for `#[link]`. Fixes #53901.
Nominating for team discussion because it seems bad that this is silently ignored, but we can't make this an error without breaking code that currently compiles on stable (see the discussion in #57139). The pull request #57139 adds an allow-by-default future incompatibility lint for |
We're going to wait until #57321 lands and then following up on any part of this issue that doesn't fix, separately. |
The example in the original post now produces a warning, but more subtle issues covered by #57139, such as duplicate parameters are still not warned, so it's worth keeping this issue open until that's addressed. |
Fixed: error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ cfg = "...")]`
--> src/main.rs:1:1
|
1 | #[link="reiojregioergioregiojrge"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[deny(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 <https://github.com/rust-lang/rust/issues/57571>
error: aborting due to previous error |
(Playground)
Output:
The text was updated successfully, but these errors were encountered: