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

rustc: move mir::SourceScopeLocalData to a field of SourceScopeData. #66789

Merged
merged 3 commits into from
Dec 2, 2019

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Nov 26, 2019

By having one ClearCrossCrate<SourceScopeLocalData> for each scope, as opposed to a single ClearCrossCrate for all the SourceScopeLocalDatas, we can represent the fact that some scopes have SourceScopeLocalData associated with them, and some don't.

This is useful when doing MIR inlining across crates, because the ClearCrossCrate will be Clear for the cross-crate MIR scopes and Set for the local ones.

Also see #66203 (comment) for some context around this approach.

Fixes #51314.

@rust-highfive
Copy link
Collaborator

r? @estebank

(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 26, 2019
@oli-obk
Copy link
Contributor

oli-obk commented Nov 26, 2019

r? @oli-obk

@@ -395,16 +395,25 @@ impl Inliner<'tcx> {
let mut local_map = IndexVec::with_capacity(callee_body.local_decls.len());
let mut scope_map = IndexVec::with_capacity(callee_body.source_scopes.len());

for mut scope in callee_body.source_scopes.iter().cloned() {
for (callee_idx, scope) in callee_body.source_scopes.iter_enumerated() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @Centril @wesleywiser this PR may in fact be fixing the inliner ICE encountered during stage2 building

@oli-obk
Copy link
Contributor

oli-obk commented Nov 27, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Nov 27, 2019

📌 Commit abed9e8034b0527ee00e6edf0e3b99baebe257de has been approved by oli-obk

@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 27, 2019
@bors

This comment has been minimized.

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 27, 2019
@eddyb eddyb force-pushed the mir-source-scope-local-data branch from abed9e8 to 3aead85 Compare November 28, 2019 14:04
@eddyb
Copy link
Member Author

eddyb commented Nov 28, 2019

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Nov 28, 2019

📌 Commit 3aead85 has been approved by oli-obk

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 28, 2019
RalfJung added a commit to RalfJung/rust that referenced this pull request Nov 29, 2019
…r=oli-obk

rustc: move mir::SourceScopeLocalData to a field of SourceScopeData.

By having one `ClearCrossCrate<SourceScopeLocalData>` for each scope, as opposed to a single `ClearCrossCrate` for all the `SourceScopeLocalData`s, we can represent the fact that some scopes have `SourceScopeLocalData` associated with them, and some don't.

This is useful when doing MIR inlining across crates, because the `ClearCrossCrate` will be `Clear` for the cross-crate MIR scopes and `Set` for the local ones.

Also see rust-lang#66203 (comment) for some context around this approach.

Fixes rust-lang#51314.
@bors

This comment has been minimized.

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 29, 2019
@eddyb eddyb force-pushed the mir-source-scope-local-data branch from 3aead85 to a9976d8 Compare November 29, 2019 23:49
@eddyb
Copy link
Member Author

eddyb commented Nov 29, 2019

@bors r=oli-obk

@Centril
Copy link
Contributor

Centril commented Nov 30, 2019

@bors retry spurious

@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 30, 2019
Centril added a commit to Centril/rust that referenced this pull request Dec 1, 2019
…r=oli-obk

rustc: move mir::SourceScopeLocalData to a field of SourceScopeData.

By having one `ClearCrossCrate<SourceScopeLocalData>` for each scope, as opposed to a single `ClearCrossCrate` for all the `SourceScopeLocalData`s, we can represent the fact that some scopes have `SourceScopeLocalData` associated with them, and some don't.

This is useful when doing MIR inlining across crates, because the `ClearCrossCrate` will be `Clear` for the cross-crate MIR scopes and `Set` for the local ones.

Also see rust-lang#66203 (comment) for some context around this approach.

Fixes rust-lang#51314.
bors added a commit that referenced this pull request Dec 1, 2019
Rollup of 7 pull requests

Successful merges:

 - #66346 (Replace .unwrap() with ? in std::os::unix::net)
 - #66789 (rustc: move mir::SourceScopeLocalData to a field of SourceScopeData.)
 - #66822 (libunwind_panic: adjust miri panic hack)
 - #66827 (handle diverging functions forwarding their return place)
 - #66828 (Less minification)
 - #66850 (rustc: hide HirId's fmt::Debug output from -Z span_free_formats.)
 - #66907 (rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.)

Failed merges:

 - #66874 (Miri engine: proper support for `Assert` MIR terminators)

r? @ghost
bors added a commit that referenced this pull request Dec 1, 2019
Rollup of 7 pull requests

Successful merges:

 - #66346 (Replace .unwrap() with ? in std::os::unix::net)
 - #66789 (rustc: move mir::SourceScopeLocalData to a field of SourceScopeData.)
 - #66822 (libunwind_panic: adjust miri panic hack)
 - #66827 (handle diverging functions forwarding their return place)
 - #66828 (Less minification)
 - #66850 (rustc: hide HirId's fmt::Debug output from -Z span_free_formats.)
 - #66907 (rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.)

Failed merges:

 - #66874 (Miri engine: proper support for `Assert` MIR terminators)

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request Dec 2, 2019
…r=oli-obk

rustc: move mir::SourceScopeLocalData to a field of SourceScopeData.

By having one `ClearCrossCrate<SourceScopeLocalData>` for each scope, as opposed to a single `ClearCrossCrate` for all the `SourceScopeLocalData`s, we can represent the fact that some scopes have `SourceScopeLocalData` associated with them, and some don't.

This is useful when doing MIR inlining across crates, because the `ClearCrossCrate` will be `Clear` for the cross-crate MIR scopes and `Set` for the local ones.

Also see rust-lang#66203 (comment) for some context around this approach.

Fixes rust-lang#51314.
bors added a commit that referenced this pull request Dec 2, 2019
Rollup of 7 pull requests

Successful merges:

 - #66346 (Replace .unwrap() with ? in std::os::unix::net)
 - #66789 (rustc: move mir::SourceScopeLocalData to a field of SourceScopeData.)
 - #66850 (rustc: hide HirId's fmt::Debug output from -Z span_free_formats.)
 - #66905 (rustc_plugin: Remove some remaining plugin features)
 - #66907 (rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.)
 - #66918 (Add crc and crypto to target feature whitelist on arm)
 - #66926 (add reusable MachineStop variant to Miri engine error enum)

Failed merges:

r? @ghost
@bors bors merged commit a9976d8 into rust-lang:master Dec 2, 2019
phansch added a commit to phansch/rust-clippy that referenced this pull request Dec 2, 2019
@eddyb eddyb deleted the mir-source-scope-local-data branch December 2, 2019 10:29
bors added a commit to rust-lang/rust-clippy that referenced this pull request Dec 2, 2019
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 2, 2019
Changes:
````
Normalize custom ICE test
Rustup to rust-lang#64736
Use assert_crate_local for a more explicit error
Rustup to rust-lang#66789
account for external macro in MISSING_INLINE_IN_PUBLIC_ITEMS lint
build(tests/fmt): use shared target dir
chore: fix and split some ui tests on 32bit system
build: set up build job for i686 targets
remove needless my_lint ui test
git quiet
deploy: cd to out/ before adding files to git
Less needless_doctest_main false positives
fmt
Feed the dog
Use rustc_env instead of exec_env for test
Make triggering this lint less likely 📎
Use exec_env to set backtrace level and normalize output
Update custom ICE function with latest rustc
Use Clippy version in ICE message
Add custom ICE message that points to Clippy repo
Fix master deployment
Run update_lints
Add projections check to EUV for escape analysis
Use infer_ctxt
Move use_self to nursery
Use `println!` on success instead of `eprintln!`
Revert "Disable chalk integration test. Output too large"
Remove the old integration-tests.sh script
Use rust implementation for integration tests in CI
Rust implementation of integration test
Don't error on clippy.toml of dependencies
Fix categorizations
Fix arguments on ExprUseVisitor::new
euv moved from middle to typeck
cmt_ -> Place
build: check if RTIM is not installed
make use of Result::map_or
trigger string_lit_as_bytes when literal has escapes
Remove negative float literal checks.
Enable deny-warnings feature everywhere in CI
Remove unused debugging feature
implemented `as_conversions` lint
fixing a typo
[comparison_chain] rust-lang#4827 Check `core::cmp::Ord` is implemented
add a good example for the approx_const lint
Add suggested good cases in docs for lifetimes lint
````
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request May 5, 2020
Changes:
````
Normalize custom ICE test
Rustup to rust-lang/rust#64736
Use assert_crate_local for a more explicit error
Rustup to rust-lang/rust#66789
account for external macro in MISSING_INLINE_IN_PUBLIC_ITEMS lint
build(tests/fmt): use shared target dir
chore: fix and split some ui tests on 32bit system
build: set up build job for i686 targets
remove needless my_lint ui test
git quiet
deploy: cd to out/ before adding files to git
Less needless_doctest_main false positives
fmt
Feed the dog
Use rustc_env instead of exec_env for test
Make triggering this lint less likely 📎
Use exec_env to set backtrace level and normalize output
Update custom ICE function with latest rustc
Use Clippy version in ICE message
Add custom ICE message that points to Clippy repo
Fix master deployment
Run update_lints
Add projections check to EUV for escape analysis
Use infer_ctxt
Move use_self to nursery
Use `println!` on success instead of `eprintln!`
Revert "Disable chalk integration test. Output too large"
Remove the old integration-tests.sh script
Use rust implementation for integration tests in CI
Rust implementation of integration test
Don't error on clippy.toml of dependencies
Fix categorizations
Fix arguments on ExprUseVisitor::new
euv moved from middle to typeck
cmt_ -> Place
build: check if RTIM is not installed
make use of Result::map_or
trigger string_lit_as_bytes when literal has escapes
Remove negative float literal checks.
Enable deny-warnings feature everywhere in CI
Remove unused debugging feature
implemented `as_conversions` lint
fixing a typo
[comparison_chain] rust-lang#4827 Check `core::cmp::Ord` is implemented
add a good example for the approx_const lint
Add suggested good cases in docs for lifetimes lint
````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Broken MIR: scope[1] index exists, but source_scope_local_data.len() == 1
6 participants