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

Remove in_tail_expr from FnCtxt #103987

Merged
merged 1 commit into from
Nov 8, 2022
Merged

Conversation

compiler-errors
Copy link
Member

Cleans up yet another unneeded member from FnCtxt. The in_tail_expr condition wasn't even correct -- it was set for true while typechecking the whole fn body.

@rustbot
Copy link
Collaborator

rustbot commented Nov 4, 2022

r? @eholk

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 4, 2022
@eholk
Copy link
Contributor

eholk commented Nov 7, 2022

If in_tail_expr wasn't even correct, does that mean this change should change some of the diagnostics that get reported? Or was it incorrect in the safe direction (same errors get reported, but we don't get the short circuit optimization)?

@compiler-errors
Copy link
Member Author

compiler-errors commented Nov 7, 2022

It doesn't change typechecker behavior, if that's what you're asking -- the only usage of this boolean was after a diagnostic has already been constructed, so the worst it can do is make an error note change.

@eholk
Copy link
Contributor

eholk commented Nov 7, 2022

so the worst it can do is make an error note change.

Makes sense. It seemed to me like this was potentially short circuiting a little work to improve the error message if we knew it wasn't going to be applicable. With this change we'll be doing that extra work to improve it unconditionally then, right? It seems like in the worst case, we get better error messages than we did before, which seems like a good thing.

@bors r+

@bors
Copy link
Contributor

bors commented Nov 7, 2022

📌 Commit a0cdc85 has been approved by eholk

It is now in the queue for this repository.

@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 Nov 7, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 8, 2022
Rollup of 7 pull requests

Successful merges:

 - rust-lang#103446 (Specialize `iter::ArrayChunks::fold` for TrustedRandomAccess iterators)
 - rust-lang#103651 (Fix `rustc_parse_format` spans following escaped utf-8 multibyte chars)
 - rust-lang#103865 (Move `fallback_has_occurred` state tracking to `FnCtxt`)
 - rust-lang#103955 (Update linker-plugin-lto.md to contain up to Rust 1.65)
 - rust-lang#103987 (Remove `in_tail_expr` from FnCtxt)
 - rust-lang#104067 (fix debuginfo for windows_gnullvm_base.rs)
 - rust-lang#104094 (fully move `on_unimplemented` to `error_reporting`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 58c13e0 into rust-lang:master Nov 8, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 8, 2022
@compiler-errors compiler-errors deleted the no-in_tail_expr branch November 9, 2022 02:57
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 3, 2023
…li-obk

Miscellaneous HIR typeck nits

Remove some check functions that only have one usage

Also remove `Expectation::IsLast`, which was both undocumented, and was also made redundant by my cleanup/fix in rust-lang#103987 😸
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants