提交 27747ac1 编写于 作者: E Eduard Burtescu

Revert bogus rename from DefTrait to DefaultImpl.

上级 dccdde40
......@@ -357,7 +357,7 @@ fn item_to_def_like(item: rbml::Doc, did: ast::DefId, cnum: ast::CrateNum)
let enum_did = item_reqd_and_translated_parent_item(cnum, item);
DlDef(def::DefVariant(enum_did, did, false))
}
Trait => DlDef(def::DefaultImpl(did)),
Trait => DlDef(def::DefTrait(did)),
Enum => DlDef(def::DefTy(did, true)),
Impl | DefaultImpl => DlImpl(did),
PublicField | InheritedField => DlField,
......
......@@ -440,7 +440,7 @@ fn tr(&self, dcx: &DecodeContext) -> def::Def {
def::DefVariant(e_did, v_did, is_s) => {
def::DefVariant(e_did.tr(dcx), v_did.tr(dcx), is_s)
},
def::DefaultImpl(did) => def::DefaultImpl(did.tr(dcx)),
def::DefTrait(did) => def::DefTrait(did.tr(dcx)),
def::DefTy(did, is_enum) => def::DefTy(did.tr(dcx), is_enum),
def::DefAssociatedTy(did) => def::DefAssociatedTy(did.tr(dcx)),
def::DefAssociatedPath(def::TyParamProvenance::FromSelf(did), ident) =>
......
......@@ -38,7 +38,7 @@ pub enum Def {
// type `U` (indicated by the Ident).
// FIXME(#20301) -- should use Name
DefAssociatedPath(TyParamProvenance, ast::Ident),
DefaultImpl(ast::DefId),
DefTrait(ast::DefId),
DefPrimTy(ast::PrimTy),
DefTyParam(ParamSpace, u32, ast::DefId, ast::Name),
DefUse(ast::DefId),
......@@ -135,7 +135,7 @@ pub fn def_id(&self) -> ast::DefId {
DefFn(id, _) | DefStaticMethod(id, _) | DefMod(id) |
DefForeignMod(id) | DefStatic(id, _) |
DefVariant(_, id, _) | DefTy(id, _) | DefAssociatedTy(id) |
DefTyParam(_, _, id, _) | DefUse(id) | DefStruct(id) | DefaultImpl(id) |
DefTyParam(_, _, id, _) | DefUse(id) | DefStruct(id) | DefTrait(id) |
DefMethod(id, _, _) | DefConst(id) |
DefAssociatedPath(TyParamProvenance::FromSelf(id), _) |
DefAssociatedPath(TyParamProvenance::FromParam(id), _) => {
......
......@@ -579,7 +579,7 @@ pub fn cat_def(&self,
Ok(self.cat_rvalue_node(id, span, expr_ty))
}
def::DefMod(_) | def::DefForeignMod(_) | def::DefUse(_) |
def::DefaultImpl(_) | def::DefTy(..) | def::DefPrimTy(_) |
def::DefTrait(_) | def::DefTy(..) | def::DefPrimTy(_) |
def::DefTyParam(..) | def::DefTyParamBinder(..) | def::DefRegion(_) |
def::DefLabel(_) | def::DefSelfTy(..) |
def::DefAssociatedTy(..) | def::DefAssociatedPath(..)=> {
......
......@@ -169,7 +169,7 @@ fn visit_ty(&mut self, ty: &ast::Ty) {
// if this path references a trait, then this will resolve to
// a trait ref, which introduces a binding scope.
match self.def_map.borrow().get(&id) {
Some(&def::DefaultImpl(..)) => {
Some(&def::DefTrait(..)) => {
self.with(LateScope(&Vec::new(), self.scope), |_, this| {
this.visit_path(path, id);
});
......
......@@ -802,7 +802,7 @@ fn check_path(&mut self, span: Span, path_id: ast::NodeId, path: &ast::Path) {
def::DefVariant(..) => ck("variant"),
def::DefTy(_, false) => ck("type"),
def::DefTy(_, true) => ck("enum"),
def::DefaultImpl(..) => ck("trait"),
def::DefTrait(..) => ck("trait"),
def::DefStruct(..) => ck("struct"),
def::DefMethod(_, Some(..), _) => ck("trait method"),
def::DefMethod(..) => ck("method"),
......
......@@ -736,7 +736,7 @@ fn build_reduced_graph_for_item(&mut self, item: &Item, parent: &Rc<Module>) ->
self.trait_item_map.insert((name, def_id), kind);
}
name_bindings.define_type(DefaultImpl(def_id), sp, modifiers);
name_bindings.define_type(DefTrait(def_id), sp, modifiers);
parent.clone()
}
ItemMac(..) => parent.clone()
......@@ -918,7 +918,7 @@ fn handle_external_def(&mut self,
}
child_name_bindings.define_value(def, DUMMY_SP, modifiers);
}
DefaultImpl(def_id) => {
DefTrait(def_id) => {
debug!("(building reduced graph for external \
crate) building type {}", final_ident);
......
......@@ -2989,7 +2989,7 @@ fn resolve_item(&mut self, item: &Item) {
// check for imports shadowing primitive types
if let ast::ViewPathSimple(ident, _) = view_path.node {
match self.def_map.borrow().get(&item.id) {
Some(&DefTy(..)) | Some(&DefStruct(..)) | Some(&DefaultImpl(..)) | None => {
Some(&DefTy(..)) | Some(&DefStruct(..)) | Some(&DefTrait(..)) | None => {
self.check_if_primitive_type_name(ident.name, item.span);
}
_ => {}
......@@ -3199,7 +3199,7 @@ fn resolve_trait_reference(&mut self,
}
Some(def) => {
match def {
(DefaultImpl(_), _) => {
(DefTrait(_), _) => {
debug!("(resolving trait) found trait def: {:?}", def);
self.record_def(trait_reference.ref_id, def);
}
......@@ -4675,7 +4675,7 @@ fn add_trait_info(found_traits: &mut Vec<DefId>,
None => continue
};
let trait_def_id = match def {
DefaultImpl(trait_def_id) => trait_def_id,
DefTrait(trait_def_id) => trait_def_id,
_ => continue,
};
if self.trait_item_map.contains_key(&(name, trait_def_id)) {
......@@ -4691,7 +4691,7 @@ fn add_trait_info(found_traits: &mut Vec<DefId>,
Some(target) => target,
};
let did = match target.bindings.def_for_namespace(TypeNS) {
Some(DefaultImpl(trait_def_id)) => trait_def_id,
Some(DefTrait(trait_def_id)) => trait_def_id,
Some(..) | None => continue,
};
if self.trait_item_map.contains_key(&(name, did)) {
......
......@@ -239,7 +239,7 @@ fn lookup_def_kind(&self, ref_id: NodeId, span: Span) -> Option<recorder::Row> {
def::DefTy(..) |
def::DefAssociatedTy(..) |
def::DefAssociatedPath(..) |
def::DefaultImpl(_) => Some(recorder::TypeRef),
def::DefTrait(_) => Some(recorder::TypeRef),
def::DefStatic(_, _) |
def::DefConst(_) |
def::DefLocal(_) |
......
......@@ -207,7 +207,7 @@ fn trans_def<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
def::DefUpvar(..) => {
datum_callee(bcx, ref_expr)
}
def::DefMod(..) | def::DefForeignMod(..) | def::DefaultImpl(..) |
def::DefMod(..) | def::DefForeignMod(..) | def::DefTrait(..) |
def::DefTy(..) | def::DefPrimTy(..) | def::DefAssociatedTy(..) |
def::DefUse(..) | def::DefTyParamBinder(..) |
def::DefRegion(..) | def::DefLabel(..) | def::DefTyParam(..) |
......
......@@ -600,7 +600,7 @@ pub fn instantiate_trait_ref<'tcx>(
-> Rc<ty::TraitRef<'tcx>>
{
match ::lookup_def_tcx(this.tcx(), ast_trait_ref.path.span, ast_trait_ref.ref_id) {
def::DefaultImpl(trait_def_id) => {
def::DefTrait(trait_def_id) => {
let trait_ref = ast_path_to_trait_ref(this,
rscope,
trait_def_id,
......@@ -914,7 +914,7 @@ fn ast_ty_to_trait_ref<'tcx>(this: &AstConv<'tcx>,
match ty.node {
ast::TyPath(ref path, id) => {
match this.tcx().def_map.borrow().get(&id) {
Some(&def::DefaultImpl(trait_def_id)) => {
Some(&def::DefTrait(trait_def_id)) => {
let mut projection_bounds = Vec::new();
let trait_ref = object_path_to_poly_trait_ref(this,
rscope,
......@@ -1194,7 +1194,7 @@ pub fn ast_ty_to_ty<'tcx>(this: &AstConv<'tcx>,
Some(&d) => d
};
match a_def {
def::DefaultImpl(trait_def_id) => {
def::DefTrait(trait_def_id) => {
// N.B. this case overlaps somewhat with
// TyObjectSum, see that fn for details
let mut projection_bounds = Vec::new();
......@@ -1804,7 +1804,7 @@ pub fn partition_bounds<'a>(tcx: &ty::ctxt,
match *ast_bound {
ast::TraitTyParamBound(ref b, ast::TraitBoundModifier::None) => {
match ::lookup_def_tcx(tcx, b.trait_ref.path.span, b.trait_ref.ref_id) {
def::DefaultImpl(trait_did) => {
def::DefTrait(trait_did) => {
match trait_def_ids.get(&trait_did) {
// Already seen this trait. We forbid
// duplicates in the list (for some
......
......@@ -435,7 +435,7 @@ pub fn check_pat_struct<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>, pat: &'tcx ast::Pat,
let def = tcx.def_map.borrow()[pat.id].clone();
let (enum_def_id, variant_def_id) = match def {
def::DefaultImpl(_) => {
def::DefTrait(_) => {
let name = pprust::path_to_string(path);
span_err!(tcx.sess, pat.span, E0168,
"use of trait `{}` in a struct pattern", name);
......
......@@ -330,7 +330,7 @@ fn handle_external_def(traits: &mut AllTraitsVec,
cstore: &cstore::CStore,
dl: decoder::DefLike) {
match dl {
decoder::DlDef(def::DefaultImpl(did)) => {
decoder::DlDef(def::DefTrait(did)) => {
traits.push(TraitInfo::new(did));
}
decoder::DlDef(def::DefMod(did)) => {
......
......@@ -3862,7 +3862,7 @@ fn check_struct_fields_on_error<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
variant_id, &fields[..]);
enum_id
}
Some(def::DefaultImpl(def_id)) => {
Some(def::DefTrait(def_id)) => {
span_err!(tcx.sess, path.span, E0159,
"use of trait `{}` as a struct constructor",
pprust::path_to_string(path));
......@@ -4634,7 +4634,7 @@ fn type_scheme_and_predicates_for_def<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
def::DefStruct(id) | def::DefConst(id) => {
(ty::lookup_item_type(fcx.tcx(), id), ty::lookup_predicates(fcx.tcx(), id))
}
def::DefaultImpl(_) |
def::DefTrait(_) |
def::DefTy(..) |
def::DefAssociatedTy(..) |
def::DefAssociatedPath(..) |
......@@ -4738,7 +4738,7 @@ pub fn instantiate_path<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
def::DefTy(..) |
def::DefAssociatedTy(..) |
def::DefAssociatedPath(..) |
def::DefaultImpl(..) |
def::DefTrait(..) |
def::DefPrimTy(..) |
def::DefTyParam(..) => {
// Everything but the final segment should have no
......
......@@ -69,7 +69,7 @@ fn try_inline_def(cx: &DocContext, tcx: &ty::ctxt,
let mut ret = Vec::new();
let did = def.def_id();
let inner = match def {
def::DefaultImpl(did) => {
def::DefTrait(did) => {
record_extern_fqn(cx, did, clean::TypeTrait);
clean::TraitItem(build_external_trait(cx, tcx, did))
}
......
......@@ -2430,7 +2430,7 @@ fn register_def(cx: &DocContext, def: def::Def) -> ast::DefId {
def::DefFn(i, _) => (i, TypeFunction),
def::DefTy(i, false) => (i, TypeTypedef),
def::DefTy(i, true) => (i, TypeEnum),
def::DefaultImpl(i) => (i, TypeTrait),
def::DefTrait(i) => (i, TypeTrait),
def::DefStruct(i) => (i, TypeStruct),
def::DefMod(i) => (i, TypeModule),
def::DefStatic(i, _) => (i, TypeStatic),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册