-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Fix rendering of reexported macros 2.0 and fix visibility of reexported items #86841
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
bors
merged 7 commits into
rust-lang:master
from
GuillaumeGomez:reexported-macro-2-render
Jul 12, 2021
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d1ad40e
Fix rendering of reexported macros 2.0
GuillaumeGomez c70250d
Add test for reexported macros 2.0 rendering
GuillaumeGomez 84f259e
Unify macro source display
GuillaumeGomez e948e8d
Fix reexports visibility
GuillaumeGomez cc09326
Fix inconsistency on visibility display for typedefs
GuillaumeGomez e7bc2a0
Add tests for reexports (both public and private)
GuillaumeGomez 74d71c2
Only show restricted pub use
GuillaumeGomez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#![feature(decl_macro)] | ||
|
||
pub macro addr_of($place:expr) { | ||
&raw const $place | ||
} | ||
|
||
pub macro addr_of_self($place:expr) { | ||
&raw const $place | ||
} | ||
|
||
pub macro addr_of_crate($place:expr) { | ||
&raw const $place | ||
} | ||
|
||
pub struct Foo; | ||
pub struct FooSelf; | ||
pub struct FooCrate; | ||
|
||
pub enum Bar { Foo, } | ||
pub enum BarSelf { Foo, } | ||
pub enum BarCrate { Foo, } | ||
|
||
pub fn foo() {} | ||
pub fn foo_self() {} | ||
pub fn foo_crate() {} | ||
|
||
pub type Type = i32; | ||
pub type TypeSelf = i32; | ||
pub type TypeCrate = i32; | ||
|
||
pub union Union { | ||
a: i8, | ||
b: i8, | ||
} | ||
pub union UnionSelf { | ||
a: i8, | ||
b: i8, | ||
} | ||
pub union UnionCrate { | ||
a: i8, | ||
b: i8, | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// aux-build: reexports.rs | ||
// compile-flags: --document-private-items | ||
|
||
#![crate_name = "foo"] | ||
|
||
extern crate reexports; | ||
|
||
// @has 'foo/macro.addr_of.html' '//*[@class="docblock type-decl"]' 'pub macro addr_of($place : expr) {' | ||
pub use reexports::addr_of; | ||
// @has 'foo/macro.addr_of_crate.html' '//*[@class="docblock type-decl"]' 'pub(crate) macro addr_of_crate($place : expr) {' | ||
pub(crate) use reexports::addr_of_crate; | ||
// @has 'foo/macro.addr_of_self.html' '//*[@class="docblock type-decl"]' 'pub(crate) macro addr_of_self($place : expr) {' | ||
GuillaumeGomez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
pub(self) use reexports::addr_of_self; | ||
|
||
// @has 'foo/struct.Foo.html' '//*[@class="docblock type-decl"]' 'pub struct Foo;' | ||
pub use reexports::Foo; | ||
// @has 'foo/struct.FooCrate.html' '//*[@class="docblock type-decl"]' 'pub(crate) struct FooCrate;' | ||
pub(crate) use reexports::FooCrate; | ||
// @has 'foo/struct.FooSelf.html' '//*[@class="docblock type-decl"]' 'pub(crate) struct FooSelf;' | ||
pub(self) use reexports::FooSelf; | ||
|
||
// @has 'foo/enum.Bar.html' '//*[@class="docblock type-decl"]' 'pub enum Bar {' | ||
pub use reexports::Bar; | ||
// @has 'foo/enum.BarCrate.html' '//*[@class="docblock type-decl"]' 'pub(crate) enum BarCrate {' | ||
pub(crate) use reexports::BarCrate; | ||
// @has 'foo/enum.BarSelf.html' '//*[@class="docblock type-decl"]' 'pub(crate) enum BarSelf {' | ||
pub(self) use reexports::BarSelf; | ||
|
||
// @has 'foo/fn.foo.html' '//*[@class="rust fn"]' 'pub fn foo()' | ||
pub use reexports::foo; | ||
// @has 'foo/fn.foo_crate.html' '//*[@class="rust fn"]' 'pub(crate) fn foo_crate()' | ||
pub(crate) use reexports::foo_crate; | ||
// @has 'foo/fn.foo_self.html' '//*[@class="rust fn"]' 'pub(crate) fn foo_self()' | ||
pub(self) use reexports::foo_self; | ||
|
||
// @has 'foo/type.Type.html' '//*[@class="rust typedef"]' 'pub type Type =' | ||
pub use reexports::Type; | ||
// @has 'foo/type.TypeCrate.html' '//*[@class="rust typedef"]' 'pub(crate) type TypeCrate =' | ||
pub(crate) use reexports::TypeCrate; | ||
// @has 'foo/type.TypeSelf.html' '//*[@class="rust typedef"]' 'pub(crate) type TypeSelf =' | ||
pub(self) use reexports::TypeSelf; | ||
|
||
// @has 'foo/union.Union.html' '//*[@class="docblock type-decl"]' 'pub union Union {' | ||
pub use reexports::Union; | ||
// @has 'foo/union.UnionCrate.html' '//*[@class="docblock type-decl"]' 'pub(crate) union UnionCrate {' | ||
pub(crate) use reexports::UnionCrate; | ||
// @has 'foo/union.UnionSelf.html' '//*[@class="docblock type-decl"]' 'pub(crate) union UnionSelf {' | ||
pub(self) use reexports::UnionSelf; | ||
|
||
pub mod foo { | ||
// @!has 'foo/foo/union.Union.html' | ||
use crate::reexports::Union; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// aux-build: reexports.rs | ||
|
||
#![crate_name = "foo"] | ||
|
||
extern crate reexports; | ||
|
||
// @has 'foo/macro.addr_of.html' '//*[@class="docblock type-decl"]' 'pub macro addr_of($place : expr) {' | ||
pub use reexports::addr_of; | ||
// @!has 'foo/macro.addr_of_crate.html' | ||
pub(crate) use reexports::addr_of_crate; | ||
// @!has 'foo/macro.addr_of_self.html' | ||
pub(self) use reexports::addr_of_self; | ||
|
||
// @has 'foo/struct.Foo.html' '//*[@class="docblock type-decl"]' 'pub struct Foo;' | ||
pub use reexports::Foo; | ||
// @!has 'foo/struct.FooCrate.html' | ||
pub(crate) use reexports::FooCrate; | ||
// @!has 'foo/struct.FooSelf.html' | ||
pub(self) use reexports::FooSelf; | ||
|
||
// @has 'foo/enum.Bar.html' '//*[@class="docblock type-decl"]' 'pub enum Bar {' | ||
pub use reexports::Bar; | ||
// @!has 'foo/enum.BarCrate.html' | ||
pub(crate) use reexports::BarCrate; | ||
// @!has 'foo/enum.BarSelf.html' | ||
pub(self) use reexports::BarSelf; | ||
|
||
// @has 'foo/fn.foo.html' '//*[@class="rust fn"]' 'pub fn foo()' | ||
pub use reexports::foo; | ||
// @!has 'foo/fn.foo_crate.html' | ||
pub(crate) use reexports::foo_crate; | ||
// @!has 'foo/fn.foo_self.html' | ||
pub(self) use reexports::foo_self; | ||
|
||
// @has 'foo/type.Type.html' '//*[@class="rust typedef"]' 'pub type Type =' | ||
pub use reexports::Type; | ||
// @!has 'foo/type.TypeCrate.html' | ||
pub(crate) use reexports::TypeCrate; | ||
// @!has 'foo/type.TypeSelf.html' | ||
pub(self) use reexports::TypeSelf; | ||
|
||
// @has 'foo/union.Union.html' '//*[@class="docblock type-decl"]' 'pub union Union {' | ||
pub use reexports::Union; | ||
// @!has 'foo/union.UnionCrate.html' | ||
pub(crate) use reexports::UnionCrate; | ||
// @!has 'foo/union.UnionSelf.html' | ||
pub(self) use reexports::UnionSelf; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.