Skip to content

Bad suggestion dyn pub on proc macro (#61963 regressed) #74043

Open
@SNCPlay42

Description

@SNCPlay42

#72306 causes the compiler to emit (and blessed) this bad suggestion in the test for #61963 (output):

error: trait objects without an explicit `dyn` are deprecated
  --> $DIR/issue-61963.rs:18:1
   |
LL | pub struct Foo {
   | ^^^ help: use `dyn`: `dyn pub`

This is the behaviour the test is supposed to guard against (almost - the original bad suggestion was to insert dyn before the proc macro attribute), so the issue is regressed.

The issue was originally fixed nearly a year ago, so this is a regression from stable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-proc-macrosArea: Procedural macrosA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions