+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_diagnostics_macros): correctly ignore unknown attributes #3433

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

leops
Copy link
Contributor

@leops leops commented Oct 17, 2022

Summary

The Rust Compiler already has a mechanism in place to emit an error when an unknown attribute is used in the code, so the procedural macro should simply ignore attributes it doesn't known about. Not only does this prevent a duplicate diagnostic from being emitted, but it's also important to allow attributes from the language (such as the #[doc = ""] attribute that doc-comments desugar to) or other proc-macros on types that derive Diagnostic

Test Plan

The "unknown attribute" case is already covered but the test suite of the macro, the snapshot has been updated to ensure that only one diagnostic is emitted by the compiler.

@leops leops requested a review from a team October 17, 2022 08:01
@leops leops temporarily deployed to netlify-playground October 17, 2022 08:01 Inactive
@netlify
Copy link

netlify bot commented Oct 17, 2022

Deploy Preview for rometools canceled.

Name Link
🔨 Latest commit 5bfb02f
🔍 Latest deploy log https://app.netlify.com/sites/rometools/deploys/634d0bf0effcc3000907d97a

@github-actions
Copy link

@leops leops merged commit 23a0e2b into main Oct 17, 2022
@leops leops deleted the fix/diagnostic-unknown-attribute branch October 17, 2022 08:21
@leops leops added A-Diagnostic Area: errors and diagnostics A-Tooling Area: our own build, development, and release tooling labels Oct 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Diagnostic Area: errors and diagnostics A-Tooling Area: our own build, development, and release tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载