提交 7ca94369 编写于 作者: B Brian Anderson

Fix encoding of trait static method paths. Closes #4097. r=pcwalton

上级 e71ec061
......@@ -768,6 +768,7 @@ fn add_to_index_(item: @item, 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 add_to_index_(item: @item, 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();
}
......
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
// 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);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册