sp);
name_bindings.define_type
- (DefTy(local_def(item.id)), sp, is_public);
+ (DefTy(local_def(item.id), false), sp, is_public);
parent
}
sp);
name_bindings.define_type
- (DefTy(local_def(item.id)), sp, is_public);
+ (DefTy(local_def(item.id), true), sp, is_public);
for variant in (*enum_definition).variants.iter() {
self.build_reduced_graph_for_variant(
let name_bindings = self.add_child(ident, parent.clone(), forbid, sp);
// Define a name in the type namespace.
- name_bindings.define_type(DefTy(local_def(item.id)), sp, is_public);
+ name_bindings.define_type(DefTy(local_def(item.id), false), sp, is_public);
// If this is a newtype or unit-like struct, define a name
// in the value namespace as well
match def {
DefMod(def_id) | DefForeignMod(def_id) | DefStruct(def_id) |
- DefTy(def_id) => {
+ DefTy(def_id, _) => {
let type_def = child_name_bindings.type_def.borrow().clone();
match type_def {
Some(TypeNsDef { module_def: Some(module_def), .. }) => {
is_public,
DUMMY_SP)
}
- DefTy(_) => {
+ DefTy(..) => {
debug!("(building reduced graph for external \
crate) building type {}", final_ident);
import_span: Span,
name: Name,
namespace: Namespace) {
- if self.session.features.import_shadowing.get() {
+ if self.session.features.borrow().import_shadowing {
return
}
&mut ImportResolution,
import_span: Span,
name: Name) {
- if self.session.features.import_shadowing.get() {
+ if self.session.features.borrow().import_shadowing {
return
}
module: &Module,
name: Name,
span: Span) {
- if self.session.features.import_shadowing.get() {
+ if self.session.features.borrow().import_shadowing {
return
}
module: &Module,
name: Name,
span: Span) {
- if self.session.features.import_shadowing.get() {
+ if self.session.features.borrow().import_shadowing {
return
}
// If it's a typedef, give a note
match def {
- DefTy(_) => {
+ DefTy(..) => {
self.session.span_note(
trait_reference.path.span,
format!("`type` aliases cannot \
Some(ref t) => match t.node {
TyPath(ref path, None, path_id) => {
match this.resolve_path(id, path, TypeNS, true) {
- Some((DefTy(def_id), lp)) if this.structs.contains_key(&def_id) => {
+ Some((DefTy(def_id, _), lp)) if this.structs.contains_key(&def_id) => {
let def = DefStruct(def_id);
debug!("(resolving struct) resolved `{}` to type {:?}",
token::get_ident(path.segments
if allowed == Everything {
// Look for a field with the same name in the current self_type.
match self.def_map.borrow().find(&node_id) {
- Some(&DefTy(did))
+ Some(&DefTy(did, _))
| Some(&DefStruct(did))
| Some(&DefVariant(_, did, _)) => match self.structs.find(&did) {
None => {}
// structs, which wouldn't result in this error.)
match self.with_no_errors(|this|
this.resolve_path(expr.id, path, TypeNS, false)) {
- Some((DefTy(struct_id), _))
+ Some((DefTy(struct_id, _), _))
if self.structs.contains_key(&struct_id) => {
self.resolve_error(expr.span,
format!("`{}` is a structure name, but \
}
if supplied_ty_param_count > required_ty_param_count
- && !this.tcx().sess.features.default_type_params.get() {
+ && !this.tcx().sess.features.borrow().default_type_params {
span_err!(this.tcx().sess, path.span, E0108,
"default type parameters are experimental and possibly buggy");
span_note!(this.tcx().sess, path.span,
// FIXME(#12938): This is a hack until we have full support for
// DST.
match a_def {
- def::DefTy(did) | def::DefStruct(did)
+ def::DefTy(did, _) | def::DefStruct(did)
if Some(did) == this.tcx().lang_items.owned_box() => {
if path.segments
.iter()
"not enough type parameters supplied to `Box<T>`");
Some(ty::mk_err())
}
- def::DefTy(did) | def::DefStruct(did)
+ def::DefTy(did, _) | def::DefStruct(did)
if Some(did) == this.tcx().lang_items.gc() => {
if path.segments
.iter()
result.substs.clone(),
bounds)
}
- def::DefTy(did) | def::DefStruct(did) => {
+ def::DefTy(did, _) | def::DefStruct(did) => {
ast_path_to_ty(this, rscope, did, path).ty
}
def::DefTyParam(space, id, n) => {