Skip to content

Store interned predicates in ParameterEnvironment#41605

Merged
bors merged 1 commit into
rust-lang:masterfrom
tbg:param-env
May 3, 2017
Merged

Store interned predicates in ParameterEnvironment#41605
bors merged 1 commit into
rust-lang:masterfrom
tbg:param-env

Conversation

@tbg

@tbg tbg commented Apr 28, 2017

Copy link
Copy Markdown
Contributor

See #41444. As a first step towards untangling ParameterEnvironment, change
its caller_bounds field from a Vec into an interned slice of
ty::Predicates.

This change is intentionally well-contained and doesn't pull on any of the
loose ends. In particular, you'll note that normalize_param_env_or_error
now interns twice.

@tbg

tbg commented Apr 28, 2017

Copy link
Copy Markdown
Contributor Author

r? @nikomatsakis

@rust-highfive

Copy link
Copy Markdown
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@shepmaster

Copy link
Copy Markdown
Member

Thanks you for the PR! We'll make sure that @nikomatsakis or another team member provides a review in a timely fashion.

@shepmaster shepmaster added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 28, 2017
Comment thread src/librustc/traits/mod.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cute.

Comment thread src/librustc/ty/context.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Generating a "fresh slice" is basically free, so caching it makes no sense. You can remove this FIXME.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ps: I was thinking of the (perhaps) future case in which the empty slice also indexes into some caches, and then it would be important to make sure all empty slices are "equal". But that's just FUD on my part (and maybe you already know that it won't be relevant, ever).

Comment thread src/librustc/ty/mod.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't mind it, but I think that &'tcx [...] implies interning, so you don't really need to say it explicitly. (That is, you can't really get a reference with that lifetime unless it is interned, or at least allocated in a tcx arena.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, removed.

@nikomatsakis

Copy link
Copy Markdown
Contributor

Can you just tweak the comments as requested? Otherwise, r=me (ping me once you have done).

@nikomatsakis nikomatsakis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 28, 2017
@tbg

tbg commented Apr 28, 2017

Copy link
Copy Markdown
Contributor Author

@nikomatsakis ping (Apologies for not creating a new commit, I forgot, but nothing happened except the comment tweaks).

@nikomatsakis

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented May 2, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit ba2ae37 has been approved by nikomatsakis

@bors

bors commented May 2, 2017

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #41702) made this pull request unmergeable. Please resolve the merge conflicts.

See rust-lang#41444. As a first step towards untangling `ParameterEnvironment`, change
its `caller_bounds` field from a `Vec` into an interned slice of
`ty::Predicate`s.

This change is intentionally well-contained and doesn't pull on any of the
loose ends. In particular, you'll note that `normalize_param_env_or_error`
now interns twice.
@nikomatsakis

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented May 2, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit a6658d5 has been approved by nikomatsakis

@bors

bors commented May 2, 2017

Copy link
Copy Markdown
Collaborator

⌛ Testing commit a6658d5 with merge 4d81b14...

bors added a commit that referenced this pull request May 2, 2017
Store interned predicates in ParameterEnvironment

See #41444. As a first step towards untangling `ParameterEnvironment`, change
its `caller_bounds` field from a `Vec` into an interned slice of
`ty::Predicate`s.

This change is intentionally well-contained and doesn't pull on any of the
loose ends. In particular, you'll note that `normalize_param_env_or_error`
now interns twice.
@bors

bors commented May 3, 2017

Copy link
Copy Markdown
Collaborator

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 4d81b14 to master...

@bors bors merged commit a6658d5 into rust-lang:master May 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants