Skip to content

Commit cd874a6

Browse files
committed
---
yaml --- r: 141039 b: refs/heads/try2 c: e02716e h: refs/heads/master i: 141037: 2e82393 141035: 8da1ae6 141031: 76d20d2 141023: 1fd0bb8 v: v3
1 parent bf9b51d commit cd874a6

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: ebdb0dee272829f2410edd51acdb12f20721ce42
8+
refs/heads/try2: e02716e6d3a65bde24f49207274a74a22790a201
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/metadata/encoder.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,10 @@ fn encode_reexported_static_methods(ecx: @EncodeContext,
386386
match ecx.tcx.trait_methods_cache.find(&exp.def_id) {
387387
Some(methods) => {
388388
match ecx.tcx.items.find(&exp.def_id.node) {
389-
Some(&ast_map::node_item(_, path)) => {
390-
if mod_path != *path {
389+
Some(&ast_map::node_item(item, path)) => {
390+
let interner = ecx.tcx.sess.parse_sess.interner;
391+
let original_name = ecx.tcx.sess.str_of(item.ident);
392+
if mod_path != *path || *exp.name != *original_name {
391393
for methods.each |&m| {
392394
if m.explicit_self == ast::sty_static {
393395
encode_reexported_static_method(ecx,

branches/try2/src/test/auxiliary/mod_trait_with_static_methods_lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
// except according to those terms.
1010

1111
pub use sub_foo::Foo;
12+
pub use Baz = self::Bar;
13+
14+
pub trait Bar {
15+
pub fn bar() -> Self;
16+
}
17+
18+
impl Bar for int {
19+
pub fn bar() -> int { 84 }
20+
}
1221

1322
pub mod sub_foo {
1423
pub trait Foo {
@@ -18,4 +27,5 @@ pub mod sub_foo {
1827
impl Foo for int {
1928
pub fn foo() -> int { 42 }
2029
}
30+
2131
}

branches/try2/src/test/run-pass/trait_with_static_methods_cross_crate.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
extern mod mod_trait_with_static_methods_lib;
1414

1515
use mod_trait_with_static_methods_lib::Foo;
16+
use mod_trait_with_static_methods_lib::Baz;
1617

1718
pub fn main() {
1819
assert_eq!(42, Foo::foo());
20+
assert_eq!(84, Baz::bar());
1921
}

0 commit comments

Comments
 (0)