Skip to content

Commit

Permalink
Fix rustdoc after changing type param representation.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Apr 6, 2018
1 parent 7466740 commit 4c4f9b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/librustdoc/clean/auto_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
P(hir::Path {
span: DUMMY_SP,
def: Def::TyParam(param.def_id),
segments: HirVec::from_vec(vec![hir::PathSegment::from_name(param.name)]),
segments: HirVec::from_vec(vec![
hir::PathSegment::from_name(Symbol::intern(&param.name))
]),
}),
)),
span: DUMMY_SP,
Expand Down
10 changes: 8 additions & 2 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use syntax::codemap::Spanned;
use syntax::feature_gate::UnstableFeatures;
use syntax::ptr::P;
use syntax::symbol::keywords;
use syntax::symbol::Symbol;
use syntax::symbol::{Symbol, InternedString};
use syntax_pos::{self, DUMMY_SP, Pos, FileName};

use rustc::middle::const_val::ConstVal;
Expand Down Expand Up @@ -1794,7 +1794,7 @@ impl<'a, 'tcx> Clean<Generics> for (&'a ty::Generics,
// predicates field (see rustc_typeck::collect::ty_generics), so remove
// them.
let stripped_typarams = gens.types.iter().filter_map(|tp| {
if tp.name == keywords::SelfType.name() {
if tp.name == keywords::SelfType.name().as_str() {
assert_eq!(tp.index, 0);
None
} else {
Expand Down Expand Up @@ -3374,6 +3374,12 @@ impl Clean<String> for ast::Name {
}
}

impl Clean<String> for InternedString {
fn clean(&self, _: &DocContext) -> String {
self.to_string()
}
}

#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
pub struct Typedef {
pub type_: Type,
Expand Down

0 comments on commit 4c4f9b9

Please sign in to comment.