Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Double help message for new attribute parsing #143136

Closed

Description

@JonathanBrouwer

Code

#[unsafe(export_name)]
fn test() { }

Current output

error[E0539]: malformed `export_name` attribute input
 --> src/main.rs:7:1
  |
7 | #[unsafe(export_name)]
  | ^^^^^^^^^^^^^^^^^^^^^^
  | |
  | expected this to be of the form `export_name = "..."`
  | help: must be of the form: `#[export_name = "name"]`

Desired output

error[E0539]: malformed `export_name` attribute input
 --> src/main.rs:7:1
  |
7 | #[unsafe(export_name)]
  | ^^^^^^^^^^^^^^^^^^^^^^
  | |
  | help: must be of the form: `#[export_name = "name"]`

Rationale and extra context

The "expected this to be of form" and "must be of the form" are just saying the same thing twice
@rustbot claim
cc @jdonszelmann

Other cases

Rust Version

cargo 1.89.0-nightly (2251525ae 2025-06-16)
release: 1.89.0-nightly
commit-hash: 2251525ae503fa196f6d7f9ce6d32eccb2d5f044
commit-date: 2025-06-16
host: x86_64-unknown-linux-gnu
libgit2: 1.9.0 (sys:0.20.2 vendored)
libcurl: 8.12.1-DEV (sys:0.4.80+curl-8.12.1 vendored ssl:OpenSSL/3.5.0)
ssl: OpenSSL 3.5.0 8 Apr 2025
os: Arch Linux Rolling Release [64-bit]

Anything else?

No response

Activity

  1. added
    A-diagnostics
    T-compiler
    on Jun 28, 2025
  2. added 2 commits that reference this issue on Jun 29, 2025
    febd5fc
    9b6b2a9
  3. added a commit that references this issue on Jul 1, 2025
  4. added a commit that references this issue on Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

A-diagnosticsT-compiler

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions