Skip to content

Commit da1f773

Browse files
committed
rustdoc: remove the ! from macro URLs and titles
1 parent aef6971 commit da1f773

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/librustdoc/clean/mod.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -2803,7 +2803,7 @@ pub struct Macro {
28032803

28042804
impl Clean<Item> for doctree::Macro {
28052805
fn clean(&self, cx: &DocContext) -> Item {
2806-
let name = format!("{}!", self.name.clean(cx));
2806+
let name = self.name.clean(cx);
28072807
Item {
28082808
name: Some(name.clone()),
28092809
attrs: self.attrs.clean(cx),
@@ -2814,8 +2814,10 @@ impl Clean<Item> for doctree::Macro {
28142814
def_id: cx.map.local_def_id(self.id),
28152815
inner: MacroItem(Macro {
28162816
source: format!("macro_rules! {} {{\n{}}}",
2817-
name.trim_right_matches('!'), self.matchers.iter().map(|span|
2818-
format!(" {} => {{ ... }};\n", span.to_src(cx))).collect::<String>()),
2817+
name,
2818+
self.matchers.iter().map(|span| {
2819+
format!(" {} => {{ ... }};\n", span.to_src(cx))
2820+
}).collect::<String>()),
28192821
imported_from: self.imported_from.clean(cx),
28202822
}),
28212823
}

src/test/rustdoc/issue-26606.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// ignore-cross-compile
1313
// build-aux-docs
1414

15-
// @has issue_26606_macro/macro.make_item!.html
15+
// @has issue_26606_macro/macro.make_item.html
1616
#[macro_use]
1717
extern crate issue_26606_macro;
1818

src/test/rustdoc/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// @has macros/macro.my_macro!.html //pre 'macro_rules! my_macro {'
11+
// @has macros/macro.my_macro.html //pre 'macro_rules! my_macro {'
1212
// @has - //pre '() => { ... };'
1313
// @has - //pre '($a:tt) => { ... };'
1414
// @has - //pre '($e:expr) => { ... };'

0 commit comments

Comments
 (0)