Skip to content

Validate that locals have a corresponding LocalDecl #79031

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Nov 15, 2020

Conversation

camelid
Copy link
Member

@camelid camelid commented Nov 13, 2020

Fixes #73356.

@camelid camelid added the A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html label Nov 13, 2020
@rust-highfive
Copy link
Contributor

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 13, 2020
@camelid
Copy link
Member Author

camelid commented Nov 13, 2020

How should I test that this works correctly?

@camelid camelid force-pushed the mir-validate-local-decl branch from d14ad96 to dc6f1c5 Compare November 13, 2020 19:26
@camelid
Copy link
Member Author

camelid commented Nov 13, 2020

r? @jonas-schievink

@jonas-schievink
Copy link
Contributor

How should I test that this works correctly?

You can run RUSTFLAGS_NOT_BOOTSTRAP="-Zvalidate-mir" ./x.py test

@camelid
Copy link
Member Author

camelid commented Nov 13, 2020

Sorry, what I meant was how do I create something to test it on? This check will only fire when there's a bug in the compiler, so unless the idea is to mess with some other part of the compiler to introduce a bug, I'm not sure how to produce input to test it on.

@jonas-schievink
Copy link
Contributor

Yeah, it's fine not to test this further.

@camelid camelid force-pushed the mir-validate-local-decl branch 2 times, most recently from 311c9e9 to 2428d3d Compare November 13, 2020 19:53
@camelid camelid force-pushed the mir-validate-local-decl branch from 2428d3d to aca8099 Compare November 13, 2020 20:02
@camelid camelid force-pushed the mir-validate-local-decl branch from aca8099 to 7eb1a1a Compare November 13, 2020 20:54
@jonas-schievink
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Nov 13, 2020

📌 Commit 7eb1a1a 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 13, 2020
@camelid camelid added the -Zvalidate-mir Unstable option: MIR validation label Nov 13, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 15, 2020
…as-schievink

Rollup of 13 pull requests

Successful merges:

 - rust-lang#77802 (Allow making `RUSTC_BOOTSTRAP` conditional on the crate name)
 - rust-lang#79004 (Add `--color` support to bootstrap)
 - rust-lang#79005 (cleanup: Remove `ParseSess::injected_crate_name`)
 - rust-lang#79016 (Make `_` an expression, to discard values in destructuring assignments)
 - rust-lang#79019 (astconv: extract closures into a separate trait)
 - rust-lang#79026 (Implement BTreeMap::retain and BTreeSet::retain)
 - rust-lang#79031 (Validate that locals have a corresponding `LocalDecl`)
 - rust-lang#79034 (rustc_resolve: Make `macro_rules` scope chain compression lazy)
 - rust-lang#79036 (Move Steal to rustc_data_structures.)
 - rust-lang#79041 (Rename clean::{ItemEnum -> ItemKind}, clean::Item::{inner -> kind})
 - rust-lang#79058 (Move likely/unlikely argument outside of invisible unsafe block)
 - rust-lang#79059 (Print 'checking cranelift artifacts' to easily separate it from other artifacts)
 - rust-lang#79063 (Update rustfmt to v1.4.26)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9c6d3c0 into rust-lang:master Nov 15, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 15, 2020
@camelid camelid deleted the mir-validate-local-decl branch November 15, 2020 18:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
-Zvalidate-mir Unstable option: MIR validation 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.

-Zvalidate-mir: check that all referenced locals exist
6 participants