Skip to content

Instantly share code, notes, and snippets.

@nikomatsakis
Created June 19, 2019 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikomatsakis/4ff3e743cf5243877b9d4507c70425b4 to your computer and use it in GitHub Desktop.
Save nikomatsakis/4ff3e743cf5243877b9d4507c70425b4 to your computer and use it in GitHub Desktop.
diff --git a/src/librustc/infer/opaque_types/mod.rs b/src/librustc/infer/opaque_types/mod.rs
index 9bb782e31f2..44ac68c3eab 100644
--- a/src/librustc/infer/opaque_types/mod.rs
+++ b/src/librustc/infer/opaque_types/mod.rs
@@ -425,6 +425,11 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
opaque_defn: &OpaqueTypeDecl<'tcx>,
opaque_type_def_id: DefId,
) {
+ debug!(
+ "generate_member_constraint: definition_span = {:?}",
+ opaque_defn.definition_span.compiler_desugaring_kind(),
+ );
+
// Create the set of choice regions: each region in the hidden
// type can be equal to any of the region parameters of the
// opaque type definition.
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index ad99bebb833..d7b91c4cf57 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -3228,6 +3228,18 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
formal_args: &[Ty<'tcx>])
-> Vec<Ty<'tcx>> {
let formal_ret = self.resolve_type_vars_with_obligations(formal_ret);
+ debug!(
+ "expected_inputs_for_expected_output(expected_ret={:#?}, formal_ret={:?}, formal_args={:#?})",
+ expected_ret,
+ formal_ret,
+ formal_args,
+ );
+ debug!(
+ "expected_inputs_for_expected_output: pending obligations = {:#?}",
+ self.fulfillment_cx
+ .borrow()
+ .pending_obligations(),
+ );
let ret_ty = match expected_ret.only_has_type(self) {
Some(ret) => ret,
None => return Vec::new()
@@ -3240,6 +3252,23 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let origin = self.misc(call_span);
let ures = self.at(&origin, self.param_env).sup(ret_ty, &formal_ret);
+ debug!(
+ "expected_inputs_for_expected_output: post unification, formal_ret={:?}",
+ self.resolve_vars_if_possible(&formal_ret),
+ );
+
+ debug!(
+ "expected_inputs_for_expected_output: post unification, formal_args={:#?}",
+ formal_args.iter().map(|f_a| self.resolve_vars_if_possible(f_a)).collect::<Vec<_>>(),
+ );
+
+ debug!(
+ "expected_inputs_for_expected_output: pending obligations = {:#?}",
+ self.resolve_vars_if_possible(&self.fulfillment_cx
+ .borrow()
+ .pending_obligations()),
+ );
+
// FIXME(#27336) can't use ? here, Try::from_error doesn't default
// to identity so the resulting type is not constrained.
match ures {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment