Skip to content

Commit 28d05ce

Browse files
committed
---
yaml --- r: 147711 b: refs/heads/try2 c: fecef74 h: refs/heads/master i: 147709: 825df87 147707: 48905a2 147703: f049ecd 147695: 0c79be4 147679: f599886 147647: 3c2659e 147583: a99a75c 147455: 5fb3c26 v: v3
1 parent 5d9b65a commit 28d05ce

File tree

6 files changed

+20
-10
lines changed

6 files changed

+20
-10
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: ed819c9a81d138ab876c42ad35025ff432845a2c
8+
refs/heads/try2: fecef74d57307eb1ecbb4351ef644e04aafb6f9a
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
@@ -449,7 +449,8 @@ fn encode_reexported_static_base_methods(ecx: &EncodeContext,
449449
let inherent_impls = ecx.tcx.inherent_impls.borrow();
450450
match inherent_impls.get().find(&exp.def_id) {
451451
Some(implementations) => {
452-
for &base_impl in implementations.iter() {
452+
let implementations = implementations.borrow();
453+
for &base_impl in implementations.get().iter() {
453454
for &m in base_impl.methods.iter() {
454455
if m.explicit_self == ast::sty_static {
455456
encode_reexported_static_method(ecx, ebml_w, exp,
@@ -884,7 +885,8 @@ fn encode_inherent_implementations(ecx: &EncodeContext,
884885
match inherent_impls.get().find(&def_id) {
885886
None => {}
886887
Some(&implementations) => {
887-
for implementation in implementations.iter() {
888+
let implementations = implementations.borrow();
889+
for implementation in implementations.get().iter() {
888890
ebml_w.start_tag(tag_items_data_item_inherent_impl);
889891
encode_def_id(ebml_w, implementation.did);
890892
ebml_w.end_tag();

branches/try2/src/librustc/middle/dead.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ impl DeadVisitor {
287287
match inherent_impls.get().find(&def_id) {
288288
None => (),
289289
Some(ref impl_list) => {
290-
for impl_ in impl_list.iter() {
290+
let impl_list = impl_list.borrow();
291+
for impl_ in impl_list.get().iter() {
291292
for method in impl_.methods.iter() {
292293
if self.live_symbols.contains(&method.def_id.node) {
293294
return true;

branches/try2/src/librustc/middle/ty.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ struct ctxt_ {
338338
// Maps a def_id of a type to a list of its inherent impls.
339339
// Contains implementations of methods that are inherent to a type.
340340
// Methods in these implementations don't need to be exported.
341-
inherent_impls: RefCell<HashMap<ast::DefId, @mut ~[@Impl]>>,
341+
inherent_impls: RefCell<HashMap<ast::DefId, @RefCell<~[@Impl]>>>,
342342

343343
// Maps a def_id of an impl to an Impl structure.
344344
// Note that this contains all of the impls that we know about,
@@ -4561,14 +4561,18 @@ pub fn populate_implementations_for_type_if_necessary(tcx: ctxt,
45614561
let mut inherent_impls = tcx.inherent_impls.borrow_mut();
45624562
match inherent_impls.get().find(&type_id) {
45634563
None => {
4564-
implementation_list = @mut ~[];
4564+
implementation_list = @RefCell::new(~[]);
45654565
inherent_impls.get().insert(type_id, implementation_list);
45664566
}
45674567
Some(&existing_implementation_list) => {
45684568
implementation_list = existing_implementation_list;
45694569
}
45704570
}
4571-
implementation_list.push(implementation);
4571+
{
4572+
let mut implementation_list =
4573+
implementation_list.borrow_mut();
4574+
implementation_list.get().push(implementation);
4575+
}
45724576
}
45734577

45744578
// Store the implementation info.

branches/try2/src/librustc/middle/typeck/check/method.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,8 @@ impl<'a> LookupContext<'a> {
536536
let inherent_impls = self.tcx().inherent_impls.borrow();
537537
let opt_impl_infos = inherent_impls.get().find(&did);
538538
for impl_infos in opt_impl_infos.iter() {
539-
for impl_info in impl_infos.iter() {
539+
let impl_infos = impl_infos.borrow();
540+
for impl_info in impl_infos.get().iter() {
540541
let mut inherent_candidates = self.inherent_candidates
541542
.borrow_mut();
542543
self.push_candidates_from_impl(inherent_candidates.get(),

branches/try2/src/librustc/middle/typeck/coherence.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ use syntax::codemap::Span;
4545
use syntax::opt_vec;
4646
use syntax::visit;
4747

48+
use std::cell::RefCell;
4849
use std::hashmap::HashSet;
4950
use std::result::Ok;
5051
use std::vec;
@@ -391,15 +392,16 @@ impl CoherenceChecker {
391392
let mut inherent_impls = tcx.inherent_impls.borrow_mut();
392393
match inherent_impls.get().find(&base_def_id) {
393394
None => {
394-
implementation_list = @mut ~[];
395+
implementation_list = @RefCell::new(~[]);
395396
inherent_impls.get().insert(base_def_id, implementation_list);
396397
}
397398
Some(&existing_implementation_list) => {
398399
implementation_list = existing_implementation_list;
399400
}
400401
}
401402

402-
implementation_list.push(implementation);
403+
let mut implementation_list = implementation_list.borrow_mut();
404+
implementation_list.get().push(implementation);
403405
}
404406

405407
pub fn add_trait_impl(&self,

0 commit comments

Comments
 (0)