rustdoc: remove the !
from macro URLs and titles
This commit is contained in:
parent
aef6971ca9
commit
da1f7731f6
3 changed files with 7 additions and 5 deletions
|
@ -2803,7 +2803,7 @@ pub struct Macro {
|
||||||
|
|
||||||
impl Clean<Item> for doctree::Macro {
|
impl Clean<Item> for doctree::Macro {
|
||||||
fn clean(&self, cx: &DocContext) -> Item {
|
fn clean(&self, cx: &DocContext) -> Item {
|
||||||
let name = format!("{}!", self.name.clean(cx));
|
let name = self.name.clean(cx);
|
||||||
Item {
|
Item {
|
||||||
name: Some(name.clone()),
|
name: Some(name.clone()),
|
||||||
attrs: self.attrs.clean(cx),
|
attrs: self.attrs.clean(cx),
|
||||||
|
@ -2814,8 +2814,10 @@ impl Clean<Item> for doctree::Macro {
|
||||||
def_id: cx.map.local_def_id(self.id),
|
def_id: cx.map.local_def_id(self.id),
|
||||||
inner: MacroItem(Macro {
|
inner: MacroItem(Macro {
|
||||||
source: format!("macro_rules! {} {{\n{}}}",
|
source: format!("macro_rules! {} {{\n{}}}",
|
||||||
name.trim_right_matches('!'), self.matchers.iter().map(|span|
|
name,
|
||||||
format!(" {} => {{ ... }};\n", span.to_src(cx))).collect::<String>()),
|
self.matchers.iter().map(|span| {
|
||||||
|
format!(" {} => {{ ... }};\n", span.to_src(cx))
|
||||||
|
}).collect::<String>()),
|
||||||
imported_from: self.imported_from.clean(cx),
|
imported_from: self.imported_from.clean(cx),
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// ignore-cross-compile
|
// ignore-cross-compile
|
||||||
// build-aux-docs
|
// build-aux-docs
|
||||||
|
|
||||||
// @has issue_26606_macro/macro.make_item!.html
|
// @has issue_26606_macro/macro.make_item.html
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate issue_26606_macro;
|
extern crate issue_26606_macro;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// @has macros/macro.my_macro!.html //pre 'macro_rules! my_macro {'
|
// @has macros/macro.my_macro.html //pre 'macro_rules! my_macro {'
|
||||||
// @has - //pre '() => { ... };'
|
// @has - //pre '() => { ... };'
|
||||||
// @has - //pre '($a:tt) => { ... };'
|
// @has - //pre '($a:tt) => { ... };'
|
||||||
// @has - //pre '($e:expr) => { ... };'
|
// @has - //pre '($e:expr) => { ... };'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue