-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect outer #![derive(Debug)]
emits too many errors
#67107
Comments
A slightly bigger problem with this issue is that compiler emits an error for every custom attribute in the crate if the bad attribute ends up being on the root of the crate: #![forbif(unused)]
// ^^^^^^ note the typo
use serde::Serialize;
#[derive(Serialize)]
pub struct Foo {
#[serde(rename = "bar")]
foo: i32,
#[serde(rename = "quux")]
baz: i32,
} For this example compiler emits a total of 4 errors - first the one about the typo, and then one of each of |
…trochenkov Suppress unhelpful diagnostics for unresolved top level attributes Fixes rust-lang#118455, unresolved top level attribute error didn't imported prelude and already have emitted an error, report builtin macro and attributes error by the way, so `check_invalid_crate_level_attr` in can ignore them. Also fixes rust-lang#89566, fixes rust-lang#67107. r? `@petrochenkov`
…trochenkov Suppress unhelpful diagnostics for unresolved top level attributes Fixes rust-lang#118455, unresolved top level attribute error didn't imported prelude and already have emitted an error, report builtin macro and attributes error by the way, so `check_invalid_crate_level_attr` in can ignore them. Also fixes rust-lang#89566, fixes rust-lang#67107. r? ``@petrochenkov``
…trochenkov Suppress unhelpful diagnostics for unresolved top level attributes Fixes rust-lang#118455, unresolved top level attribute error didn't imported prelude and already have emitted an error, report builtin macro and attributes error by the way, so `check_invalid_crate_level_attr` in can ignore them. Also fixes rust-lang#89566, fixes rust-lang#67107. r? ```@petrochenkov```
…ochenkov Suppress unhelpful diagnostics for unresolved top level attributes Fixes rust-lang#118455, unresolved top level attribute error didn't imported prelude and already have emitted an error, report builtin macro and attributes error by the way, so `check_invalid_crate_level_attr` in can ignore them. Also fixes rust-lang#89566, fixes rust-lang#67107. r? `@petrochenkov`
Rollup merge of rust-lang#118533 - chenyukang:yukang-fix-118455, r=petrochenkov Suppress unhelpful diagnostics for unresolved top level attributes Fixes rust-lang#118455, unresolved top level attribute error didn't imported prelude and already have emitted an error, report builtin macro and attributes error by the way, so `check_invalid_crate_level_attr` in can ignore them. Also fixes rust-lang#89566, fixes rust-lang#67107. r? `@petrochenkov`
The following incorrect code:
generates the following output:
We should not emit the second value, given it could detect that the following element is an ADT it could internally treat it as
#[derive(Debug)]
so that no knock-down errors will happen.The text was updated successfully, but these errors were encountered: