switch to Lrc

This commit is contained in:
Niko Matsakis 2019-06-17 23:56:35 -04:00
parent fb2c997d4e
commit e6b6873525
4 changed files with 11 additions and 11 deletions

View File

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

View File

@ -26,11 +26,11 @@ use crate::ty::{FloatVid, IntVid, TyVid, ConstVid};
use crate::util::nodemap::FxHashMap;
use errors::DiagnosticBuilder;
use rustc_data_structures::sync::Lrc;
use rustc_data_structures::unify as ut;
use std::cell::{Cell, Ref, RefCell, RefMut};
use std::collections::BTreeMap;
use std::fmt;
use std::rc::Rc;
use syntax::ast;
use syntax_pos::symbol::InternedString;
use syntax_pos::Span;
@ -913,7 +913,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
definition_span: Span,
hidden_ty: Ty<'tcx>,
region: ty::Region<'tcx>,
in_regions: &Rc<Vec<ty::Region<'tcx>>>,
in_regions: &Lrc<Vec<ty::Region<'tcx>>>,
) {
debug!("pick_constraint({:?} <: {:?})", region, in_regions);
self.borrow_region_constraints()

View File

@ -11,7 +11,7 @@ use crate::ty::{self, GenericParamDefKind, Ty, TyCtxt};
use crate::util::nodemap::DefIdMap;
use errors::DiagnosticBuilder;
use rustc_data_structures::fx::FxHashMap;
use std::rc::Rc;
use rustc_data_structures::sync::Lrc;
use syntax_pos::Span;
pub type OpaqueTypeMap<'tcx> = DefIdMap<OpaqueTypeDecl<'tcx>>;
@ -428,7 +428,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
// Create the set of option regions: each region in the hidden
// type can be equal to any of the region parameters of the
// opaque type definition.
let option_regions: Rc<Vec<ty::Region<'tcx>>> = Rc::new(
let option_regions: Lrc<Vec<ty::Region<'tcx>>> = Lrc::new(
abstract_type_generics
.params
.iter()

View File

@ -8,6 +8,7 @@ use super::{MiscVariable, RegionVariableOrigin, SubregionOrigin};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::indexed_vec::IndexVec;
use rustc_data_structures::sync::Lrc;
use rustc_data_structures::unify as ut;
use crate::hir::def_id::DefId;
use crate::ty::ReStatic;
@ -19,7 +20,6 @@ use syntax_pos::Span;
use std::collections::BTreeMap;
use std::{cmp, fmt, mem};
use std::ops::Range;
use std::rc::Rc;
mod leak_check;
@ -166,7 +166,7 @@ pub struct PickConstraint<'tcx> {
pub pick_region: Region<'tcx>,
/// the options O1..On
pub option_regions: Rc<Vec<Region<'tcx>>>,
pub option_regions: Lrc<Vec<Region<'tcx>>>,
}
BraceStructTypeFoldableImpl! {
@ -694,7 +694,7 @@ impl<'tcx> RegionConstraintCollector<'tcx> {
definition_span: Span,
hidden_ty: Ty<'tcx>,
pick_region: ty::Region<'tcx>,
option_regions: &Rc<Vec<ty::Region<'tcx>>>,
option_regions: &Lrc<Vec<ty::Region<'tcx>>>,
) {
debug!("pick_constraint({:?} in {:#?})", pick_region, option_regions);