-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
typeck: extract expr type-checking to expr.rs + refactor check_expr_kind #61857
Conversation
This comment has been minimized.
This comment has been minimized.
c01e37f
to
5057552
Compare
@@ -68,6 +68,7 @@ This API is completely unstable and subject to change. | |||
#![feature(rustc_diagnostic_macros)] | |||
#![feature(slice_patterns)] | |||
#![feature(never_type)] | |||
#![feature(inner_deref)] |
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.
what's up with this?
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.
Used in some places, e.g. https://github.com/rust-lang/rust/pull/61857/files#diff-4dca14d9f8d48a6af9ed414a126a9823R243 (just search for .deref()
in expr.rs
) to make things type-check :)
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.
Is that an addition to Option
? Damn, I think it's 1. confusing 2. we should be making progress on the coerce front instead of adding method hacks :/
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.
Yep; there's a PR to rename it to .as_deref()
. It's much less of a hack than using .map(...)
. =P
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.
We should probably never stabilize it and introduce the structural coercion already, hmpf.
@bors r+ |
📌 Commit 5057552 has been approved by |
typeck: extract expr type-checking to expr.rs + refactor check_expr_kind In this PR we: - Extract out the bulk of the expression type checking logic from `check/mod.rs` into a new file `check/expr.rs`. - Refactor `fn check_expr_kind` into several smaller functions. More functions should probably be moved but I think this is a reasonable start. r? @oli-obk cc @eddyb
☀️ Test successful - checks-travis, status-appveyor |
In this PR we:
Extract out the bulk of the expression type checking logic from
check/mod.rs
into a new filecheck/expr.rs
.Refactor
fn check_expr_kind
into several smaller functions.More functions should probably be moved but I think this is a reasonable start.
r? @oli-obk
cc @eddyb