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

Renames mir::Mir to mir::Body #60242

Closed
wants to merge 8 commits into from
Closed

Conversation

marimeireles
Copy link

r? @eddyb

@rust-highfive
Copy link
Collaborator

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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 24, 2019
@rust-highfive

This comment has been minimized.

@varkor
Copy link
Member

varkor commented Apr 24, 2019

@marimeireles: if you run x.py check, you should be able to make sure that you've replaced all the occurrences of mir::Mir (without having to actually build the entire compiler). It looks like you're missing a few at the moment.

@marimeireles
Copy link
Author

Hi @varkor.
I know! Sorry for not testing before 🙈
I missed all of the objects. I'm changing them now.
Thanks for the answer.

@rust-highfive

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Apr 25, 2019

☔ The latest upstream changes (presumably #60250) made this pull request unmergeable. Please resolve the merge conflicts.

@marimeireles
Copy link
Author

Hi @eddyb, can you please check my PR?
I think it's correct now.

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
Copy link
Contributor

oli-obk commented Apr 25, 2019

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?

bors will inform everyone. We can prioritize your PR once it's ready so it doesn't have to get broken over and over again.

@marimeireles
Copy link
Author

@oli-obk ok.
So I'll fix it now and upload a new commit. Once it has passed all the checks successfully I'll ping you again, okay?
Thanks!

src/librustc_mir/util/borrowck_errors.rs Outdated Show resolved Hide resolved
src/test/incremental/hashes/call_expressions.rs Outdated Show resolved Hide resolved
src/librustc/session/config.rs Outdated Show resolved Hide resolved
@oli-obk
Copy link
Contributor

oli-obk commented Apr 25, 2019

So I'll fix it now and upload a new commit. Once it has passed all the checks successfully I'll ping you again, okay?

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.

@marimeireles
Copy link
Author

@oli-obk Ah, okay then :)
I'll wait for @eddyb.
Thanks for the reviews.

@@ -57,7 +57,7 @@ impl Cache {
}
}

fn calculate_predecessors(mir: &Mir<'_>) -> IndexVec<BasicBlock, Vec<BasicBlock>> {
fn calculate_predecessors(mir: &Body<'_>) -> IndexVec<BasicBlock, Vec<BasicBlock>> {
Copy link
Member

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::Bodys (I don't think we can do too, in this PR, it would bitrot much faster then).

Copy link
Contributor

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

src/librustc/mir/mod.rs Outdated Show resolved Hide resolved
@@ -460,7 +460,7 @@ pub enum PrintRequest {

#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum BorrowckMode {
Mir,
Body,
Copy link
Member

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)

Copy link
Author

Choose a reason for hiding this comment

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

Ok.

Copy link
Member

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>>,
Copy link
Member

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.

Copy link
Author

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.

Copy link
Contributor

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> {
Copy link
Member

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).

Copy link
Author

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?

Copy link
Contributor

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

@marimeireles
Copy link
Author

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.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:0e9ac420:start=1556290816020680043,finish=1556290964238484141,duration=148217804098
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:06:17]    Compiling rustc_macros v0.1.0 (/checkout/src/librustc_macros)
[00:06:23]    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
[00:06:27]    Compiling rustc_errors v0.0.0 (/checkout/src/librustc_errors)
[00:07:28]    Compiling syntax_ext v0.0.0 (/checkout/src/libsyntax_ext)
[00:07:54] error[E0599]: no variant named `Body` found for type `session::config::OutputType` in the current scope
[00:07:54]    --> src/librustc/session/config.rs:162:27
[00:07:54] 142 | pub enum OutputType {
[00:07:54] 142 | pub enum OutputType {
[00:07:54]     | ------------------- variant `Body` not found here
[00:07:54] ...
[00:07:54] 162 |             | OutputType::Body
[00:07:54]     |                           ^^^^ variant not found in `session::config::OutputType`
[00:07:54] 
[00:07:54] error[E0599]: no variant named `Body` found for type `session::config::OutputType` in the current scope
[00:07:54]    --> src/librustc/session/config.rs:173:25
[00:07:54] 142 | pub enum OutputType {
[00:07:54] 142 | pub enum OutputType {
[00:07:54]     | ------------------- variant `Body` not found here
[00:07:54] ...
[00:07:54] 173 |             OutputType::Body => "mir",
[00:07:54]     |                         ^^^^ variant not found in `session::config::OutputType`
[00:07:54] 
[00:07:54] error[E0599]: no variant named `Body` found for type `session::config::OutputType` in the current scope
[00:07:54]    --> src/librustc/session/config.rs:185:34
[00:07:54] 142 | pub enum OutputType {
[00:07:54] 142 | pub enum OutputType {
[00:07:54]     | ------------------- variant `Body` not found here
[00:07:54] ...
[00:07:54] 185 |             "mir" => OutputType::Body,
[00:07:54]     |                                  ^^^^ variant not found in `session::config::OutputType`
[00:07:54] 
[00:07:54] error[E0599]: no variant named `Body` found for type `session::config::OutputType` in the current scope
[00:07:54]    --> src/librustc/session/config.rs:201:25
[00:07:54] 142 | pub enum OutputType {
[00:07:54] 142 | pub enum OutputType {
[00:07:54]     | ------------------- variant `Body` not found here
[00:07:54] ...
[00:07:54] 201 |             OutputType::Body.shorthand(),
[00:07:54]     |                         ^^^^ variant not found in `session::config::OutputType`
[00:07:54] 
[00:07:54] error[E0599]: no variant named `Body` found for type `session::config::OutputType` in the current scope
[00:07:54]    --> src/librustc/session/config.rs:214:25
[00:07:54] 142 | pub enum OutputType {
[00:07:54] 142 | pub enum OutputType {
[00:07:54]     | ------------------- variant `Body` not found here
[00:07:54] ...
[00:07:54] 214 |             OutputType::Body => "mir",
[00:07:54]     |                         ^^^^ variant not found in `session::config::OutputType`
[00:07:54] 
[00:07:54] error[E0599]: no variant named `Body` found for type `session::config::OutputType` in the current scope
[00:07:54]    --> src/librustc/session/config.rs:281:27
[00:07:54] 142 | pub enum OutputType {
[00:07:54] 142 | pub enum OutputType {
[00:07:54]     | ------------------- variant `Body` not found here
[00:07:54] ...
[00:07:54] 281 |             | OutputType::Body
[00:07:54]     |                           ^^^^ variant not found in `session::config::OutputType`
[00:08:01] error: aborting due to 6 previous errors
[00:08:01] 
[00:08:01] For more information about this error, try `rustc --explain E0599`.
[00:08:01] error: Could not compile `rustc`.

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 @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Apr 27, 2019

☔ The latest upstream changes (presumably #59540) made this pull request unmergeable. Please resolve the merge conflicts.

@marimeireles
Copy link
Author

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.

Centril added a commit to Centril/rust that referenced this pull request May 25, 2019
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.
Centril added a commit to Centril/rust that referenced this pull request May 25, 2019
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.
Centril added a commit to Centril/rust that referenced this pull request May 25, 2019
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.
Centril added a commit to Centril/rust that referenced this pull request May 28, 2019
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.
@Dylan-DPC-zz Dylan-DPC-zz 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-review Status: Awaiting review from the assignee but also interested parties. labels Jun 3, 2019
@Dylan-DPC-zz
Copy link

ping from triage @marimeireles you have conflicts to resolve

@eddyb
Copy link
Member

eddyb commented Jun 3, 2019

@Dylan-DPC This landed as #60928, closing.

@eddyb eddyb closed this Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants