-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustc: add ReErased to be used by trait selection, MIR and trans. #34012
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
Conversation
r? @Aatch (rust_highfive has picked a reviewer for you, use r? to override) |
@@ -359,7 +359,8 @@ impl<'cx, 'gcx, 'tcx> ty::fold::TypeFolder<'gcx, 'tcx> for Generalizer<'cx, 'gcx | |||
ty::ReStatic | | |||
ty::ReScope(..) | | |||
ty::ReVar(..) | | |||
ty::ReFree(..) => { | |||
ty::ReFree(..) | | |||
ty::ReErased => { |
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 ought to map ReErased
to ReErased
here
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.
Could this speed up trait selection?
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.
I am wondering if we can make it an error to try and relate "erased" regions and region variables, kind of like late-bound. This was certainly my hope, but it might cause problems in trans -- certainly we'd have to make this change first. |
(_, ReEarlyBound(..)) | | ||
(ReErased, _) | | ||
(_, ReErased) => { | ||
bug!("cannot relate region: LUB({:?}, {:?})", a, b); |
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.
@nikomatsakis Is this what you were talking about?
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.
@eddyb it's a start; I think we might be able to go a bit further. But probably we should just land this change and I can experiment off-line.
Seems prudent to kick off a crater run here. I'll do that. |
c979e0a
to
ac875bf
Compare
@bors r+ |
📌 Commit bcec7a5 has been approved by |
rustc: add ReErased to be used by trait selection, MIR and trans. `ReErased` replaces `ReStatic` (i.e. `'static`) for erasing regions. Using a distinct lifetime helps prevent accidental mix-ups between the two. It also allows cleaner type printing (see test changes), including in symbol names: ```rust str..pattern..CharSearcher$LT$$u27$static$GT$::drop.30560::h840c2f2afc03bbea // before str..pattern..CharSearcher::drop.30561::h6bd31d2af614377a // after ``` Not that we should be producing symbols this way, but it's still better.
💔 Test failed - auto-win-gnu-32-opt-rustbuild |
@bors retry |
@bors force |
1 similar comment
@bors force |
💔 Test failed - auto-win-gnu-32-opt-rustbuild |
@bors retry |
@bors force |
1 similar comment
@bors force |
💔 Test failed - auto-win-gnu-32-opt-rustbuild |
@bors retry |
@bors force |
1 similar comment
@bors force |
@bors force |
@alexcrichton It broke 😢 |
@bors r- |
@bors: retry force clean |
@bors r=nikomatsakis |
📌 Commit bcec7a5 has been approved by |
rustc: add ReErased to be used by trait selection, MIR and trans. `ReErased` replaces `ReStatic` (i.e. `'static`) for erasing regions. Using a distinct lifetime helps prevent accidental mix-ups between the two. It also allows cleaner type printing (see test changes), including in symbol names: ```rust str..pattern..CharSearcher$LT$$u27$static$GT$::drop.30560::h840c2f2afc03bbea // before str..pattern..CharSearcher::drop.30561::h6bd31d2af614377a // after ``` Not that we should be producing symbols this way, but it's still better.
ReErased
replacesReStatic
(i.e.'static
) for erasing regions.Using a distinct lifetime helps prevent accidental mix-ups between the two.
It also allows cleaner type printing (see test changes), including in symbol names:
Not that we should be producing symbols this way, but it's still better.