-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Statics' symbol names are susceptible to drift #9431
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
Comments
Actually this may not be a problem at all. If you don't recompile the application This is akin to someone updating header files, but you never recompile your application. You'll never pick up the updates... |
@alexcrichton why wouldn't it see the update? Is it because it is a generic and thus monomorphized using the metadata? |
Generic functions don't have compiled versions in libraries, they only have instantiations inside crates that actually use them. |
Closing as a dupe of #2419 |
Fixes rust-lang#9431. The current `range_plus_one` and `range_minus_one` suggestions are completely incorrect when macros are involved. This commit resolves this by disabling the lints for any range expression that is expanded from a macro. The reasons for this are that it is very difficult to create a correct suggestion in this case and that false negatives are less important for pedantic lints.
Fix `range_{plus,minus}_one` bad suggestions Fixes rust-lang#9431. The current `range_plus_one` and `range_minus_one` suggestions are completely incorrect when macros are involved. This commit resolves this by disabling the lints for any range expression that is expanded from a macro. The reasons for this are that it is very difficult to create a correct suggestion in this case and that false negatives are less important for pedantic lints. changelog: Fix `range_{plus,minus}_one` bad suggestions
Let's say you're a library author. You just published the following library file under the name
libbar
:Some innocent programmer then comes along and uses this file. They write the following program
Being a responsible library developer, you then realize that your library has a security flaw, so you update it to:
You realize that this change is ABI-compatible with your previous library version, so being a responsible library developer, you push out an updated version of your new library.
As a responsible application developer, the client using your library then updates their copy, only to result in the following terrible-ness. (this shell session assumes that I'm both the library and application developer).
The reason for this is that 1da4488 introduced the idea of a "pretty name" for statics which uses the
node_id
as the "unique tidbit" of information for a static in order to guarantee that they all have different names. This is very undesirable, and this should definitely be fixed.Nominating for production-ready, and possibly the priority tag.
All credit for finding this goes to @cmr's eagle eyes.
The text was updated successfully, but these errors were encountered: