Skip to content

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

Merged
merged 1 commit into from
Jun 7, 2016

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Jun 1, 2016

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:

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.

@rust-highfive
Copy link
Contributor

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 => {
Copy link
Contributor

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

Copy link
Member Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eddyb

Could this speed up trait selection?

Hmm. Potentially, I'm not sure.

@nikomatsakis
Copy link
Contributor

r? @nikomatsakis

@rust-highfive rust-highfive assigned nikomatsakis and unassigned Aatch Jun 1, 2016
@nikomatsakis
Copy link
Contributor

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);
Copy link
Member Author

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?

Copy link
Contributor

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.

@nikomatsakis
Copy link
Contributor

Seems prudent to kick off a crater run here. I'll do that.

@eddyb eddyb force-pushed the tick-erased branch 2 times, most recently from c979e0a to ac875bf Compare June 4, 2016 21:54
@nikomatsakis
Copy link
Contributor

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 6, 2016

📌 Commit bcec7a5 has been approved by nikomatsakis

@bors
Copy link
Collaborator

bors commented Jun 6, 2016

⌛ Testing commit bcec7a5 with merge 67f908f...

bors added a commit that referenced this pull request Jun 6, 2016
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.
@bors
Copy link
Collaborator

bors commented Jun 6, 2016

💔 Test failed - auto-win-gnu-32-opt-rustbuild

@eddyb
Copy link
Member Author

eddyb commented Jun 6, 2016

@bors retry

@eddyb
Copy link
Member Author

eddyb commented Jun 6, 2016

@bors force

1 similar comment
@eddyb
Copy link
Member Author

eddyb commented Jun 6, 2016

@bors force

@bors
Copy link
Collaborator

bors commented Jun 6, 2016

💔 Test failed - auto-win-gnu-32-opt-rustbuild

@eddyb
Copy link
Member Author

eddyb commented Jun 6, 2016

@bors retry

@eddyb
Copy link
Member Author

eddyb commented Jun 6, 2016

@bors force

1 similar comment
@eddyb
Copy link
Member Author

eddyb commented Jun 6, 2016

@bors force

@bors
Copy link
Collaborator

bors commented Jun 6, 2016

💔 Test failed - auto-win-gnu-32-opt-rustbuild

@eddyb
Copy link
Member Author

eddyb commented Jun 6, 2016

@bors retry

@eddyb
Copy link
Member Author

eddyb commented Jun 6, 2016

@bors force

1 similar comment
@eddyb
Copy link
Member Author

eddyb commented Jun 6, 2016

@bors force

@eddyb
Copy link
Member Author

eddyb commented Jun 7, 2016

@bors force

@eddyb
Copy link
Member Author

eddyb commented Jun 7, 2016

@alexcrichton It broke 😢

@eddyb
Copy link
Member Author

eddyb commented Jun 7, 2016

@bors r-

@alexcrichton
Copy link
Member

@bors: retry force clean

@eddyb
Copy link
Member Author

eddyb commented Jun 7, 2016

@bors r=nikomatsakis

@bors
Copy link
Collaborator

bors commented Jun 7, 2016

📌 Commit bcec7a5 has been approved by nikomatsakis

@bors
Copy link
Collaborator

bors commented Jun 7, 2016

⌛ Testing commit bcec7a5 with merge f352550...

bors added a commit that referenced this pull request Jun 7, 2016
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.
@bors bors merged commit bcec7a5 into rust-lang:master Jun 7, 2016
@eddyb eddyb deleted the tick-erased branch June 7, 2016 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants