-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Duplicate extern crate
in doc tests (2021-11-21 Nightly Regression)
#91134
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
Labels
C-bug
Category: This is a bug.
regression-from-stable-to-nightly
Performance or correctness regression from stable to nightly.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Comments
Oh, I think I got misled by the "rustdoc" bit. |
I can't reproduce this. I tried /// ```
/// extern crate inner;
/// ```
pub trait Trait {
type Item;
} and running |
The following seems like a minimal reproduction when used with 2015: /// ```
/// extern crate mycrate;
/// mycrate::foo();
/// ```
pub fn foo() {} Bisected to #91026. |
cc @notriddle , I think it might make sense to revert #91026 temporarily unless you already have an idea for a fix. |
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Nov 23, 2021
…emicolon, r=jyn514 fix(doctest): detect extern crate items in statement doctests This partially reverts rust-lang#91026, because rustdoc needs to detect the extern statements, even when they appear inside implicit `main()`. It does not entirely revert it, so the old bug is still fixed, by duplicating some of the logic from `parse_mod` instead of trying to use it directly. Fixes rust-lang#91134
HeroicKatora
added a commit
to HeroicKatora/image
that referenced
this issue
Nov 25, 2021
Strictly speaking this is motivated by a nightly compile failure. Tracked at: (rust-lang/rust#91134). However, it is no longer the style in Rust 2018 and not in 2021 either so it's better to remove it from the newbie targeted resources.
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-from-stable-to-nightly
Performance or correctness regression from stable to nightly.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
We have a Rust-2015 doc test which has an
extern crate $CRATE_DOC_TEST_IS_IN
which started failing to build on nightly 2021-11-21 (but passes on stable/2021-11-20).It now fails with
The text was updated successfully, but these errors were encountered: