Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Rustdoc macro visibility regression #98743

Closed
i509VCB opened this issue Jun 30, 2022 · 2 comments
Closed

Rustdoc macro visibility regression #98743

i509VCB opened this issue Jun 30, 2022 · 2 comments
Labels
C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression.

Comments

@i509VCB
Copy link
Contributor

i509VCB commented Jun 30, 2022

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:

/// ```
/// 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

It most recently worked on: Rust 1.61.0

Version with 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
@i509VCB i509VCB added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Jun 30, 2022
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jun 30, 2022
@steffahn
Copy link
Member

steffahn commented 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
Copy link
Member

jyn514 commented Jul 1, 2022

This is a duplicate.

@jyn514 jyn514 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 1, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 1, 2022
Add macro_rules! rustdoc change to 1.62 relnotes

rust-lang#96630 was tagged <kbd>relnotes</kbd> but didn't make it into the notes. Given this is a compatibility issue (rust-lang#97030, rust-lang#98735, rust-lang#98743), it probably *should* be retroactively added.
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression.
Projects
None yet
Development

No branches or pull requests

5 participants