Skip to content

Fix macro_rules! duplication when reexported in the same module #89867

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

Merged
merged 6 commits into from
Oct 19, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Rework the equivalent test to work with sidebar-items.js
  • Loading branch information
Urgau committed Oct 15, 2021
commit db5b64a484dbea09f1f39e0640662b50c6e934cd
6 changes: 3 additions & 3 deletions src/test/rustdoc/issue-89852.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
#![no_core]
#![feature(no_core)]

// @count issue_89852/index.html '//*[@class="macro"]' 2
// @has - '//*[@class="macro"]/@href' 'macro.repro.html'
// @matches 'issue_89852/sidebar-items.js' '"repro"'
// @!matches 'issue_89852/sidebar-items.js' '"repro".*"repro"'
Comment on lines +6 to +7
Copy link
Member

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?

Copy link
Member Author

@Urgau Urgau Oct 15, 2021

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.

Copy link
Member

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.

Copy link
Member

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)

Copy link
Member Author

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.

Copy link
Member

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... :-/


#[macro_export]
macro_rules! repro {
() => {};
}

// @!has issue_89852/macro.repro.html '//*[@class="macro"]/@content' 'repro2'
pub use crate::repro as repro2;