Skip to content

Commit

Permalink
rustc: Allow external structs to be constructed. Closes rust-lang#3012.
Browse files Browse the repository at this point in the history
Embarrassing.
  • Loading branch information
pcwalton committed Aug 16, 2012
1 parent ee2f0dd commit bf0d4cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rustc/middle/resolve3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,8 @@ class Resolver {
if has_constructor {
child_name_bindings.define_value(def, dummy_sp());
}

self.structs.insert(def_id, has_constructor);
}
def_self(*) | def_arg(*) | def_local(*) |
def_prim_ty(*) | def_ty_param(*) | def_binding(*) |
Expand Down Expand Up @@ -4409,7 +4411,7 @@ class Resolver {
// let bar = Bar { ... } // no type parameters

match self.resolve_path(path, TypeNS, false, visitor) {
some(def_ty(class_id))
some(def_ty(class_id)) | some(def_class(class_id, _))
if self.structs.contains_key(class_id) => {
let has_constructor = self.structs.get(class_id);
let class_def = def_class(class_id, has_constructor);
Expand Down

0 comments on commit bf0d4cc

Please sign in to comment.