-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Renames mir::Mir to mir::Body #60242
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. |
This comment has been minimized.
This comment has been minimized.
@marimeireles: if you run |
Hi @varkor. |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #60250) made this pull request unmergeable. Please resolve the merge conflicts. |
Hi @eddyb, can you please check my PR? The problem is if we don't merge it soon it will have a thousand of conflicts (like the one I just had) and other people will have conflicts too. I was thinking maybe I should warn the rust community somewhere? Do we have an email list besides the irc channels? |
|
@oli-obk ok. |
If you want you can wait for a review by @eddyb and then address all the conflicts at once. Otherwise you might be rebasing a lot over the next days. We can review even with conflicts. |
@@ -57,7 +57,7 @@ impl Cache { | |||
} | |||
} | |||
|
|||
fn calculate_predecessors(mir: &Mir<'_>) -> IndexVec<BasicBlock, Vec<BasicBlock>> { | |||
fn calculate_predecessors(mir: &Body<'_>) -> IndexVec<BasicBlock, Vec<BasicBlock>> { |
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.
@oli We might need a separate issue for replacing mir
used in the names of mir::Body
s (I don't think we can do too, in this PR, it would bitrot much faster 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.
makes sense, we can just keep the issue open and make it track multiple points
@@ -460,7 +460,7 @@ pub enum PrintRequest { | |||
|
|||
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] | |||
pub enum BorrowckMode { | |||
Mir, | |||
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.
This should also remain Mir
(basically, if it's an enum
variant, it should stay Mir
, because it's referring to rustc::mir
, e.g. as opposed to rustc::hir
, not rustc::mir::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.
Ok.
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 doesn't seem fixed yet, looking at the diff.
steal_mir: TypedArena<Steal<Mir<'tcx>>>, | ||
mir: TypedArena<Mir<'tcx>>, | ||
steal_mir: TypedArena<Steal<Body<'tcx>>>, | ||
mir: TypedArena<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.
I would avoid importing Body
like this, especially outside of rustc::mir
, rustc_mir
, or rustc_codegen_ssa
, and instead refer to it as mir::Body
.
Also, the names of these arena fields should probably be steal_mir_body
and mir_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'm gonna wait for @oli here.
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.
yea, this should be mir::Body
so it's clear from a glance what's going on.
the field renames can happen in this PR, they aren't ever touched by other PRs, so there's no churn
self.global_arenas.steal_mir.alloc(Steal::new(mir)) | ||
} | ||
|
||
pub fn alloc_mir(self, mir: Mir<'gcx>) -> &'gcx Mir<'gcx> { | ||
pub fn alloc_mir(self, mir: Body<'gcx>) -> &'gcx Body<'gcx> { |
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.
These methods should probably also end in _mir_body
(not sure if we should do this in this PR though).
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.
Okay... We should wait for @oli answer, right?
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.
you're pinging the wrong oli ;) I'm @oli-obk
yea, that rename makes sense, but let's do it in a separate PR to reduce bitrot
Thanks for the reviews @eddyb. I'll make one commit for each kind of fix to try to keep it organized and in the end I'll smash them together. |
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 |
☔ The latest upstream changes (presumably #59540) made this pull request unmergeable. Please resolve the merge conflicts. |
Sorry it took me so long to fix this. I saw that there is another person trying to fix this issue in a newer branch. I'll keep an eye on it in case their fix doesn't work. |
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.
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.
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.
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.
ping from triage @marimeireles you have conflicts to resolve |
@Dylan-DPC This landed as #60928, closing. |
r? @eddyb