-
Notifications
You must be signed in to change notification settings - Fork 959
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
Scope and Binding IDs #3572
Scope and Binding IDs #3572
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
919ef5e
to
e5f64ce
Compare
@@ -295,3 +304,132 @@ impl<'a> Context<'a> { | |||
} | |||
} | |||
} | |||
|
|||
/// The scopes of a program indexed by [`ScopeId`] |
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 moved all these types to a scope.rs
in the following PR
PR Check ResultsEcosystem✅ ecosystem check detected no changes. BenchmarkLinux
Windows
|
e5f64ce
to
4550b13
Compare
4550b13
to
f6283e6
Compare
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.
Great change, big improvement.
This PR introduces the new
ScopeId
andBindingId
types instead of using the genericusize
type.Using a specific type allows us to enforce that
bindings
andscopes
can only be indexed with the corresponding id-types, reducing the risk that they get mixed up. To do this, I had to introduce newScopes
,Bindings
andScopeStack
wrapper types.This PR removes the
AtomicUsize
that computes the next scope id and instead usesscopes.len()
to compute the next id.