Skip to content

Place related refactors - #60486

Merged
bors merged 3 commits into
rust-lang:masterfrom
spastorino:place-related-refactors
May 4, 2019
Merged

Place related refactors#60486
bors merged 3 commits into
rust-lang:masterfrom
spastorino:place-related-refactors

Conversation

@spastorino

Copy link
Copy Markdown
Member

Meanwhile I was working on Place 2 I'm finding some little things that I had on my branch but preferred to land a separate PR for things that are simpler to merge.

r? @oli-obk

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 2, 2019
Place::Projection(proj) => place = &proj.base,
Place::Base(PlaceBase::Static(_)) => return None,
Place::Base(PlaceBase::Local(local)) => return Some(*local),
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's one awful way to write this more compactly:

pubfnbase_local(mutself:&Self) -> Option<Local>{loop{matchself{Place::Projection(proj) => self = &proj.base,Place::Base(PlaceBase::Static(_)) => returnNone,Place::Base(PlaceBase::Local(local)) => returnSome(*local),}}}

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I don't think it's really important. This code is going away at some point in the future where getting the base is just doing place.base or in this case self.base.

@oli-obk

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented May 3, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit 49f0141 has been approved by oli-obk

@borsbors 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 May 3, 2019
Centril added a commit to Centril/rust that referenced this pull request May 3, 2019
… r=oli-obk
Place related refactors
Meanwhile I was working on Place 2 I'm finding some little things that I had on my branch but preferred to land a separate PR for things that are simpler to merge.
r? @oli-obk
@CentrilCentril mentioned this pull request May 3, 2019
Centril added a commit to Centril/rust that referenced this pull request May 3, 2019
… r=oli-obk
Place related refactors
Meanwhile I was working on Place 2 I'm finding some little things that I had on my branch but preferred to land a separate PR for things that are simpler to merge.
r? @oli-obk
@CentrilCentril mentioned this pull request May 3, 2019
Centril added a commit to Centril/rust that referenced this pull request May 4, 2019
… r=oli-obk
Place related refactors
Meanwhile I was working on Place 2 I'm finding some little things that I had on my branch but preferred to land a separate PR for things that are simpler to merge.
r? @oli-obk
@CentrilCentril mentioned this pull request May 4, 2019
bors added a commit that referenced this pull request May 4, 2019
Rollup of 9 pull requests
Successful merges:
- #60429 (Account for paths in incorrect pub qualifier help)
- #60449 (Constrain all regions in the concrete type for an opaque type)
- #60486 (Place related refactors)
- #60513 (Remove -Z borrowck=compare flag)
- #60516 (Remove TypeckMir)
- #60517 (Reword casting message)
- #60520 (Add rustfmt toml)
- #60521 (Migrate tidy to rust 2018 edition)
- #60527 (Fix async fn lowering ICE with APIT.)
Failed merges:
r? @ghost
@bors
bors merged commit 49f0141 into rust-lang:masterMay 4, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: 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.

5 participants

@spastorino@oli-obk@bors@petrochenkov@rust-highfive