switch to Lrc
This commit is contained in:
parent
fb2c997d4e
commit
e6b6873525
@ -247,7 +247,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
|||||||
|
|
||||||
// The current value of `vid` is a lower bound LB -- i.e., we
|
// The current value of `vid` is a lower bound LB -- i.e., we
|
||||||
// know that `LB <= vid` must be true.
|
// 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::ErrorValue => return false,
|
||||||
VarValue::Value(r) => r,
|
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
|
// if there >1 option, we only make a choice if there is a
|
||||||
// single *least* choice -- i.e., some available region that
|
// single *least* choice -- i.e., some available region that
|
||||||
// is `<=` all the others.
|
// is `<=` all the others.
|
||||||
let mut least_choice = match options.next() {
|
let mut least_choice: ty::Region<'tcx> = match options.next() {
|
||||||
Some(r) => r,
|
Some(&r) => r,
|
||||||
None => return false,
|
None => return false,
|
||||||
};
|
};
|
||||||
debug!("enforce_pick_constraint: least_choice={:?}", least_choice);
|
debug!("enforce_pick_constraint: least_choice={:?}", least_choice);
|
||||||
for option in options {
|
for &option in options {
|
||||||
debug!("enforce_pick_constraint: option={:?}", option);
|
debug!("enforce_pick_constraint: option={:?}", option);
|
||||||
if !self.sub_concrete_regions(least_choice, option) {
|
if !self.sub_concrete_regions(least_choice, option) {
|
||||||
if self.sub_concrete_regions(option, least_choice) {
|
if self.sub_concrete_regions(option, least_choice) {
|
||||||
|
@ -26,11 +26,11 @@ use crate::ty::{FloatVid, IntVid, TyVid, ConstVid};
|
|||||||
use crate::util::nodemap::FxHashMap;
|
use crate::util::nodemap::FxHashMap;
|
||||||
|
|
||||||
use errors::DiagnosticBuilder;
|
use errors::DiagnosticBuilder;
|
||||||
|
use rustc_data_structures::sync::Lrc;
|
||||||
use rustc_data_structures::unify as ut;
|
use rustc_data_structures::unify as ut;
|
||||||
use std::cell::{Cell, Ref, RefCell, RefMut};
|
use std::cell::{Cell, Ref, RefCell, RefMut};
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::rc::Rc;
|
|
||||||
use syntax::ast;
|
use syntax::ast;
|
||||||
use syntax_pos::symbol::InternedString;
|
use syntax_pos::symbol::InternedString;
|
||||||
use syntax_pos::Span;
|
use syntax_pos::Span;
|
||||||
@ -913,7 +913,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
|||||||
definition_span: Span,
|
definition_span: Span,
|
||||||
hidden_ty: Ty<'tcx>,
|
hidden_ty: Ty<'tcx>,
|
||||||
region: ty::Region<'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);
|
debug!("pick_constraint({:?} <: {:?})", region, in_regions);
|
||||||
self.borrow_region_constraints()
|
self.borrow_region_constraints()
|
||||||
|
@ -11,7 +11,7 @@ use crate::ty::{self, GenericParamDefKind, Ty, TyCtxt};
|
|||||||
use crate::util::nodemap::DefIdMap;
|
use crate::util::nodemap::DefIdMap;
|
||||||
use errors::DiagnosticBuilder;
|
use errors::DiagnosticBuilder;
|
||||||
use rustc_data_structures::fx::FxHashMap;
|
use rustc_data_structures::fx::FxHashMap;
|
||||||
use std::rc::Rc;
|
use rustc_data_structures::sync::Lrc;
|
||||||
use syntax_pos::Span;
|
use syntax_pos::Span;
|
||||||
|
|
||||||
pub type OpaqueTypeMap<'tcx> = DefIdMap<OpaqueTypeDecl<'tcx>>;
|
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
|
// Create the set of option regions: each region in the hidden
|
||||||
// type can be equal to any of the region parameters of the
|
// type can be equal to any of the region parameters of the
|
||||||
// opaque type definition.
|
// 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
|
abstract_type_generics
|
||||||
.params
|
.params
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -8,6 +8,7 @@ use super::{MiscVariable, RegionVariableOrigin, SubregionOrigin};
|
|||||||
|
|
||||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||||
use rustc_data_structures::indexed_vec::IndexVec;
|
use rustc_data_structures::indexed_vec::IndexVec;
|
||||||
|
use rustc_data_structures::sync::Lrc;
|
||||||
use rustc_data_structures::unify as ut;
|
use rustc_data_structures::unify as ut;
|
||||||
use crate::hir::def_id::DefId;
|
use crate::hir::def_id::DefId;
|
||||||
use crate::ty::ReStatic;
|
use crate::ty::ReStatic;
|
||||||
@ -19,7 +20,6 @@ use syntax_pos::Span;
|
|||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::{cmp, fmt, mem};
|
use std::{cmp, fmt, mem};
|
||||||
use std::ops::Range;
|
use std::ops::Range;
|
||||||
use std::rc::Rc;
|
|
||||||
|
|
||||||
mod leak_check;
|
mod leak_check;
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ pub struct PickConstraint<'tcx> {
|
|||||||
pub pick_region: Region<'tcx>,
|
pub pick_region: Region<'tcx>,
|
||||||
|
|
||||||
/// the options O1..On
|
/// the options O1..On
|
||||||
pub option_regions: Rc<Vec<Region<'tcx>>>,
|
pub option_regions: Lrc<Vec<Region<'tcx>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
BraceStructTypeFoldableImpl! {
|
BraceStructTypeFoldableImpl! {
|
||||||
@ -694,7 +694,7 @@ impl<'tcx> RegionConstraintCollector<'tcx> {
|
|||||||
definition_span: Span,
|
definition_span: Span,
|
||||||
hidden_ty: Ty<'tcx>,
|
hidden_ty: Ty<'tcx>,
|
||||||
pick_region: ty::Region<'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);
|
debug!("pick_constraint({:?} in {:#?})", pick_region, option_regions);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user