-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix macro_rules! duplication when reexported in the same module #89867
Conversation
This can append if within the same module a `#[macro_export] macro_rules!` is declared but also a reexport of itself producing two export of the same macro in the same module. In that case we only want to document it once.
r? @ollie27 (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
// @matches 'issue_89852/sidebar-items.js' '"repro"' | ||
// @!matches 'issue_89852/sidebar-items.js' '"repro".*"repro"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't repro2
be showing up in the sidebar as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, but this would be a pre-existing issue that my PR does not try to solve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you use count instead to ensure there is only 1 repro
? I'm really not a big fan of negative checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, but this would be a pre-existing issue that my PR does not try to solve.
Hmm, I wonder if they are related issues though: #89852 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you use count instead to ensure there is only 1
repro
? I'm really not a big fan of negative checks.
Unfortunately no because it's a javascript and XPath doesn't work on them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it'll be enough for now then. It would have been much simpler to check using rustdoc-gui though... :-/
@bors: r+ |
📌 Commit db5b64a has been approved by |
Rust 1.56.0 stable release This PR bumps 1.56.0 to the stable channel. This also includes a backport for: * Latest changes to the release notes * rust-lang#89867 r? `@ghost` cc `@rust-lang/release`
…laumeGomez Fix macro_rules! duplication when reexported in the same module This can append if within the same module a `#[macro_export] macro_rules!` is declared but also a reexport of itself producing two export of the same macro in the same module. In that case we only want to document it once. Before: ``` Module { is_crate: true, items: [ Id("0:4"), // pub use crate::repro as repro2; Id("0:3"), // macro_rules! repro Id("0:3"), // duplicate, same as above ], } ``` After: ``` Module { is_crate: true, items: [ Id("0:4"), // pub use crate::repro as repro2; Id("0:3"), // macro_rules! repro ], } ``` Fixes rust-lang#89852
…askrgr Rollup of 8 pull requests Successful merges: - rust-lang#89766 (RustWrapper: adapt for an LLVM API change) - rust-lang#89867 (Fix macro_rules! duplication when reexported in the same module) - rust-lang#89941 (removing TLS support in x86_64-unknown-none-hermitkernel) - rust-lang#89956 (Suggest a case insensitive match name regardless of levenshtein distance) - rust-lang#89988 (Do not promote values with const drop that need to be dropped) - rust-lang#89997 (Add test for issue rust-lang#84957 - `str.as_bytes()` in a `const` expression) - rust-lang#90002 (:arrow_up: rust-analyzer) - rust-lang#90034 (Tiny tweak to Iterator::unzip() doc comment example.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…ulacrum [beta] backports * Don't emit a warning for empty rmeta files. rust-lang#90072 * Erase late-bound regions before computing vtable debuginfo name. rust-lang#90050 * Fix wrong niche calculation when 2+ niches are placed at the start rust-lang#90040 * Revert rust-lang#86011 to fix an incorrect bound check rust-lang#90025 * Fix macro_rules! duplication when reexported in the same module rust-lang#89867 * Bump cargo to include rust-lang/cargo#9979 - Fix fetching git repos after a force push. r? `@Mark-Simulacrum`
This can append if within the same module a
#[macro_export] macro_rules!
is declared but also a reexport of itself producing two export of the same
macro in the same module. In that case we only want to document it once.
Before:
After:
Fixes #89852