Skip to content

Commit

Permalink
Rollup merge of rust-lang#86886 - jyn514:no-clean-symbol, r=Guillaume…
Browse files Browse the repository at this point in the history
…Gomez

Remove `impl Clean for {Ident, Symbol}`

These were only used once, in a place where it was trivial to replace.
Also, it's unclear what 'clean' would mean for these, so it seems better
to be explicit.

Found while reviewing rust-lang#86841, which makes the same change to `build_macro`, so the two will conflict.

r? `@GuillaumeGomez`
  • Loading branch information
JohnTitor authored Jul 5, 2021
2 parents 973f208 + 6f931da commit 952deae
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion src/librustdoc/clean/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ fn build_macro(cx: &mut DocContext<'_>, did: DefId, name: Symbol) -> clean::Item

let source = format!(
"macro_rules! {} {{\n{}}}",
name.clean(cx),
name,
utils::render_macro_arms(matchers, ";")
);

Expand Down
14 changes: 0 additions & 14 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1814,20 +1814,6 @@ impl Clean<PathSegment> for hir::PathSegment<'_> {
}
}

impl Clean<String> for Ident {
#[inline]
fn clean(&self, cx: &mut DocContext<'_>) -> String {
self.name.clean(cx)
}
}

impl Clean<String> for Symbol {
#[inline]
fn clean(&self, _: &mut DocContext<'_>) -> String {
self.to_string()
}
}

impl Clean<BareFunctionDecl> for hir::BareFnTy<'_> {
fn clean(&self, cx: &mut DocContext<'_>) -> BareFunctionDecl {
let (generic_params, decl) = enter_impl_trait(cx, |cx| {
Expand Down

0 comments on commit 952deae

Please sign in to comment.