Skip to content

#[diagnostic] attribute name space is experimental #128317

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wthrajat opened this issue Jul 28, 2024 · 4 comments
Closed

#[diagnostic] attribute name space is experimental #128317

wthrajat opened this issue Jul 28, 2024 · 4 comments
Labels
C-discussion Category: Discussion or questions that doesn't represent real issues.

Comments

@wthrajat
Copy link

wthrajat commented Jul 28, 2024

On compiling the latest version of serde, we get the following error:

$ cargo +nightly build

   Compiling serde v1.0.204
error[E0658]: `#[diagnostic]` attribute name space is experimental
   --> /home/rajat/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.204/src/de/mod.rs:537:5
    |
537 |     diagnostic::on_unimplemented(
    |     ^^^^^^^^^^
    |
    = note: see issue #111996 <https://github.com/rust-lang/rust/issues/111996> for more information
    = help: add `#![feature(diagnostic_namespace)]` to the crate attributes to enable
    = note: this compiler was built on 2024-02-18; consider upgrading it if it is out of date

error[E0658]: `#[diagnostic]` attribute name space is experimental
   --> /home/rajat/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.204/src/ser/mod.rs:220:5
    |
220 |     diagnostic::on_unimplemented(
    |     ^^^^^^^^^^
    |
    = note: see issue #111996 <https://github.com/rust-lang/rust/issues/111996> for more information
    = help: add `#![feature(diagnostic_namespace)]` to the crate attributes to enable
    = note: this compiler was built on 2024-02-18; consider upgrading it if it is out of date

For more information about this error, try `rustc --explain E0658`.
The following warnings were emitted during compilation:

warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag

error: could not compile `serde` (lib) due to 2 previous errors

Reason being the not(no_diagnostic_namespace) part:

/// [Implementing `Serialize`]: https://serde.rs/impl-serialize.html
/// [`LinkedHashMap<K, V>`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html
/// [`linked-hash-map`]: https://crates.io/crates/linked-hash-map
/// [`serde_derive`]: https://crates.io/crates/serde_derive
/// [derive section of the manual]: https://serde.rs/derive.html
#[cfg_attr(
    not(no_diagnostic_namespace),
    diagnostic::on_unimplemented(
        note = "for local types consider adding `#[derive(serde::Serialize)]` to your `{Self}` type",
        note = "for types from other crates check whether the crate offers a `serde` feature flag",
    )
)]

The tracking issue #111996 has been closed.
Thanks.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 28, 2024
@ChayimFriedman2
Copy link
Contributor

Are you using an outdated nightly? the feature was stabilized.

@Noratrieb
Copy link
Member

this compiler was built on 2024-02-18

yes this is indeed an ancient nightly, you need to update it.

@Noratrieb Noratrieb closed this as not planned Won't fix, can't repro, duplicate, stale Jul 28, 2024
@Noratrieb Noratrieb added C-discussion Category: Discussion or questions that doesn't represent real issues. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jul 28, 2024
@ArhanChaudhary
Copy link

I'm running into this issue but due to other optimization concerns I can't upgrade my old nightly version.

@Noratrieb
Copy link
Member

Noratrieb commented Jul 31, 2024

there isn't anything we can do here, old nightlies don't have new features

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-discussion Category: Discussion or questions that doesn't represent real issues.
Projects
None yet
Development

No branches or pull requests

5 participants