//! subtyping, type equality, etc.
use crate::hir::def_id::DefId;
-use crate::ty::subst::{Kind, UnpackedKind, Substs};
+use crate::ty::subst::{Kind, UnpackedKind, SubstsRef};
use crate::ty::{self, Ty, TyCtxt, TypeFoldable};
use crate::ty::error::{ExpectedFound, TypeError};
use crate::mir::interpret::GlobalId;
/// accordingly.
fn relate_item_substs(&mut self,
item_def_id: DefId,
- a_subst: &'tcx Substs<'tcx>,
- b_subst: &'tcx Substs<'tcx>)
- -> RelateResult<'tcx, &'tcx Substs<'tcx>>
+ a_subst: SubstsRef<'tcx>,
+ b_subst: SubstsRef<'tcx>)
+ -> RelateResult<'tcx, SubstsRef<'tcx>>
{
debug!("relate_item_substs(item_def_id={:?}, a_subst={:?}, b_subst={:?})",
item_def_id,
pub fn relate_substs<'a, 'gcx, 'tcx, R>(relation: &mut R,
variances: Option<&Vec<ty::Variance>>,
- a_subst: &'tcx Substs<'tcx>,
- b_subst: &'tcx Substs<'tcx>)
- -> RelateResult<'tcx, &'tcx Substs<'tcx>>
+ a_subst: SubstsRef<'tcx>,
+ b_subst: SubstsRef<'tcx>)
+ -> RelateResult<'tcx, SubstsRef<'tcx>>
where R: TypeRelation<'a, 'gcx, 'tcx>, 'gcx: 'a+'tcx, 'tcx: 'a
{
let tcx = relation.tcx();
{
let tcx = relation.tcx();
- if a.variadic != b.variadic {
+ if a.c_variadic != b.c_variadic {
return Err(TypeError::VariadicMismatch(
- expected_found(relation, &a.variadic, &b.variadic)));
+ expected_found(relation, &a.c_variadic, &b.c_variadic)));
}
let unsafety = relation.relate(&a.unsafety, &b.unsafety)?;
let abi = relation.relate(&a.abi, &b.abi)?;
});
Ok(ty::FnSig {
inputs_and_output: tcx.mk_type_list(inputs_and_output)?,
- variadic: a.variadic,
+ c_variadic: a.c_variadic,
unsafety,
abi,
})
}
}
-impl<'tcx> Relate<'tcx> for &'tcx Substs<'tcx> {
+impl<'tcx> Relate<'tcx> for SubstsRef<'tcx> {
fn relate<'a, 'gcx, R>(relation: &mut R,
- a: &&'tcx Substs<'tcx>,
- b: &&'tcx Substs<'tcx>)
- -> RelateResult<'tcx, &'tcx Substs<'tcx>>
+ a: &SubstsRef<'tcx>,
+ b: &SubstsRef<'tcx>)
+ -> RelateResult<'tcx, SubstsRef<'tcx>>
where R: TypeRelation<'a, 'gcx, 'tcx>, 'gcx: 'a+'tcx, 'tcx: 'a
{
relate_substs(relation, None, a, b)