-
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
Make transmuting from fn item types to pointer-sized types a hard error. #34198
Make transmuting from fn item types to pointer-sized types a hard error. #34198
Conversation
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
I'll start a crater run to see if there's any measurable impact. |
41ffc25
to
ddf2469
Compare
Crater report: https://gist.github.com/eddyb/c9a976482be44529e3cdd79ca97db0ce. This looks pretty bad, much worse than what I remember. It seems a bunch of crates haven't fixed their code, although the warning only now got into beta, so nobody staying on stable has ever seen it. |
Looks like |
I've been meaning to alter the future compatibility warnings so that they
|
@nikomatsakis That's great, because it alerts users that depend on outdated (unfixed) versions. |
I just got the ability to publish and published nix v0.6.0 which builds on nightly. |
Crater report 2: https://gist.github.com/eddyb/defd09acfd0c1d6036334d147d7fc040. @kamalmarhubi As I feared, releasing EDIT: Even worse, |
@SSheldon |
@eddyb I just published a v0.5.1, which builds on nightly. Publishing things in earlier release series is harder as we don't have git tags for those releases. I can try to narrow it down, but it will probably not be today. |
@kamalmarhubi Thanks for the help with this! |
@GuillaumeGomez @gkoz Reminder that |
0.0.x versions don't upgrade automatically to anything, so nothing can be done. |
@bluss I just checked and indeed that's the case - why do we even allow depending on such an "unfixable" version?! |
@nikomatsakis I've went through all of the 50 root regressions and here's what I found: Partially fixed and/or yet unpublished fixes
Yet unfixed |
@eddyb: Fine fine! |
@eddyb I've yanked |
@eddyb, if the crates relying on objc 0.1 were upgraded to use 0.2, would that be satisfactory? Or must there be a fix for 0.1? The fix for 0.1 would be a lot of copy-pasting and I'm not super keen on it 😅 Looking at the crates that require 0.1:
If it's amenable to you I might just take this as an opportunity to get clipboard and uikit updated. |
@SSheldon That sounds great, thank you! Having seen the code, I agree that not fixing the |
@tomaka Is glutin_cocoa completely unused anymore? |
Yeah it'll work in terms of preventing new dependencies on it, but it's the same standard "lockfiles continue to work" semantics which means it's not 100% fixed if someone's using it. If no one's using it though then shouldn't matter too much either way. |
@alexcrichton It has... downloads. I wonder if that's all from crater though, heh. |
@eddyb see also #19925 (comment), which I think is a nifty idea, though orthogonal-ish from this PR |
fb4663b
to
e1c3a6f
Compare
Latest crater run shows the same regressions as before - see #34198 (comment). |
@nikomatsakis Oh I almost forgot about the EDIT: done! |
e1c3a6f
to
6b99df6
Compare
src/librustc/diagnostics.rs
Outdated
of `foo` tells us precisely what function is being called. | ||
|
||
As noted above, coercions mean that most code continues to work just fine | ||
before and after this behavior was implemented. However, you can tell the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably we don't want to say "this behavior was implemented" here...I would just say "Coercions mean that most code doesn't have to be concerned with this distinction."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah that's a better phrasing. I did try to remove temporal indicators, this one was trickiest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me modulo the extended error description change I suggested.
I still think we may want to consider making extern "C" fn
types be pointer-sized, but that's a separate change that ought to go through the RFC process IMO.
6b99df6
to
7650afc
Compare
@bors r=nikomatsakis |
📌 Commit 7650afc has been approved by |
💔 Test failed - status-appveyor |
@bors retry
|
⌛ Testing commit 7650afc with merge d5d59ca... |
💔 Test failed - status-appveyor |
@bors: retry
* chocolatey error
…On Tue, Feb 28, 2017 at 4:24 PM, bors ***@***.***> wrote:
💔 Test failed - status-appveyor
<https://ci.appveyor.com/project/rust-lang/rust/build/1.0.2170>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#34198 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD95Nz5DBy-GXPj64lncYliSbJ8W4Uhks5rhJ6vgaJpZM4Iyy6A>
.
|
⌛ Testing commit 7650afc with merge 5bddaa4... |
💔 Test failed - status-travis |
@bors retry
|
…el-bad, r=nikomatsakis Make transmuting from fn item types to pointer-sized types a hard error. Closes #19925 by removing the future compatibility lint and the associated workarounds. This is a `[breaking-change]` if you `transmute` from a function item without casting first. For more information on how to fix your code, see #19925.
☀️ Test successful - status-appveyor, status-travis |
Closes #19925 by removing the future compatibility lint and the associated workarounds.
This is a
[breaking-change]
if youtransmute
from a function item without casting first.For more information on how to fix your code, see #19925.