Skip to content

Deprecated suggestion message could be better #98631

Closed
@ChrisDenton

Description

@ChrisDenton

#![feature(deprecated_suggestion)] (#94785) produces warning messages that I think could be improved? The current suggestion message doesn't seem ideal to me:

warning: use of deprecated constant `std::sync::ONCE_INIT`: the `new` function is now preferred
 --> src/main.rs:4:32
  |
4 |     const _: Once = std::sync::ONCE_INIT;
  |                                ^^^^^^^^^ help: replace the use of the deprecated constant: `Once::new()`
  |
  = note: `#[warn(deprecated)]` on by default

Specifically this part sounds to me more like Once::new() is the deprecated constant:

help: replace the use of the deprecated constant: Once::new()

I think something like this would be better, but I don't know how easy it would be to implement a more natural sentence:

help: replace the use of the deprecated constant with Once::new()

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions