Skip to content

Can't ignore soft destabilization of rustc-serialize with #![allow(soft_unstable)] #123156

Closed

Description

@pitdicker

In chrono we have support for rustc-serialize behind a feature flag.

As a workaround for #116016 I added the line:

#![cfg_attr(feature = "rustc-serialize", allow(deprecated), allow(soft_unstable))]

It now gives a new error:

error[E0658]: use of unstable library feature 'libstd_sys_internals': used by the panic! macro
  --> src/weekday.rs:33:64
   |
33 | #[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))]
   |                                                                ^^^^^^^^^^^^^^
   |
   = help: add `#![feature(libstd_sys_internals)]` to the crate attributes to enable
   = note: this compiler was built on 2024-03-27; consider upgrading it if it is out of date
   = note: this error originates in the derive macro `RustcDecodable` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: use of unstable library feature 'libstd_sys_internals': used by the panic! macro
  --> src/month.rs:32:64
   |
32 | #[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))]
   |                                                                ^^^^^^^^^^^^^^
   |
   = help: add `#![feature(libstd_sys_internals)]` to the crate attributes to enable
   = note: this compiler was built on 2024-03-27; consider upgrading it if it is out of date
   = note: this error originates in the derive macro `RustcDecodable` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0658`.
error: could not compile `chrono` (lib) due to 2 previous errors; 4 warnings emitted

cc @jhpratt

Activity

  1. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Mar 28, 2024
  2. changed the title [-]Can't ignore soft destabilization of `rustc-serialize` with `#![feature(libstd_sys_internals)]`[/-] [+]Can't ignore soft destabilization of `rustc-serialize` with `#![allow(soft_unstable)]`[/+] on Mar 28, 2024
  3. pitdicker commented on Mar 28, 2024

    @pitdicker
    ContributorAuthor

    The derived Decodable implementation for an enum is using ::std::rt::begin_panic. Manually implementing Decodable and using unreachable!() is a workaround.

  4. apiraino commented on Mar 28, 2024

    @apiraino
    Contributor

    WG-prioritization assigning priority (Zulip discussion).

    @rustbot label -I-prioritize +P-critical

  5. added and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Mar 28, 2024
  6. ehuss commented on Mar 28, 2024

    @ehuss
    Contributor
  7. added
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Mar 28, 2024
  8. jhpratt commented on Mar 28, 2024

    @jhpratt
    Member

    I'm actually not sure this is a T-libs issue. I suspect it's related to #[allow_internal_unstable], but I haven't had a chance to look into it yet.

  9. added and removed
    regression-untriagedUntriaged performance or correctness regression.
    on Mar 28, 2024
  10. jhpratt commented on Mar 29, 2024

    @jhpratt
    Member

    I have confirmed this is an issue with the expansion of RustcDecodable on enums and aim to have a PR up tonight. As RustcEncodable is a built-in macro, it is technically in T-compiler land, I believe.

    @rustbot claim

  11. jhpratt commented on Mar 29, 2024

    @jhpratt
    Member

    PR is up, including a regression test: #123182

  12. added
    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    and removed
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    on Mar 29, 2024
  13. added a commit that references this issue on Apr 3, 2024
    e41d7e7
  14. added a commit that references this issue on Apr 3, 2024
    1682440
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.P-criticalCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions