-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Provide positional information when visiting ty, substs and closure_substs in MIR #43324
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @arielb1 (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. |
src/librustc/mir/visit.rs
Outdated
@@ -734,6 +737,12 @@ macro_rules! make_mir_visitor { | |||
make_mir_visitor!(Visitor,); | |||
make_mir_visitor!(MutVisitor,mut); | |||
|
|||
pub enum PositionalInfo { |
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.
This is the one part I wasn't sure about. I could have just passed Span
s as the third parameter to visit_ty
, but this leaves the visit implementations a little flexible for future uses. Also, is this the best place for this enum?
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'll just pass a Span
.
The one travis failure looks like a network issue. It never even finished the git processes. |
r+ with a |
Sorry, I made a mistake when I said I could have just passed a |
ping @arielb1, @Nashenas88 has some questions for you! |
Then maybe also pass the
|
@arielb1 I'm not sure I follow. |
@arielb1 would it suffice to reduce the enum to |
Ok @bors r+ |
📌 Commit 4b9acad has been approved by |
Provide positional information when visiting ty, substs and closure_substs in MIR This will enable the region renumbering portion of #43234 (non-lexical lifetimes). @nikomatsakis's current plan [here](https://gist.github.com/nikomatsakis/dfc27b28cd024eb25054b52bb11082f2) shows that we need spans of the original code to create new region variables, e.g. `self.infcx.next_region_var(infer::MiscVariable(span))`. The current visitor impls did not pass positional information (`Location` in some, `Span` and `SourceInfo` for others) for all types. I did not expand this to all visits, just the ones necessary for the above-mentioned plan.
☀️ Test successful - status-appveyor, status-travis |
This will enable the region renumbering portion of #43234 (non-lexical lifetimes). @nikomatsakis's current plan here shows that we need spans of the original code to create new region variables, e.g.
self.infcx.next_region_var(infer::MiscVariable(span))
. The current visitor impls did not pass positional information (Location
in some,Span
andSourceInfo
for others) for all types. I did not expand this to all visits, just the ones necessary for the above-mentioned plan.