Skip to content

Remove return type sized check hack from hir typeck #111704

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
May 23, 2023

Conversation

compiler-errors
Copy link
Member

Remove a bunch of special-cased suggestions when someone returns -> dyn Trait that checks for type equality, etc.

This was a pretty complex piece of code that also relied on a hack in hir typeck (see changes to compiler/rustc_hir_typeck/src/check.rs), and I'm not convinced that it's necessary to maintain, when all we really need to tell the user is that they should return -> impl Trait or -> Box<dyn Trait>, depending on their specific use-case.

This is necessary because we may need to move the "return type is sized" check from hir typeck to wfcheck, which does not have access to typeck results. This is a prerequisite for that, and I'm fairly confident that the diagnostics "regressions" here are not a big deal.

@rustbot
Copy link
Collaborator

rustbot commented May 18, 2023

r? @oli-obk

(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 May 18, 2023
@oli-obk
Copy link
Contributor

oli-obk commented May 23, 2023

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented May 23, 2023

📌 Commit 3db2bcf has been approved by oli-obk

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 May 23, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request May 23, 2023
Rollup of 6 pull requests

Successful merges:

 - rust-lang#111461 (Fix symbol conflict diagnostic mistakenly being shown instead of missing crate diagnostic)
 - rust-lang#111579 (Also assume wrap-around discriminants in `as` MIR building)
 - rust-lang#111704 (Remove return type sized check hack from hir typeck)
 - rust-lang#111853 (Check opaques for mismatch during writeback)
 - rust-lang#111854 (rustdoc: clean up `settings.css`)
 - rust-lang#111860 (Don't ICE if method receiver fails to unify with `arbitrary_self_types`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4b26b80 into rust-lang:master May 23, 2023
@rustbot rustbot added this to the 1.71.0 milestone May 23, 2023
@compiler-errors compiler-errors deleted the sized-return-cleanup branch August 11, 2023 20:19
# for free to join this conversation on GitHub. Already have an account? # 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