Skip to content

Fix some suggestions where a Box<T> is expected. #111056

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 1 commit into from
May 8, 2023
Merged

Fix some suggestions where a Box<T> is expected. #111056

merged 1 commit into from
May 8, 2023

Conversation

nullptrderef29
Copy link
Contributor

This fixes #111011, and also adds a suggestion for boxing a unit type when a Box<T> was expected and an empty block was found.

@rustbot
Copy link
Collaborator

rustbot commented May 1, 2023

r? @davidtwco

(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 1, 2023
@compiler-errors compiler-errors self-assigned this May 1, 2023
@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

Please squash this into one commit, then I think this is fine to land.

also add a suggestion for boxing empty blocks.
@nullptrderef29
Copy link
Contributor Author

commits have been squashed.

@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented May 8, 2023

📌 Commit 3598509 has been approved by compiler-errors

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

Successful merges:

 - rust-lang#110297 (Make `(try_)subst_and_normalize_erasing_regions` take `EarlyBinder`)
 - rust-lang#110827 (Fix lifetime suggestion for type aliases with objects in them)
 - rust-lang#111022 (Use smaller ints for bitflags)
 - rust-lang#111056 (Fix some suggestions where a `Box<T>` is expected.)
 - rust-lang#111262 (Further normalize msvc-non-utf8-ouput)
 - rust-lang#111265 (Make generics_of has_self on RPITITs delegate to the opaque)
 - rust-lang#111323 (Give a more helpful error when running the rustc shim directly)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit aceb5d9 into rust-lang:master May 8, 2023
@rustbot rustbot added this to the 1.71.0 milestone May 8, 2023
@nullptrderef29 nullptrderef29 deleted the fix_box_suggestions branch May 22, 2023 20:53
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 27, 2025
…ui-tests, r=compiler-errors

Clean up all dead files inside `tests/ui/`

While rebasing rust-lang#135860 I noticed that there are several dead `*.stderr` files inside `tests/ui/`.

When I checked thoroughly, I found 69 dead `*.$revision.stderr` files, 3 other dead `*.stderr` files and one dead `*.rs` file.

Prior to rust-lang#134808, compiletest's `--bless` didn't remove dead `*.stderr` files when the set of revisions changed in any way (renamings, removals, additions, …) which explains their existence.

Regarding the dead `*.rs` file, that one was located inside an `auxiliary/` directory (together with a `*.stderr` file) despite not being meant to be an auxiliary file (it's not referenced by any `//@ aux-*`, it has an accompanying `*.stderr` file and it's obvious from looking at rust-lang#111056 which added it). Ideally compiletest or tidy would forbid `*.std{out,err}` files inside `auxiliary/` dirs, that would've caught it. I moved it, updated it and turned it into a proper UI test.

---

How to reproduce:

1. Run `rm tests/ui/**/*.stderr`
2. Run `./x test tests/ui --bless` (or similar)
3. Manually / semi-automatically go through all tests that were ignored (likely due to your OS etc. not matching) and restore any stderr files that were overzealously removed

---

r? compiler
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 27, 2025
Rollup merge of rust-lang#136112 - fmease:clean-up-all-dead-files-in-ui-tests, r=compiler-errors

Clean up all dead files inside `tests/ui/`

While rebasing rust-lang#135860 I noticed that there are several dead `*.stderr` files inside `tests/ui/`.

When I checked thoroughly, I found 69 dead `*.$revision.stderr` files, 3 other dead `*.stderr` files and one dead `*.rs` file.

Prior to rust-lang#134808, compiletest's `--bless` didn't remove dead `*.stderr` files when the set of revisions changed in any way (renamings, removals, additions, …) which explains their existence.

Regarding the dead `*.rs` file, that one was located inside an `auxiliary/` directory (together with a `*.stderr` file) despite not being meant to be an auxiliary file (it's not referenced by any `//@ aux-*`, it has an accompanying `*.stderr` file and it's obvious from looking at rust-lang#111056 which added it). Ideally compiletest or tidy would forbid `*.std{out,err}` files inside `auxiliary/` dirs, that would've caught it. I moved it, updated it and turned it into a proper UI test.

---

How to reproduce:

1. Run `rm tests/ui/**/*.stderr`
2. Run `./x test tests/ui --bless` (or similar)
3. Manually / semi-automatically go through all tests that were ignored (likely due to your OS etc. not matching) and restore any stderr files that were overzealously removed

---

r? compiler
# 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.

Wrong suggestion for Boxxing body of async closure when expected return type of closure to be Box
8 participants