From da1f7731f6cebcf8b8a896c65b38e19b102e19c4 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Wed, 3 Aug 2016 12:55:01 +1200 Subject: [PATCH] rustdoc: remove the `!` from macro URLs and titles --- src/librustdoc/clean/mod.rs | 8 +++++--- src/test/rustdoc/issue-26606.rs | 2 +- src/test/rustdoc/macros.rs | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 75d21399f05..39b1a04e98e 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -2803,7 +2803,7 @@ pub struct Macro { impl Clean for doctree::Macro { fn clean(&self, cx: &DocContext) -> Item { - let name = format!("{}!", self.name.clean(cx)); + let name = self.name.clean(cx); Item { name: Some(name.clone()), attrs: self.attrs.clean(cx), @@ -2814,8 +2814,10 @@ impl Clean for doctree::Macro { def_id: cx.map.local_def_id(self.id), inner: MacroItem(Macro { source: format!("macro_rules! {} {{\n{}}}", - name.trim_right_matches('!'), self.matchers.iter().map(|span| - format!(" {} => {{ ... }};\n", span.to_src(cx))).collect::()), + name, + self.matchers.iter().map(|span| { + format!(" {} => {{ ... }};\n", span.to_src(cx)) + }).collect::()), imported_from: self.imported_from.clean(cx), }), } diff --git a/src/test/rustdoc/issue-26606.rs b/src/test/rustdoc/issue-26606.rs index df40c01686d..12de7665451 100644 --- a/src/test/rustdoc/issue-26606.rs +++ b/src/test/rustdoc/issue-26606.rs @@ -12,7 +12,7 @@ // ignore-cross-compile // build-aux-docs -// @has issue_26606_macro/macro.make_item!.html +// @has issue_26606_macro/macro.make_item.html #[macro_use] extern crate issue_26606_macro; diff --git a/src/test/rustdoc/macros.rs b/src/test/rustdoc/macros.rs index b052ad2da2f..f4115d8229a 100644 --- a/src/test/rustdoc/macros.rs +++ b/src/test/rustdoc/macros.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // 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 '($a:tt) => { ... };' // @has - //pre '($e:expr) => { ... };'