<!-- Thank you for filing a regression report! 🐛 A regression is something that changed between versions of Rust but was not supposed to. Please provide a short summary of the regression, along with any information you feel is relevant to replicate it. --> ### Code When updating the clippy lints in Smithay I found that one of the doc tests no longer compiles in CI: https://github.com/Smithay/smithay/runs/7139965884?check_suite_focus=true A minimal example also reproduces this: I tried this code and ran `cargo test`: ```rust /// ``` /// println!("{}", rule_of_life!()); /// ``` macro_rules! rule_of_life { () => { 42usize }; } ``` I expected to see this happen: Test completes successfully. Instead, this happened: ``` running 1 test test src/lib.rs - rule_of_life (line 3) ... FAILED failures: ---- src/lib.rs - rule_of_life (line 3) stdout ---- error: cannot find macro `rule_of_life` in this scope --> src/lib.rs:4:16 | 3 | println!("{}", rule_of_life!()); | ^^^^^^^^^^^^ error: aborting due to previous error Couldn't compile the test. ``` ### Version it worked on <!-- Provide the most recent version this worked on, for example: It most recently worked on: Rust 1.47 --> It most recently worked on: Rust 1.61.0 ### Version with regression <!-- Provide the version you are using that has the regression. --> `rustc --version --verbose`: ``` rustc 1.62.0 (a8314ef7d 2022-06-27) binary: rustc commit-hash: a8314ef7d0ec7b75c336af2c9857bfaf43002bfc commit-date: 2022-06-27 host: x86_64-unknown-linux-gnu release: 1.62.0 LLVM version: 14.0.5 ``` <!-- If you know when this regression occurred, please add a line like below, replacing `{channel}` with one of stable, beta, or nightly. @rustbot modify labels: +regression-from-stable-to-{channel} -regression-untriaged -->
Activity
steffahn commentedon Jun 30, 2022
This doc test used to be not executed at all. This is an intentional change, however it's unfortunately missing in the release notes. See #98735.
jyn514 commentedon Jul 1, 2022
This is a duplicate.
Rollup merge of rust-lang#98749 - CAD97:patch-3, r=jyn514