Skip to content

Instantly share code, notes, and snippets.

@nikomatsakis
Created June 19, 2019 16:18
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/73455b685e97bafd26b06d79268dda68 to your computer and use it in GitHub Desktop.
Save nikomatsakis/73455b685e97bafd26b06d79268dda68 to your computer and use it in GitHub Desktop.
Head: issue-56238-multiple-lifetimes-async-fn-region-solver implement `TypeFoldable` for `Arc`
Merge: rust-lang/master Auto merge of #61915 - Centril:rollup-oire3i8, r=Centril
Push: nikomatsakis/issue-56238-multiple-lifetimes-async-fn-region-solver implement `TypeFoldable` for `Arc`
Tag: 1.0.0-beta (54304)
Unstaged changes (2)
modified 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.
modified 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 {
Stashes (12)
stash@{0} On issue-56238-multiple-lifetimes-async-fn-region-solver: foo
stash@{1} On issue-56238-multiple-lifetimes-async-fn-region-solver: foo
stash@{2} On issue-56238-multiple-lifetimes-async-fn-region-solver: foo
stash@{3} On (no branch): opaque-type-mod-rs
stash@{4} On higher_rank_errors: try_report_placeholders_trait debug
stash@{5} On universes: staticize-erasize-blah-blah-blah
stash@{6} On (no branch): the commit
stash@{7} On universes: canonicalize-skol-in-response
stash@{8} On universes: canonical-carries-a-universe-2
stash@{9} On universes: split-canonical-query-and-response
stash@{10} On universes: canonical-carries-a-universe
stash@{11} On issue-51415-borrowck-match-default-bindings-bug: more-asserts
Unmerged into rust-lang/master (46)
7c905411da4 nikomatsakis/issue-56238-multiple-lifetimes-async-fn-region-solver implement `TypeFoldable` for `Arc`
dcd73021775 rename `pick_constraints.rs` to `member_constraints.rs`
bf449333340 rename to "member constraints"
435f027a605 implement Lift for Arc
94dbff37887 switch to Lrc
789108be56d fix silly bugs in binary_search_util test
f091a5876cb bless test output
10e4894641e address nits by mattewjasper
b554cf68517 account for the pick-constraint edges when reporting errors
c5e60cb8727 just create a binary search slice helper fn
a474291c6a7 add a `VecMap` data structure
ca77137124e test with explicit existential type
e921349162c add a preliminary existential test; not really enough
4c13ef6492b pacify the mercilous tidy
80aff478ac2 remove outdated TODO markers
330379820e3 explain why pick-constraints can be an empty vector
e3578fbe97e add a FIXME related to the non-free-region case
3bcc1555b7f update the async-fn-multiple-lifetimes test
0d31b94997d fix tests and remove outdated stderr files
8cc2bb4e0c3 integrate reverse graph and upper-bound computation
ac28f875d74 add a `depth_first_search` helper function
e2210de56ca introduce a `VecGraph` abstraction that cheaply stores graphs
36289641861 implement the graph traits for SCC
007adf22f18 improve tests with migration mode, mir mode
c38684d7713 remove old error and add an explanation
eaf7214be83 preliminary integration of "pick constraints" into nll solver
a75d16fa315 construct pick-constraints and give them to region inference
aaa0f866bc0 implement PickConstraintSet type
05ffb73b903 pass more than outlives constraints to constraint conversion
7df9ccf7d2b rename `ConstraintSet` to `OutlivesConstraintSet`
9c39cec671b propagate the pick-constraints through queries
72c8736236e pass a `&mut QueryRegionConstraints` not just outlives constraints
1bba91a4a6c remove deref impl and add an index impl
33a4f448d39 rename `ConstraintIndex` to `OutlivesConstraintIndex`
0b1963dd80b introduce `QueryRegionConstraints` struct
b4287aaed19 introduce `QueryRegionConstraints` struct (no-op)
c6364473481 rename `QueryRegionConstraint` to `QueryOutlivesConstraint`
4c0acecce23 enforce and report pick-constraint errors
ed7f0563409 integrate pick constraints into lexical solver more completely
b211b1c645f rename from "in constraint" to "pick constraint"
e6ea4eb23c6 add some tests, currently ICE-ing
7675d8f0974 make `dup_vec` optional
a3548211da2 lexical_region_resolve: rustfmt
84f3de111fe introduce an "in" constraint instead of error
1c01f57e171 introduce `constrain_regions` helper
5a365e26dc4 opaque_types/mod.rs: rustfmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment