-
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
Changes the type mir::Mir
into mir::Body
#60928
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @eddyb (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
@@ -71,7 +71,7 @@ macro_rules! make_mir_visitor { | |||
// Override these, and call `self.super_xxx` to revert back to the | |||
// default behavior. | |||
|
|||
fn visit_mir(&mut self, mir: & $($mutability)? Mir<'tcx>) { | |||
fn visit_mir(&mut self, mir: & $($mutability)? Body<'tcx>) { |
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 and super_mir
should be renamed to visit_body
, and super_body
, respectively.
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.
Rodger that. Done in the last force push.
Ref(&'mir String), | ||
Owned(Rc<String>), | ||
} | ||
|
||
impl<'mir> CachedMir<'mir> { | ||
impl<'mir> CachedBody<'mir> { |
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.
No need to change this test - alternatively, CachedMir
can be renamed to Cached
, if you want.
(Since this is a reduction, where Mir
was replaced with String
)
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.
Well received. Renamed to Cached
then !
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.
r=me after a rebase and with nits fixed
@eddyb I rebased the branch with the modifications you asked to one commit. |
@TheSirC You still need to rebase on latest master, before I can approve the PR. |
Sorry for the back-and-forth, just rebased. I will try to be reactive in case another one is needed. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Obviously in the rebase I messed up an import; normally fixed now. Let's see what Travis has to say ! |
@bors r+ |
📌 Commit 6d14e73 has been approved by |
Changes the type `mir::Mir` into `mir::Body` Fixes part 1 of rust-lang#60229 (previously attempted in rust-lang#60242). I stumbled upon the issue and it seems that the previous attempt at solving it was not merged. This is a second try more up-to-date. The commit should have changed comments as well. At the time of writting, it passes the tidy and check tool.
Rollup of 5 pull requests Successful merges: - rust-lang#60928 (Changes the type `mir::Mir` into `mir::Body`) - rust-lang#61035 (Avoid more symbol interning) - rust-lang#61036 (PGO - Add a smoketest for combining PGO with cross-language LTO.) - rust-lang#61077 (Don't arena-allocate static symbols.) - rust-lang#61080 (Ship profiler with windows-gnu) Failed merges: r? @ghost
☔ The latest upstream changes (presumably #60441) made this pull request unmergeable. Please resolve the merge conflicts. |
Should I rebase again ? |
Rebased to fix conflicts. Tests were passing locally. |
@bors r+ |
📌 Commit d5f7181 has been approved by |
This comment has been minimized.
This comment has been minimized.
@@ -1,4 +1,4 @@ | |||
use rustc::mir::{BasicBlock, Location, Mir}; | |||
use rustc::mir::{BasicBlock, Location, Body}; |
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 don't remember if @oli-obk wanted to leave this for another PR (or maybe I never asked for this before), but IMO Body
shouldn't be referred to as anything other than mir::Body
outside of the module it's defined in.
Oh wow, the failure has nothing to do with this PR, it just accidentally got triggered: rust/src/libsyntax/source_map.rs Lines 725 to 731 in 7212685
That code is missing a check that rust/src/libsyntax/source_map.rs Lines 514 to 517 in 7212685
Macros are involved, somehow causing a span to end up with its two endpoints in different files. That might otherwise result in ICEs, if not for them being at the exact same byte offset (within their respective files) which the algorithm doesn't account for. |
…sn't start and end in the same file.
📌 Commit 95013e6 has been approved by |
Changes the type `mir::Mir` into `mir::Body` Fixes part 1 of rust-lang#60229 (previously attempted in rust-lang#60242). I stumbled upon the issue and it seems that the previous attempt at solving it was not merged. This is a second try more up-to-date. The commit should have changed comments as well. At the time of writting, it passes the tidy and check tool.
Rollup of 9 pull requests Successful merges: - #60742 (Allow const parameters in array sizes to be unified) - #60756 (Add better tests for hidden lifetimes in impl trait) - #60928 (Changes the type `mir::Mir` into `mir::Body`) - #61024 (tests: Centralize proc macros commonly used for testing) - #61157 (BufReader: In Seek impl, remove extra discard_buffer call) - #61195 (Special-case `.llvm` in mangler) - #61202 (Print PermissionExt::mode() in octal in Documentation Examples) - #61259 (Mailmap fixes) - #61273 (mention that MaybeUninit is a bit like Option) Failed merges: r? @ghost
rustup rust-lang/rust#60928 changelog: none
rustup rust-lang/rust#60928 changelog: none
rustup rust-lang/rust#60928 changelog: none
rustup rust-lang/rust#60928 changelog: none
rustup rust-lang/rust#60928 changelog: none
rustup rust-lang/rust#60928 changelog: none
rustup rust-lang/rust#60928 changelog: none
Changes: ```` Rustup to rust-lang#61203 rustup rust-lang#60928 rustup rust-lang#61164 (which is included in rust-lang#61274) ````
Changes: ```` Rustup to rust-lang/rust#61203 rustup rust-lang/rust#60928 rustup rust-lang/rust#61164 (which is included in rust-lang/rust#61274) ````
Fixes part 1 of #60229 (previously attempted in #60242).
I stumbled upon the issue and it seems that the previous attempt at solving it was not merged. This is a second try more up-to-date.
The commit should have changed comments as well.
At the time of writting, it passes the tidy and check tool.