-
Notifications
You must be signed in to change notification settings - Fork 13k
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 lifetimes that only appear in return type early-bound #38897
Conversation
Oh I forgot-- I should deprecate the older fwds-compat lint too. And maybe improve wording of error message? Not sure how to do that. |
Crater run results: https://gist.github.com/nikomatsakis/25076c557d1c7d5ce3bcbacffdc953c9 Root regressions, sorted by rank:
|
Some of the failures above may be addressed by fixing #33684, though I'm not sure. In any case, I can try to submit PRs to address the issues. |
Will review later today. Sorry I missed this. |
// are named regions appearing in fn arguments that do not appear | ||
// in where-clauses | ||
pub late_bound: NodeMap<ty::Issue32330>, | ||
// the set of lifetime def ids that are early-bound; early-bound |
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.
Should be "that are late-bound".
src/librustc/ty/mod.rs
Outdated
@@ -637,8 +638,7 @@ impl<'tcx> RegionParameterDef<'tcx> { | |||
} | |||
|
|||
pub fn to_bound_region(&self) -> ty::BoundRegion { | |||
// this is an early bound region, so unaffected by #32330 | |||
ty::BoundRegion::BrNamed(self.def_id, self.name, Issue32330::WontChange) | |||
ty::BoundRegion::BrNamed(self.def_id, self.name, self.issue_32330) |
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.
So we're having that big enum on every ty::Region
? I suppose we should intern the (DefId, Name, Issue32230)
triple and check the perf impact. Maybe just do bitpacking to fit BoundRegion
in a u32 - should check the perf impact of that.
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+ after we communicate with the crater crate authors and fix nits.
|
@arielb1 ok I will follow-up prob tomorrow... |
2fcd11c
to
eaa72d7
Compare
The following are the "core crates" that appear to be affected by this change:
These crates will have to be fixed -- hopefully they are getting a lint warning now about future compatibility, though I'm not sure if the lint covers all the cases that are affected by the proper fix (that is quite challenging). Let me know if you are having trouble updating -- if I find time, I will try to prep some PRs. =) In addition, a number of crates were affected indirectly, because they relied on an older serde release that is affected. In these cases, the ideal thing is that they would update to a modern version of serde:
We could also solve this by a new point release of the relevant serde crates (cc @dtolnay, @erickt). UPDATE: @erickt helpfully patched serde, so this should be ok. |
Ah, I missed this comment. Yes, that's a reasonable point. I'll take a look and see what I can do. |
Fixed in latest commit. PR should be good to go. |
0c03295
to
c803efb
Compare
|
☔ The latest upstream changes (presumably #37057) made this pull request unmergeable. Please resolve the merge conflicts. |
e8e60a6
to
a611487
Compare
This is a problem with the code uncovered by the fix in rust-lang/rust#38897
This is the full and proper fix for rust-lang#32330. This also makes some effort to give a nice error message (as evidenced by the `ui` test), sending users over to the tracking issue for a full explanation.
a611487
to
b26120d
Compare
These were found due to the compiler fixes in rust-lang/rust#38897
@bors r=arielb1 |
📌 Commit b26120d has been approved by |
make lifetimes that only appear in return type early-bound This is the full and proper fix for #32330. This also makes some effort to give a nice error message (as evidenced by the `ui` test), sending users over to the tracking issue for a fuller explanation and offering a `--explain` message in some cases. This needs a crater run before we land. r? @arielb1
☀️ Test successful - status-appveyor, status-travis |
Tagging this for release notes. Something like this: "Lifetime parameters that do not appear in the arguments are now considered early-bound, resolving a soundness bug (#32330). The |
This is the full and proper fix for #32330. This also makes some effort to give a nice error message (as evidenced by the
ui
test), sending users over to the tracking issue for a fuller explanation and offering a--explain
message in some cases.This needs a crater run before we land.
r? @arielb1