You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tracking Issue for future-incompatibility lint no_link_attr_used #164032
This is the tracking issue for the no_link_attr_used future-compatibility warning and other related errors. The goal of this page is to describe why this change was made and how you can fix code that is affected by it. It also provides a place to ask questions or register a complaint if you feel the change should not be made. For more information on the policy around future-compatibility warnings, see our breaking change policy guidelines.
What is the warning for?
Usage of the #[no_link] attribute.
Why was this change made?
This is a pre-1.0 attribute that accidentally got stabilized. It was only meant for compiler plugins which we no longer support, not for regular crates. It is rather fragile and can easily lead to linker errors depending on where rustc decides to codegen functions and statics, which varies between rustc versions. It might also be unsound if a crate for example expects a global constructor it defined to run. Using it doesn't have an effect on the size of the produced binaries except when it defines a #[used] static given that we remove all unused functions and statics at link time already.
Example
#[no_link]externcrate foo;
Recommendations
Remove the #[no_link] attribute.
When will this warning become a hard error?
Possibly in a couple of releases given that a crater run showed barely any usage.
Activity