Skip to content

Commit e6b6873

Browse files
committed
switch to Lrc
1 parent fb2c997 commit e6b6873

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/librustc/infer/lexical_region_resolve/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
247247

248248
// The current value of `vid` is a lower bound LB -- i.e., we
249249
// know that `LB <= vid` must be true.
250-
let pick_lower_bound = match var_values.value(pick_vid) {
250+
let pick_lower_bound: ty::Region<'tcx> = match var_values.value(pick_vid) {
251251
VarValue::ErrorValue => return false,
252252
VarValue::Value(r) => r,
253253
};
@@ -270,12 +270,12 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
270270
// if there >1 option, we only make a choice if there is a
271271
// single *least* choice -- i.e., some available region that
272272
// is `<=` all the others.
273-
let mut least_choice = match options.next() {
274-
Some(r) => r,
273+
let mut least_choice: ty::Region<'tcx> = match options.next() {
274+
Some(&r) => r,
275275
None => return false,
276276
};
277277
debug!("enforce_pick_constraint: least_choice={:?}", least_choice);
278-
for option in options {
278+
for &option in options {
279279
debug!("enforce_pick_constraint: option={:?}", option);
280280
if !self.sub_concrete_regions(least_choice, option) {
281281
if self.sub_concrete_regions(option, least_choice) {

src/librustc/infer/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ use crate::ty::{FloatVid, IntVid, TyVid, ConstVid};
2626
use crate::util::nodemap::FxHashMap;
2727

2828
use errors::DiagnosticBuilder;
29+
use rustc_data_structures::sync::Lrc;
2930
use rustc_data_structures::unify as ut;
3031
use std::cell::{Cell, Ref, RefCell, RefMut};
3132
use std::collections::BTreeMap;
3233
use std::fmt;
33-
use std::rc::Rc;
3434
use syntax::ast;
3535
use syntax_pos::symbol::InternedString;
3636
use syntax_pos::Span;
@@ -913,7 +913,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
913913
definition_span: Span,
914914
hidden_ty: Ty<'tcx>,
915915
region: ty::Region<'tcx>,
916-
in_regions: &Rc<Vec<ty::Region<'tcx>>>,
916+
in_regions: &Lrc<Vec<ty::Region<'tcx>>>,
917917
) {
918918
debug!("pick_constraint({:?} <: {:?})", region, in_regions);
919919
self.borrow_region_constraints()

src/librustc/infer/opaque_types/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::ty::{self, GenericParamDefKind, Ty, TyCtxt};
1111
use crate::util::nodemap::DefIdMap;
1212
use errors::DiagnosticBuilder;
1313
use rustc_data_structures::fx::FxHashMap;
14-
use std::rc::Rc;
14+
use rustc_data_structures::sync::Lrc;
1515
use syntax_pos::Span;
1616

1717
pub type OpaqueTypeMap<'tcx> = DefIdMap<OpaqueTypeDecl<'tcx>>;
@@ -428,7 +428,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
428428
// Create the set of option regions: each region in the hidden
429429
// type can be equal to any of the region parameters of the
430430
// opaque type definition.
431-
let option_regions: Rc<Vec<ty::Region<'tcx>>> = Rc::new(
431+
let option_regions: Lrc<Vec<ty::Region<'tcx>>> = Lrc::new(
432432
abstract_type_generics
433433
.params
434434
.iter()

src/librustc/infer/region_constraints/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use super::{MiscVariable, RegionVariableOrigin, SubregionOrigin};
88

99
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
1010
use rustc_data_structures::indexed_vec::IndexVec;
11+
use rustc_data_structures::sync::Lrc;
1112
use rustc_data_structures::unify as ut;
1213
use crate::hir::def_id::DefId;
1314
use crate::ty::ReStatic;
@@ -19,7 +20,6 @@ use syntax_pos::Span;
1920
use std::collections::BTreeMap;
2021
use std::{cmp, fmt, mem};
2122
use std::ops::Range;
22-
use std::rc::Rc;
2323

2424
mod leak_check;
2525

@@ -166,7 +166,7 @@ pub struct PickConstraint<'tcx> {
166166
pub pick_region: Region<'tcx>,
167167

168168
/// the options O1..On
169-
pub option_regions: Rc<Vec<Region<'tcx>>>,
169+
pub option_regions: Lrc<Vec<Region<'tcx>>>,
170170
}
171171

172172
BraceStructTypeFoldableImpl! {
@@ -694,7 +694,7 @@ impl<'tcx> RegionConstraintCollector<'tcx> {
694694
definition_span: Span,
695695
hidden_ty: Ty<'tcx>,
696696
pick_region: ty::Region<'tcx>,
697-
option_regions: &Rc<Vec<ty::Region<'tcx>>>,
697+
option_regions: &Lrc<Vec<ty::Region<'tcx>>>,
698698
) {
699699
debug!("pick_constraint({:?} in {:#?})", pick_region, option_regions);
700700

0 commit comments

Comments
 (0)