-
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
rustc: move mir::SourceScopeLocalData to a field of SourceScopeData. #66789
Conversation
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
r? @oli-obk |
src/librustc_mir/transform/inline.rs
Outdated
@@ -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() { |
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.
cc @Centril @wesleywiser this PR may in fact be fixing the inliner ICE encountered during stage2 building
@bors r+ |
📌 Commit abed9e8034b0527ee00e6edf0e3b99baebe257de has been approved by |
This comment has been minimized.
This comment has been minimized.
abed9e8
to
3aead85
Compare
@bors r=oli-obk |
📌 Commit 3aead85 has been approved by |
…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.
This comment has been minimized.
This comment has been minimized.
3aead85
to
a9976d8
Compare
@bors r=oli-obk |
@bors retry spurious |
…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.
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
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
…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.
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
Rustup to rust-lang/rust#66789 changelog: none
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 ````
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 ````
By having one
ClearCrossCrate<SourceScopeLocalData>
for each scope, as opposed to a singleClearCrossCrate
for all theSourceScopeLocalData
s, we can represent the fact that some scopes haveSourceScopeLocalData
associated with them, and some don't.This is useful when doing MIR inlining across crates, because the
ClearCrossCrate
will beClear
for the cross-crate MIR scopes andSet
for the local ones.Also see #66203 (comment) for some context around this approach.
Fixes #51314.