/// Allow negative trait implementations.
(active, negative_impls, "1.44.0", Some(68318), None),
-
+
/// Lazily evaluate constants. Which allows constants to depend on type parameters.
(active, lazy_normalization_consts, "1.44.0", Some(60471), None),
b = self.infcx.shallow_resolve(b);
}
- match (a.val, b.val) {
- (_, ty::ConstKind::Infer(InferConst::Var(_))) if D::forbid_inference_vars() => {
+ match b.val {
+ ty::ConstKind::Infer(InferConst::Var(_)) if D::forbid_inference_vars() => {
// Forbid inference variables in the RHS.
bug!("unexpected inference var {:?}", b)
}
instrument_mcount: bool = (false, parse_bool, [TRACKED],
"insert function instrument code for mcount-based tracing (default: no)"),
keep_hygiene_data: bool = (false, parse_bool, [UNTRACKED],
- "lazily evaluate constants (experimental)"),
+ "keep hygiene data after analysis (default: no)"),
link_native_libraries: bool = (true, parse_bool, [UNTRACKED],
"link native libraries in the linker invocation (default: yes)"),
link_only: bool = (false, parse_bool, [TRACKED],
)
}
-
ty::Predicate::ConstEquate(..) => {
// Errors for `ConstEquate` predicates show up as
// `SelectionError::ConstEvalFailure`,
Ok(val) => Ok(Const::from_value(self.selcx.tcx(), val, c.ty)),
Err(ErrorHandled::TooGeneric) => {
stalled_on.append(
- &mut substs.types().filter_map(|ty| TyOrConstInferVar::maybe_from_ty(ty)).collect(),
+ &mut substs
+ .types()
+ .filter_map(|ty| TyOrConstInferVar::maybe_from_ty(ty))
+ .collect(),
);
Err(ProcessResult::Unchanged)
}
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_middle::ty::subst::{GenericArg, InternalSubsts, Subst};
-use rustc_middle::ty::{self, Predicate, ToPredicate, Ty, TyCtxt, TypeFoldable, TypeVisitor, WithConstness};
+use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, TypeVisitor, WithConstness};
+use rustc_middle::ty::{Predicate, ToPredicate};
use rustc_session::lint::builtin::WHERE_CLAUSES_OBJECT_SAFETY;
use rustc_span::symbol::Symbol;
use rustc_span::Span;
Node::AnonConst(_) => {
if tcx.features().lazy_normalization_consts {
let parent_id = tcx.hir().get_parent_item(hir_id);
- Some(tcx.hir().local_def_id(parent_id))
+ Some(tcx.hir().local_def_id(parent_id).to_def_id())
} else {
None
}