Skip to content

Commit 0774f5c

Browse files
committed
---
yaml --- r: 89028 b: refs/heads/snap-stage3 c: a5d9762 h: refs/heads/master v: v3
1 parent ce0931c commit 0774f5c

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: deeca5d586bfaa4aa60246f671a8d611d38f6248
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: d9c87c7a2374dbdc5d5662af8548e95bbb616584
4+
refs/heads/snap-stage3: a5d976297285ad837e5c7e3a4ce5e9d01d3848c5
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/typeck/check/method.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ use middle::typeck::check::regionmanip::replace_bound_regions_in_fn_sig;
9595
use util::common::indenter;
9696
use util::ppaux::Repr;
9797

98+
use std::cell::RefCell;
9899
use std::hashmap::HashSet;
99100
use std::result;
100101
use std::vec;
@@ -132,7 +133,7 @@ pub fn lookup(
132133
check_traits: CheckTraitsFlag, // Whether we check traits only.
133134
autoderef_receiver: AutoderefReceiverFlag)
134135
-> Option<method_map_entry> {
135-
let impl_dups = @mut HashSet::new();
136+
let impl_dups = @RefCell::new(HashSet::new());
136137
let lcx = LookupContext {
137138
fcx: fcx,
138139
expr: expr,
@@ -174,7 +175,7 @@ pub struct LookupContext<'a> {
174175
callee_id: NodeId,
175176
m_name: ast::Name,
176177
supplied_tps: &'a [ty::t],
177-
impl_dups: @mut HashSet<DefId>,
178+
impl_dups: @RefCell<HashSet<DefId>>,
178179
inherent_candidates: @mut ~[Candidate],
179180
extension_candidates: @mut ~[Candidate],
180181
deref_args: check::DerefArgs,
@@ -540,8 +541,11 @@ impl<'a> LookupContext<'a> {
540541
fn push_candidates_from_impl(&self,
541542
candidates: &mut ~[Candidate],
542543
impl_info: &ty::Impl) {
543-
if !self.impl_dups.insert(impl_info.did) {
544-
return; // already visited
544+
{
545+
let mut impl_dups = self.impl_dups.borrow_mut();
546+
if !impl_dups.get().insert(impl_info.did) {
547+
return; // already visited
548+
}
545549
}
546550
debug!("push_candidates_from_impl: {} {} {}",
547551
token::interner_get(self.m_name),

0 commit comments

Comments
 (0)