Skip to content

1.99 beta crater regression: "expected item after attributes" #162352

Closed as duplicate

Description

@theemathas

This regression was found by the 1.99 crater --release mode run.

[INFO] [stdout] Couldn't compile the test.
[INFO] [stdout] ---- src/lib.rs - YoshiBacktrace::new_captured (line 2609) stdout ----
[INFO] [stdout] error: expected item after attributes
[INFO] [stdout]     --> src/lib.rs:2610:1
[INFO] [stdout]      |
[INFO] [stdout] 2610 | #[cfg(feature = "std")] {
[INFO] [stdout]      | ^^^^^^^^^^^^^^^^^^^^^^^ expected an item after this
[INFO] [stdout] 
[INFO] [stdout] error: aborting due to 1 previous error
[INFO] [stdout] 
[INFO] [stdout] Couldn't compile the test.

https://crater-reports.s3.amazonaws.com/beta-release-1.99-3/1.99.0-beta.1%2Bcargoflags=--release/reg/yoshi-std-0.1.5/log.txt (note that this crate has two failures, the other one is #162349)

Relevant code: https://docs.rs/crate/yoshi-std/0.1.5/source/src/lib.rs#2609-2614

Activity

  1. added
    regression-from-stable-to-beta
    C-bug
    E-needs-bisection
    E-needs-mcve
    on Sep 6, 2026
  2. added
    needs-triage
    I-prioritize
    on Sep 6, 2026
  3. kpreid commented on Sep 6, 2026

    @kpreid
    Contributor

    The code in this case has a typoed last line of documentation:

        /// # }    /// ```
    

    This is, inside of a doctest, a closing brace, followed by a doc comment, without anything for the doc comment to attach to. So, if this test used to pass, it did so erroneously, perhaps by the doc comment attaching to some item appended to the doctest. #162349 appears to also have such a situation.

  4. maxdexh commented on Sep 6, 2026

    @maxdexh
    Member

    It does work on stable though. Using --test-builder-wrapper:

    Code:

    /// ```
    /// #[cfg(true)] {
    /// }    /// ```
    pub fn wtf() {}

    Input to rustc on stable:

    #![allow(unused)]
    fn main() { #[allow(non_snake_case)] fn _doctest_main_src_lib_rs_1_0() {
    #[cfg(true)] {
    }
    } _doctest_main_src_lib_rs_1_0() }

    Input to rustc on beta:

    #[cfg(true)] {
    }    /// ```
    
  5. removed
    needs-triage
    on Sep 6, 2026
  6. added a commit that references this issue on Sep 7, 2026
  7. added a commit that references this issue on Sep 7, 2026
  8. removed
    I-prioritize
    on Sep 28, 2026
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

    C-bugE-needs-bisectionE-needs-mcveregression-from-stable-to-beta

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions