Skip to content

regression: doctest no longer supports derive? #132204

Closed as not planned
Closed as not planned

Activity

  1. added
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    on Oct 26, 2024
  2. added this to the 1.83.0 milestone on Oct 26, 2024
  3. 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 Oct 26, 2024
  4. Urgau commented on Oct 26, 2024

    @Urgau
    Member

    This is expected, the (kind-of new) warn-by-default non_local_definitions lint is rightfully triggered here, the derive should put it's things under an unnamed const. However the crate also use #![deny(warnings)] so it unfortunately breaks, nothing we can do about that.

    The lint is already in the language section of relnotes.

    Different issue, looks like an issue with the arguments passed to the doctest executable. Reminds me of #131095.

  5. Mark-Simulacrum commented on Oct 27, 2024

    @Mark-Simulacrum
    MemberAuthor

    Is this serde's derive? Has that already been fixed on newer versions of serde?

  6. saethlin commented on Oct 27, 2024

    @saethlin
    Member

    Is this serde's derive? Has that already been fixed on newer versions of serde?

    Yes and yes. The crate that's failing here is locked to serde 1.0.99 which was released in 2019, and it expands to this:

    const _IMPL_DESERIALIZE_FOR_Point: () = {
        #[allow(unknown_lints)]
        #[allow(rust_2018_idioms)]
        extern crate serde as _serde;
        #[automatically_derived]
        impl<'de> _serde::Deserialize<'de> for Point {
    

    Starting in serde 1.0.113 (released in 2020) the Derive macro expands to an unnamed const:

    const _: () = {
        #[allow(rust_2018_idioms, clippy::useless_attribute)]
        extern crate serde as _serde;
        #[automatically_derived]
        impl<'de> _serde::Deserialize<'de> for Point {
    

    Since the fix has been out for 4 years and has been a cargo update away the whole time, I don't think there's any action needed here.

  7. removed
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 27, 2024
  8. saethlin commented on Oct 27, 2024

    @saethlin
    Member

    If someone wants an MCVE:

    #[derive(serde::Deserialize)]
    struct Point {}
    [package]
    name = "scratch"
    version = "0.1.0"
    edition = "2021"
    
    [dependencies]
    serde = { version = "=1.0.200", features = ["derive"] }
  9. removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 27, 2024
  10. apiraino commented on Dec 11, 2024

    @apiraino
    Contributor

    Visiting this issue again. By reading the previous comment I think we can close this as "not as issue / accepted change".

    (thanks for the triaging)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions