Skip to content

Commit

Permalink
Explain an odd conditional check.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaslee committed May 20, 2013
1 parent cac97d7 commit e3a91f6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/librustc/metadata/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,17 @@ fn encode_reexported_static_methods(ecx: @EncodeContext,
match ecx.tcx.items.find(&exp.def_id.node) {
Some(&ast_map::node_item(item, path)) => {
let original_name = ecx.tcx.sess.str_of(item.ident);

//
// We don't need to reexport static methods on traits
// declared in the same module as our `pub use ...` since
// that's done when we encode the trait item.
//
// The only exception is when the reexport *changes* the
// name e.g. `pub use Foo = self::Bar` -- we have
// encoded metadata for static methods relative to Bar,
// but not yet for Foo.
//
if mod_path != *path || *exp.name != *original_name {
for methods.each |&m| {
if m.explicit_self == ast::sty_static {
Expand Down

5 comments on commit e3a91f6

@bors
Copy link
Contributor

@bors bors commented on e3a91f6 May 20, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from catamorphism
at thomaslee@e3a91f6

@bors
Copy link
Contributor

@bors bors commented on e3a91f6 May 20, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging thomaslee/rust/issue-4202-02 = e3a91f6 into auto

@bors
Copy link
Contributor

@bors bors commented on e3a91f6 May 20, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thomaslee/rust/issue-4202-02 = e3a91f6 merged ok, testing candidate = 7396f7f

@bors
Copy link
Contributor

@bors bors commented on e3a91f6 May 20, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on e3a91f6 May 20, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding incoming to auto = 7396f7f

Please sign in to comment.