Auto merge of #49695 - michaelwoerister:unhygienic-ty-min, r=nikomatsakis
Use InternedString instead of Symbol for type parameter types (2) Reduced alternative to #49266. Let's see if this causes a performance regression.
This commit is contained in:
commit
88ebd97d65
16 changed files with 52 additions and 35 deletions
|
|
@ -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(¶m.name))
|
||||
]),
|
||||
}),
|
||||
)),
|
||||
span: DUMMY_SP,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ use syntax::codemap::{dummy_spanned, 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;
|
||||
|
|
@ -1787,7 +1787,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 {
|
||||
|
|
@ -3367,6 +3367,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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue