Skip to content
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

add flags to InternedTy and InternedRegion types #627

Closed
nikomatsakis opened this issue Oct 20, 2020 · 3 comments · Fixed by #639
Closed

add flags to InternedTy and InternedRegion types #627

nikomatsakis opened this issue Oct 20, 2020 · 3 comments · Fixed by #639
Assignees
Labels
good first issue A good issue to start working on Chalk with

Comments

@nikomatsakis
Copy link
Contributor

nikomatsakis commented Oct 20, 2020

In rustc, we have a "flags" system that propagates information about a type upward and which can be used to shortcircuit a lot of work. The [TypeFlags] propagates various bits. Each time a type is interned, the flags from any subtypes are combined to form the flags for the new interned type. This allows us to do things like skip subtrees that don't contain the sort of thing we are looking for efficiently.

In the meeting today we discussed different ways of doing this. I'll add a comment with more notes.

@jackh726
Copy link
Member

What do we need flags for on lifetimes? In rustc, there are only flags on types, I thought?

Definition in rustc: https://github.com/rust-lang/rust/blob/a9cd294cf2775441e713c7ee2918b728733b99f5/compiler/rustc_middle/src/ty/mod.rs#L501

Going to mark this as a good first issue, since this should be fairly straightforward.

@jackh726 jackh726 added the good first issue A good issue to start working on Chalk with label Oct 22, 2020
@matthewjasper
Copy link
Contributor

I don't think that a flags field makes much sense on lifetimes, because they're fairly fast to compute directly (just a match).
There are also flags on Predicate in rustc.

@chfont
Copy link
Contributor

chfont commented Oct 24, 2020

I've started working on this.

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good issue to start working on Chalk with
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants