Make hidden type registration opt-in, so that each site can be reviewed on its own and we have the right defaults for trait solvers
This commit is contained in:
parent
bda32a4023
commit
88a7b6803b
15 changed files with 51 additions and 26 deletions
|
@ -55,7 +55,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||
cause: &'a ObligationCause<'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
) -> At<'a, 'tcx> {
|
||||
At { infcx: self, cause, param_env, define_opaque_types: true }
|
||||
At { infcx: self, cause, param_env, define_opaque_types: false }
|
||||
}
|
||||
|
||||
/// Forks the inference context, creating a new inference context with the same inference
|
||||
|
|
|
@ -264,7 +264,7 @@ pub struct InferCtxt<'tcx> {
|
|||
/// short lived InferCtxt within queries. The opaque type obligations are forwarded
|
||||
/// to the outside until the end up in an `InferCtxt` for typeck or borrowck.
|
||||
///
|
||||
/// It is default value is `DefiningAnchor::Error`, this way it is easier to catch errors that
|
||||
/// Its default value is `DefiningAnchor::Error`, this way it is easier to catch errors that
|
||||
/// might come up during inference or typeck.
|
||||
pub defining_use_anchor: DefiningAnchor,
|
||||
|
||||
|
|
|
@ -545,8 +545,11 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||
origin,
|
||||
);
|
||||
if let Some(prev) = prev {
|
||||
obligations =
|
||||
self.at(&cause, param_env).eq_exp(a_is_expected, prev, hidden_ty)?.obligations;
|
||||
obligations = self
|
||||
.at(&cause, param_env)
|
||||
.define_opaque_types(true)
|
||||
.eq_exp(a_is_expected, prev, hidden_ty)?
|
||||
.obligations;
|
||||
}
|
||||
|
||||
let item_bounds = tcx.bound_explicit_item_bounds(def_id.to_def_id());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue