Skip to content

Add c_buffer_length diagnostic attribute - #162565

Open
JohnTitor wants to merge 1 commit into
rust-lang:mainfrom
JohnTitor:diagnostic-c-buffer-length
Open

JohnTitor wants to merge 1 commit into
rust-lang:mainfrom
JohnTitor:diagnostic-c-buffer-length

Conversation

@JohnTitor

Copy link
Copy Markdown
Member

An initianl implementation for #148664
Tracking issue: #162563
r? estebank

@rustbot

rustbot commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred in compiler/rustc_attr_ir

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred to diagnostic attributes.

cc @mejrs

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 9, 2026
@mejrs

mejrs commented Sep 10, 2026

Copy link
Copy Markdown
Member

This is quite different from what all other diagnostic attributes do (they customize errors that would get emitted regardless) - this is a lint helper.

I'm not opposed to it, but please get a confirmation from the lang team that they're OK with moving the diagnostic namespace in this direction. See #t-lang > extending the diagnostic namespace for prior discussion.

@JohnTitor

Copy link
Copy Markdown
Member Author

Ah, sorry about that. Opened a topic here: https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/Extend.20the.20diagnostics.20attr.20for.20a.20lint.20helper/with/623001975


This is for a future lint described in [#148664](https://github.com/rust-lang/rust/issues/148664).

<!-- FIXME(JohnTitor): descirbe more once a lint is implemented. -->

@estebank estebank Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@estebank estebank left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks reasonable, r=me after t-lang input.

View changes since this review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

4 participants