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

MIR visitor: Don't treat debuginfo field access as a use of the struct #79080

Merged
merged 2 commits into from
Nov 23, 2020

Conversation

camelid
Copy link
Member

@camelid camelid commented Nov 15, 2020

@camelid camelid added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-mir Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html labels Nov 15, 2020
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 15, 2020
@jonas-schievink
Copy link
Contributor

Thanks! Please add a comment, and remove any existing special cases that are made obsolete by this fix.

@camelid
Copy link
Member Author

camelid commented Nov 15, 2020

remove any existing special cases that are made obsolete by this fix

What special cases are you referring to?

@jonas-schievink
Copy link
Contributor

fn visit_var_debug_info(&mut self, var_debug_info: &VarDebugInfo<'tcx>) {
// Debuginfo can contain field projections, which count as a use of the base local. Skip
// debuginfo so that we avoid the storage liveness assertion in that case.
self.visit_source_info(&var_debug_info.source_info);
}

etc.

@camelid camelid 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 Nov 16, 2020
@camelid
Copy link
Member Author

camelid commented Nov 23, 2020

I added a comment and removed the special case that you pointed out. I'm not sure what others there are though. If you know of more, I am happy to change them, but I don't have enough experience with MIR to know where they might be. Also it's probably fine to change them later since this change shouldn't mess up the special-casing; it just allows getting rid of the special-casing.

@camelid camelid added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 23, 2020
@jonas-schievink
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 23, 2020

📌 Commit b196bec has been approved by jonas-schievink

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 23, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 23, 2020
…as-schievink

Rollup of 10 pull requests

Successful merges:

 - rust-lang#76829 (stabilize const_int_pow)
 - rust-lang#79080 (MIR visitor: Don't treat debuginfo field access as a use of the struct)
 - rust-lang#79236 (const_generics: assert resolve hack causes an error)
 - rust-lang#79287 (Allow using generic trait methods in `const fn`)
 - rust-lang#79324 (Use Option::and_then instead of open-coding it)
 - rust-lang#79325 (Reduce boilerplate with the `?` operator)
 - rust-lang#79330 (Fix typo in comment)
 - rust-lang#79333 (doc typo)
 - rust-lang#79337 (Use Option::map instead of open coding it)
 - rust-lang#79343 (Add my (`@flip1995)` work mail to the mailmap)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d4a0569 into rust-lang:master Nov 23, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-mir Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Field accesses in debuginfo are treated as real uses of the base local
5 participants