Skip to content

Commit 8db3ce8

Browse files
committed
---
yaml --- r: 97017 b: refs/heads/dist-snap c: 42f7f7f h: refs/heads/master i: 97015: 7277c8a v: v3
1 parent ab83132 commit 8db3ce8

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: c554d23a9a615e6317011fc44a5eeaba1930b783
9+
refs/heads/dist-snap: 42f7f7f437ad978dd95d3ec39a0f231d6cd161da
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/metadata/encoder.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ fn encode_reexported_static_base_methods(ecx: &EncodeContext,
442442
ebml_w: &mut writer::Encoder,
443443
exp: &middle::resolve::Export2)
444444
-> bool {
445-
match ecx.tcx.inherent_impls.find(&exp.def_id) {
445+
let inherent_impls = ecx.tcx.inherent_impls.borrow();
446+
match inherent_impls.get().find(&exp.def_id) {
446447
Some(implementations) => {
447448
for &base_impl in implementations.iter() {
448449
for &m in base_impl.methods.iter() {
@@ -862,7 +863,8 @@ fn should_inline(attrs: &[Attribute]) -> bool {
862863
fn encode_inherent_implementations(ecx: &EncodeContext,
863864
ebml_w: &mut writer::Encoder,
864865
def_id: DefId) {
865-
match ecx.tcx.inherent_impls.find(&def_id) {
866+
let inherent_impls = ecx.tcx.inherent_impls.borrow();
867+
match inherent_impls.get().find(&def_id) {
866868
None => {}
867869
Some(&implementations) => {
868870
for implementation in implementations.iter() {

branches/dist-snap/src/librustc/middle/dead.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ impl DeadVisitor {
282282
// method of a private type is used, but the type itself is never
283283
// called directly.
284284
let def_id = local_def(id);
285-
match self.tcx.inherent_impls.find(&def_id) {
285+
let inherent_impls = self.tcx.inherent_impls.borrow();
286+
match inherent_impls.get().find(&def_id) {
286287
None => (),
287288
Some(ref impl_list) => {
288289
for impl_ in impl_list.iter() {

branches/dist-snap/src/librustc/middle/ty.rs

Lines changed: 5 additions & 4 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: @mut HashMap<ast::DefId, @mut ~[@Impl]>,
341+
inherent_impls: RefCell<HashMap<ast::DefId, @mut ~[@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,
@@ -1006,7 +1006,7 @@ pub fn mk_ctxt(s: session::Session,
10061006
destructor_for_type: RefCell::new(HashMap::new()),
10071007
destructors: RefCell::new(HashSet::new()),
10081008
trait_impls: RefCell::new(HashMap::new()),
1009-
inherent_impls: @mut HashMap::new(),
1009+
inherent_impls: RefCell::new(HashMap::new()),
10101010
impls: @mut HashMap::new(),
10111011
used_unsafe: @mut HashSet::new(),
10121012
used_mut_nodes: @mut HashSet::new(),
@@ -4549,10 +4549,11 @@ pub fn populate_implementations_for_type_if_necessary(tcx: ctxt,
45494549
// If this is an inherent implementation, record it.
45504550
if associated_traits.is_none() {
45514551
let implementation_list;
4552-
match tcx.inherent_impls.find(&type_id) {
4552+
let mut inherent_impls = tcx.inherent_impls.borrow_mut();
4553+
match inherent_impls.get().find(&type_id) {
45534554
None => {
45544555
implementation_list = @mut ~[];
4555-
tcx.inherent_impls.insert(type_id, implementation_list);
4556+
inherent_impls.get().insert(type_id, implementation_list);
45564557
}
45574558
Some(&existing_implementation_list) => {
45584559
implementation_list = existing_implementation_list;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ impl<'a> LookupContext<'a> {
527527
// metadata if necessary.
528528
ty::populate_implementations_for_type_if_necessary(self.tcx(), did);
529529

530-
let opt_impl_infos = self.tcx().inherent_impls.find(&did);
530+
let inherent_impls = self.tcx().inherent_impls.borrow();
531+
let opt_impl_infos = inherent_impls.get().find(&did);
531532
for impl_infos in opt_impl_infos.iter() {
532533
for impl_info in impl_infos.iter() {
533534
self.push_candidates_from_impl(

branches/dist-snap/src/librustc/middle/typeck/coherence.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,11 @@ impl CoherenceChecker {
384384
implementation: @Impl) {
385385
let tcx = self.crate_context.tcx;
386386
let implementation_list;
387-
match tcx.inherent_impls.find(&base_def_id) {
387+
let mut inherent_impls = tcx.inherent_impls.borrow_mut();
388+
match inherent_impls.get().find(&base_def_id) {
388389
None => {
389390
implementation_list = @mut ~[];
390-
tcx.inherent_impls.insert(base_def_id, implementation_list);
391+
inherent_impls.get().insert(base_def_id, implementation_list);
391392
}
392393
Some(&existing_implementation_list) => {
393394
implementation_list = existing_implementation_list;

0 commit comments

Comments
 (0)