Skip to content

Fix 2021 dyn suggestion that used code as label - #88657

Merged
bors merged 1 commit into
rust-lang:masterfrom
camelid:fix-dyn-sugg
Sep 5, 2021
Merged

Fix 2021 dyn suggestion that used code as label#88657
bors merged 1 commit into
rust-lang:masterfrom
camelid:fix-dyn-sugg

Conversation

@camelid

Copy link
Copy Markdown
Member

The arguments to span_suggestion were in the wrong order, so the error
looked like this:

error[E0783]: trait objects without an explicit `dyn` are deprecated
--> src/test/ui/editions/dyn-trait-sugg-2021.rs:10:5
|
10 | Foo::hi(123);
| ^^^ help: <dyn Foo>: `use `dyn``

Now the error looks like this, as expected:

error[E0783]: trait objects without an explicit `dyn` are deprecated
--> src/test/ui/editions/dyn-trait-sugg-2021.rs:10:5
|
10 | Foo::hi(123);
| ^^^ help: use `dyn`: `<dyn Foo>`

This issue was only present in the 2021 error; the 2018 lint was
correct.

r? @m-ou-se

The arguments to `span_suggestion` were in the wrong order, so the error
looked like this:
error[E0783]: trait objects without an explicit `dyn` are deprecated
--> src/test/ui/editions/dyn-trait-sugg-2021.rs:10:5
|
10 | Foo::hi(123);
| ^^^ help: <dyn Foo>: `use `dyn``
Now the error looks like this, as expected:
error[E0783]: trait objects without an explicit `dyn` are deprecated
--> src/test/ui/editions/dyn-trait-sugg-2021.rs:10:5
|
10 | Foo::hi(123);
| ^^^ help: use `dyn`: `<dyn Foo>`
This issue was only present in the 2021 error; the 2018 lint was
correct.
@camelidcamelid added A-edition-2021 Area: The 2021 edition A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. labels Sep 5, 2021
@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 5, 2021
@camelid

Copy link
Copy Markdown
MemberAuthor

If this lands after 1.56 gets promoted to beta, it may make sense to backport it. It looks like the latest beta is still for Rust 1.55.

@m-ou-se

Copy link
Copy Markdown
Member

@bors r+ rollup

@bors

bors commented Sep 5, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit 486d79f has been approved by m-ou-se

@borsbors 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 Sep 5, 2021
@m-ou-sem-ou-se mentioned this pull request Sep 5, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 5, 2021
Rollup of 4 pull requests
Successful merges:
- rust-lang#88257 (Provide more context on incorrect inner attribute)
- rust-lang#88432 (Fix a typo in raw_vec)
- rust-lang#88511 (x.py clippy: don't run with --all-targets by default)
- rust-lang#88657 (Fix 2021 `dyn` suggestion that used code as label)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit b4d06bf into rust-lang:masterSep 5, 2021
@rustbotrustbot added this to the 1.57.0 milestone Sep 5, 2021
@camelid
camelid deleted the fix-dyn-sugg branch September 5, 2021 16:25
@camelidcamelid added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 5, 2021
@camelid

Copy link
Copy Markdown
MemberAuthor

Looks like 1.56 branched before this landed, so I'll beta-nominate this and then T-compiler can decide whether it's worth backporting.

@camelidcamelid added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Sep 5, 2021
@apiraino

Copy link
Copy Markdown
Contributor

Beta backport accepted as per compiler team on Zulip

@rustbot label +beta-accepted

@rustbotrustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Sep 9, 2021
@cuvipercuviper mentioned this pull request Sep 14, 2021
@cuvipercuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Sep 14, 2021
@cuvipercuviper modified the milestones: 1.57.0, 1.56.0Sep 14, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 17, 2021
[beta] backports
- rustdoc: Fix ICE with `doc(hidden)` on tuple variant fields rust-lang#88639
- Fix 2021 `dyn` suggestion that used code as label rust-lang#88657
- Workaround blink/chromium grid layout limitation of 1000 rows rust-lang#88776
- Change scope of temporaries in match guards rust-lang#88678
- Add a regression test for rust-lang#88649rust-lang#88691
- Revert anon union parsing rust-lang#88775
- Disable validate_maintainers. rust-lang#88977
Also drop stage0 rustfmt, because that's only supposed to be used on master.
r? `@Mark-Simulacrum`
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-edition-2021Area: The 2021 editionA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`beta-acceptedAccepted for backporting to the compiler in the beta channel.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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.

7 participants

@camelid@m-ou-se@bors@apiraino@cuviper@rust-highfive@rustbot