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

small TypeVisitor refactor #79773

Merged
merged 1 commit into from
Dec 7, 2020
Merged

small TypeVisitor refactor #79773

merged 1 commit into from
Dec 7, 2020

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Dec 6, 2020

cc @LeSeulArtichaut @scottmcm

adds ControlFlow::map_break

@rust-highfive
Copy link
Collaborator

r? @ecstatic-morse

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 6, 2020
Copy link
Contributor

@LeSeulArtichaut LeSeulArtichaut left a comment

Choose a reason for hiding this comment

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

👍

compiler/rustc_typeck/src/check/check.rs Show resolved Hide resolved
compiler/rustc_typeck/src/check/check.rs Show resolved Hide resolved
library/core/src/ops/control_flow.rs Show resolved Hide resolved
Copy link
Contributor

@LeSeulArtichaut LeSeulArtichaut left a comment

Choose a reason for hiding this comment

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

I personally find this looks pretty good!

debug!("check_opaque_for_inheriting_lifetimes: (visit_ty) t={:?}", t);
if t != self.opaque_identity_ty {
t.super_visit_with(&mut FindParentLifetimeVisitor(self.generics))
.map_break(|FoundParentLifetime| t)
Copy link
Contributor

@LeSeulArtichaut LeSeulArtichaut Dec 6, 2020

Choose a reason for hiding this comment

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

I think this in particular is pretty awesome ❤️

Modulo the fact that the visitor names start to look like Java classes now 😆

Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

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

r=me with a tiny nit

compiler/rustc_typeck/src/check/check.rs Outdated Show resolved Hide resolved
@lcnr
Copy link
Contributor Author

lcnr commented Dec 7, 2020

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Dec 7, 2020

📌 Commit e3e4870 has been approved by oli-obk

@bors bors 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 Dec 7, 2020
@bors
Copy link
Contributor

bors commented Dec 7, 2020

⌛ Testing commit e3e4870 with merge b5ff9c3...

@LeSeulArtichaut
Copy link
Contributor

Wow, I had never seen the bors queue that empty 👀

@bors
Copy link
Contributor

bors commented Dec 7, 2020

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing b5ff9c3 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 7, 2020
@bors bors merged commit b5ff9c3 into rust-lang:master Dec 7, 2020
@rustbot rustbot added this to the 1.50.0 milestone Dec 7, 2020
@lcnr lcnr deleted the type-visitor branch December 7, 2020 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: 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.

8 participants