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

Fix 2021 dyn suggestion that used code as label #88657

Merged
merged 1 commit into from
Sep 5, 2021

Conversation

camelid
Copy link
Member

@camelid camelid commented Sep 5, 2021

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.
@camelid camelid 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-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 5, 2021
@camelid
Copy link
Member Author

camelid commented Sep 5, 2021

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
Member

m-ou-se commented Sep 5, 2021

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 5, 2021

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

@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 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:master Sep 5, 2021
@rustbot rustbot added this to the 1.57.0 milestone Sep 5, 2021
@camelid camelid deleted the fix-dyn-sugg branch September 5, 2021 16:25
@camelid camelid 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
Member Author

camelid commented Sep 5, 2021

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.

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

apiraino commented Sep 9, 2021

Beta backport accepted as per compiler team on Zulip

@rustbot label +beta-accepted

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Sep 9, 2021
@cuviper cuviper mentioned this pull request Sep 14, 2021
@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Sep 14, 2021
@cuviper cuviper modified the milestones: 1.57.0, 1.56.0 Sep 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#88649 rust-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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2021 Area: The 2021 edition A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. beta-accepted Accepted for backporting to the compiler in the beta channel. D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. 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.

None yet

7 participants