]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #6880 : thomaslee/rust/issue-6745, r=catamorphism
authorbors <bors@rust-lang.org>
Sat, 1 Jun 2013 22:46:40 +0000 (15:46 -0700)
committerbors <bors@rust-lang.org>
Sat, 1 Jun 2013 22:46:40 +0000 (15:46 -0700)
This fixes #6745, which itself relates to #4202. Slightly ham-fisted -- feel particularly funny about using the typeck phase to gather the base -> impl mapping, and the separate code paths for traits vs. "real" bases feels like it could be avoided -- but it seems to work.

As always, open to suggestions if there's a better way to accomplish what I'm trying to do.

@catamorphism r?

1  2 
src/librustc/middle/ty.rs
src/librustc/middle/typeck/coherence.rs

Simple merge
index 00454d658489bec5301e3a95920090b8c011b565,01260a097d754cec46c9a7fe2155e29cbe371957..9d25430d80b72dc1de529a4dad5876ecc51220c4
@@@ -434,9 -433,11 +435,11 @@@ impl CoherenceChecker 
          }
  
          implementation_list.push(implementation);
+         ty::add_base_impl(self.crate_context.tcx, base_def_id, implementation);
      }
  
 -    fn add_trait_method(&self, trait_id: def_id, implementation: @Impl) {
 +    pub fn add_trait_method(&self, trait_id: def_id, implementation: @Impl) {
          let implementation_list;
          match self.crate_context.coherence_info.extension_methods
                    .find(&trait_id) {