use traits::select::IntercrateAmbiguityCause;
use ty::{self, TyCtxt, TypeFoldable};
use syntax_pos::DUMMY_SP;
-use std::rc::Rc;
+use rustc_data_structures::sync::Lrc;
use lint;
// The feature gate should prevent introducing new specializations, but not
// taking advantage of upstream ones.
- if !tcx.sess.features.borrow().specialization &&
+ if !tcx.features().specialization &&
(impl1_def_id.is_local() || impl2_def_id.is_local()) {
return false;
}
target_impl: DefId)
-> Result<&'tcx Substs<'tcx>, ()> {
let selcx = &mut SelectionContext::new(&infcx);
- let target_substs = infcx.fresh_substs_for_item(DUMMY_SP, target_impl);
+ let target_substs = infcx.fresh_substs_for_item(param_env.universe, DUMMY_SP, target_impl);
let (target_trait_ref, mut obligations) = impl_trait_ref_and_oblig(selcx,
param_env,
target_impl,
// Query provider for `specialization_graph_of`.
pub(super) fn specialization_graph_provider<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
trait_id: DefId)
- -> Rc<specialization_graph::Graph> {
+ -> Lrc<specialization_graph::Graph> {
let mut sg = specialization_graph::Graph::new();
let mut trait_impls = Vec::new();
}
}
- Rc::new(sg)
+ Lrc::new(sg)
}
/// Recovers the "impl X for Y" signature from `impl_def_id` and returns it as a