@@ -1192,7 +1192,7 @@ impl Resolver {
11921192 visit_item ( item, new_parent, visitor) ;
11931193 }
11941194
1195- item_impl( _, trait_ref_opt, ty, methods ) => {
1195+ item_impl( _, trait_ref_opt, ty, methods_opt ) => {
11961196 // If this implements an anonymous trait and it has static
11971197 // methods, then add all the static methods within to a new
11981198 // module, if the type was defined within this module.
@@ -1203,10 +1203,12 @@ impl Resolver {
12031203
12041204 // Bail out early if there are no static methods.
12051205 let mut has_static_methods = false ;
1206- for methods. each |method| {
1207- match method. self_ty . node {
1208- sty_static => has_static_methods = true ,
1209- _ => { }
1206+ for methods_opt. each |methods| {
1207+ for methods. each |method| {
1208+ match method. self_ty . node {
1209+ sty_static => has_static_methods = true ,
1210+ _ => { }
1211+ }
12101212 }
12111213 }
12121214
@@ -1233,22 +1235,26 @@ impl Resolver {
12331235 name_bindings. get_module ( ) ) ;
12341236
12351237 // For each static method...
1236- for methods. each |method| {
1237- match method. self_ty . node {
1238- sty_static => {
1239- // Add the static method to the module.
1240- let ident = method. ident ;
1241- let ( method_name_bindings, _) =
1242- self . add_child ( ident,
1243- new_parent,
1244- ForbidDuplicateValues ,
1245- method. span ) ;
1246- let def = def_fn ( local_def ( method. id ) ,
1247- method. purity ) ;
1248- method_name_bindings. define_value (
1249- Public , def, method. span ) ;
1238+ for methods_opt. each |methods| {
1239+ for methods. each |method| {
1240+ match method. self_ty . node {
1241+ sty_static => {
1242+ // Add the static method to the
1243+ // module.
1244+ let ident = method. ident ;
1245+ let ( method_name_bindings, _) =
1246+ self . add_child (
1247+ ident,
1248+ new_parent,
1249+ ForbidDuplicateValues ,
1250+ method. span ) ;
1251+ let def = def_fn ( local_def ( method. id ) ,
1252+ method. purity ) ;
1253+ method_name_bindings. define_value (
1254+ Public , def, method. span ) ;
1255+ }
1256+ _ => { }
12501257 }
1251- _ => { }
12521258 }
12531259 }
12541260 }
@@ -3446,12 +3452,14 @@ impl Resolver {
34463452 }
34473453
34483454 item_impl( type_parameters, implemented_traits, self_type,
3449- methods ) => {
3450-
3451- self . resolve_implementation ( item . id , item. span,
3455+ methods_opt ) => {
3456+ self . resolve_implementation ( item . id ,
3457+ item. span,
34523458 type_parameters,
34533459 implemented_traits,
3454- self_type, methods, visitor) ;
3460+ self_type,
3461+ methods_opt,
3462+ visitor) ;
34553463 }
34563464
34573465 item_trait( type_parameters, traits, methods) => {
@@ -3876,7 +3884,7 @@ impl Resolver {
38763884 type_parameters: ~[ ty_param] ,
38773885 opt_trait_reference: Option < @trait_ref > ,
38783886 self_type: @Ty ,
3879- methods : ~[ @method] ,
3887+ opt_methods : Option < ~[ @method ] > ,
38803888 visitor: ResolveVisitor ) {
38813889 // If applicable, create a rib for the type parameters.
38823890 let outer_type_parameter_count = type_parameters. len( ) ;
@@ -3915,27 +3923,33 @@ impl Resolver {
39153923 // Resolve the self type.
39163924 self . resolve_type( self_type, visitor) ;
39173925
3918- for methods. each |method| {
3919- // We also need a new scope for the method-specific
3920- // type parameters.
3921- self . resolve_method( MethodRibKind ( id, Provided ( method. id) ) ,
3922- * method,
3923- outer_type_parameter_count,
3924- visitor) ;
3926+ for opt_methods. each |methods| {
3927+ for methods. each |method| {
3928+ // We also need a new scope for the method-specific
3929+ // type parameters.
3930+ self . resolve_method( MethodRibKind (
3931+ id,
3932+ Provided ( method. id) ) ,
3933+ * method,
3934+ outer_type_parameter_count,
3935+ visitor) ;
39253936/*
3926- let borrowed_type_parameters = &method.tps;
3927- self.resolve_function(MethodRibKind(id, Provided(method.id)),
3928- Some(@method.decl),
3929- HasTypeParameters
3930- (borrowed_type_parameters,
3931- method.id,
3932- outer_type_parameter_count,
3933- NormalRibKind),
3934- method.body,
3935- HasSelfBinding(method.self_id),
3936- NoCaptureClause,
3937- visitor);
3937+ let borrowed_type_parameters = &method.tps;
3938+ self.resolve_function(MethodRibKind(
3939+ id,
3940+ Provided(method.id)),
3941+ Some(@method.decl),
3942+ HasTypeParameters
3943+ (borrowed_type_parameters,
3944+ method.id,
3945+ outer_type_parameter_count,
3946+ NormalRibKind),
3947+ method.body,
3948+ HasSelfBinding(method.self_id),
3949+ NoCaptureClause,
3950+ visitor);
39383951*/
3952+ }
39393953 }
39403954
39413955 // Restore the original trait references.
0 commit comments