-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
#[link_name] is ignored on extern blocks #47725
Comments
AFAIK The fact that libstd got this wrong in some places is concerning, though 😅 |
Surprised again that the unused attribute lint is not firing. |
Yeah, I think you're right that |
This may have been the ancient method of what |
…an-DPC Remove unused `#[link_name = "m"]` attributes These were perhaps supposed to be `#[link(name = "m")]` but linking libm should be handled by the libc crate anyway. They should have triggered a compile error: rust-lang#47725
…acement, r=matthewjasper Validate built-in attribute placement Closes rust-lang#54584, closes rust-lang#47725, closes rust-lang#54044. I've changed silently ignoring some incorrectly placed attributes to errors. I'm not sure what the policy is since this can theoretically break code (should they be warnings instead? does it warrant a crater run?).
This fails to link with
undefined reference to `foo'
, but it didn't even try to find anyfoobar
library.With
#[link(name = "foobar")]
, the error is the expectedld: cannot find -lfoobar
.There are a few places in
libstd
using#[link_name = "m"] extern {...}
, so I wonder if those actually have any effect either.The text was updated successfully, but these errors were encountered: