forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#40814 - abonander:issue_39436, r=jseyfried
Rustdoc: memoize `pub use`-reexported macros so they don't appear twice in docs Closes rust-lang#39436 Preserves existing behavior for `#[macro_reexport]`. `pub use`'d macros are shown as reexports unless inlined, and also correctly obey `#[doc(hidden)]`. r? @jseyfried cc @SergioBenitez
- Loading branch information
Showing
3 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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 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,30 @@ | ||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
#![crate_name="macros"] | ||
|
||
#[macro_export] | ||
macro_rules! foo { | ||
() => {}; | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! bar { | ||
() => {}; | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! baz { | ||
() => {}; | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! quux { | ||
() => {}; | ||
} |
This file contains 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,31 @@ | ||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// aux-build:pub-use-extern-macros.rs | ||
|
||
#![feature(use_extern_macros, macro_reexport)] | ||
|
||
// @has pub_use_extern_macros/macro.foo.html | ||
// @!has pub_use_extern_macros/index.html 'pub use macros::foo;' | ||
#[macro_reexport(foo)] extern crate macros; | ||
|
||
// @has pub_use_extern_macros/index.html 'pub use macros::bar;' | ||
// @!has pub_use_extern_macros/macro.bar.html | ||
pub use macros::bar; | ||
|
||
// @has pub_use_extern_macros/macro.baz.html | ||
// @!has pub_use_extern_macros/index.html 'pub use macros::baz;' | ||
#[doc(inline)] | ||
pub use macros::baz; | ||
|
||
// @!has pub_use_extern_macros/macro.quux.html | ||
// @!has pub_use_extern_macros/index.html 'pub use macros::quux;' | ||
#[doc(hidden)] | ||
pub use macros::quux; |