diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs index 6000c20ba1b..01755a79f2e 100644 --- a/src/librustc/metadata/encoder.rs +++ b/src/librustc/metadata/encoder.rs @@ -768,6 +768,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: writer::Serializer, for traits.each |associated_trait| { encode_trait_ref(ebml_w, ecx, *associated_trait) } + ebml_w.end_tag(); // Now, output all of the static methods as items. Note that for the @@ -789,7 +790,9 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: writer::Serializer, let polyty = ecx.tcx.tcache.get(local_def(ty_m.id)); encode_ty_type_param_bounds(ebml_w, ecx, polyty.bounds); encode_type(ecx, ebml_w, polyty.ty); - encode_path(ecx, ebml_w, path, ast_map::path_name(ty_m.ident)); + let m_path = vec::append_one(path, + ast_map::path_name(item.ident)); + encode_path(ecx, ebml_w, m_path, ast_map::path_name(ty_m.ident)); ebml_w.end_tag(); } diff --git a/src/test/auxiliary/static_fn_trait_xc_aux.rs b/src/test/auxiliary/static_fn_trait_xc_aux.rs new file mode 100644 index 00000000000..e67d46553cf --- /dev/null +++ b/src/test/auxiliary/static_fn_trait_xc_aux.rs @@ -0,0 +1,11 @@ +pub mod num { + pub trait Num2 { + static pure fn from_int2(n: int) -> self; + } +} + +pub mod float { + impl float: num::Num2 { + static pure fn from_int2(n: int) -> float { return n as float; } + } +} \ No newline at end of file diff --git a/src/test/run-pass/static-fn-trait-xc.rs b/src/test/run-pass/static-fn-trait-xc.rs new file mode 100644 index 00000000000..d2bd9b2f5c8 --- /dev/null +++ b/src/test/run-pass/static-fn-trait-xc.rs @@ -0,0 +1,9 @@ +// aux-build:static_fn_trait_xc_aux.rs + +extern mod mycore(name ="static_fn_trait_xc_aux"); + +use mycore::num; + +fn main() { + let _1:float = num::from_int2(1i); +}