Coerce(..) |
ConstEvaluatable(..) |
ConstEquate(..) |
- OpaqueType(..) |
TypeWellFormedFromEnv(..) => continue,
};
if predicate.is_global() {
inferred_outlives
.iter()
.filter_map(|(pred, _)| match pred.kind().skip_binder() {
- ty::PredicateKind::RegionOutlives(ty::OutlivesPredicate(a, b)) => match a {
+ ty::PredicateKind::RegionOutlives(ty::OutlivesPredicate(a, b)) => match *a {
ty::ReEarlyBound(ebr) if ebr.index == index => Some(b),
_ => None,
},
if let hir::GenericBound::Outlives(lifetime) = bound {
let is_inferred = match tcx.named_region(lifetime.hir_id) {
Some(Region::Static) if infer_static => {
- inferred_outlives.iter().any(|r| matches!(r, ty::ReStatic))
+ inferred_outlives.iter().any(|r| matches!(**r, ty::ReStatic))
}
Some(Region::EarlyBound(index, ..)) => inferred_outlives.iter().any(|r| {
- if let ty::ReEarlyBound(ebr) = r { ebr.index == index } else { false }
+ if let ty::ReEarlyBound(ebr) = **r { ebr.index == index } else { false }
}),
_ => false,
};
// We are extremely conservative with what we warn about.
let conjured_ty = cx.typeck_results().expr_ty(expr);
if let Some((msg, span)) =
- with_no_trimmed_paths(|| ty_find_init_error(cx.tcx, conjured_ty, init))
+ with_no_trimmed_paths!(ty_find_init_error(cx.tcx, conjured_ty, init))
{
cx.struct_span_lint(INVALID_VALUE, expr.span, |lint| {
let mut err = lint.build(&format!(
}
(Array(a_ty, a_const), Array(b_ty, b_const)) => {
// For arrays, we also check the constness of the type.
- a_const.val == b_const.val
- && structurally_same_type_impl(seen_types, cx, a_ty, b_ty, ckind)
+ a_const.val() == b_const.val()
+ && structurally_same_type_impl(seen_types, cx, *a_ty, *b_ty, ckind)
}
(Slice(a_ty), Slice(b_ty)) => {
- structurally_same_type_impl(seen_types, cx, a_ty, b_ty, ckind)
+ structurally_same_type_impl(seen_types, cx, *a_ty, *b_ty, ckind)
}
(RawPtr(a_tymut), RawPtr(b_tymut)) => {
a_tymut.mutbl == b_tymut.mutbl
&& structurally_same_type_impl(
- seen_types,
- cx,
- &a_tymut.ty,
- &b_tymut.ty,
- ckind,
+ seen_types, cx, a_tymut.ty, b_tymut.ty, ckind,
)
}
(Ref(_a_region, a_ty, a_mut), Ref(_b_region, b_ty, b_mut)) => {
// For structural sameness, we don't need the region to be same.
a_mut == b_mut
- && structurally_same_type_impl(seen_types, cx, a_ty, b_ty, ckind)
+ && structurally_same_type_impl(seen_types, cx, *a_ty, *b_ty, ckind)
}
(FnDef(..), FnDef(..)) => {
let a_poly_sig = a.fn_sig(tcx);
(a_sig.abi, a_sig.unsafety, a_sig.c_variadic)
== (b_sig.abi, b_sig.unsafety, b_sig.c_variadic)
&& a_sig.inputs().iter().eq_by(b_sig.inputs().iter(), |a, b| {
- structurally_same_type_impl(seen_types, cx, a, b, ckind)
+ structurally_same_type_impl(seen_types, cx, *a, *b, ckind)
})
&& structurally_same_type_impl(
seen_types,