]> git.lizzy.rs Git - rust.git/commit
clear obligations-added flag with nested fulfillcx
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 13 Sep 2016 22:31:26 +0000 (18:31 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Wed, 14 Sep 2016 15:04:39 +0000 (11:04 -0400)
commit6353e30bb2d7968332217c04ac25e0800500fb33
treecb7e73aa0816f4ad143ccf54adf1cbe4e74e3830
parentc87ba3f1222ba20d491e8ed76a04977283280742
clear obligations-added flag with nested fulfillcx

This flag is a debugging measure designed to detect cases where we start
a snapshot, create type variables, register obligations involving those
type variables in the fulfillment cx, and then have to unroll the
snapshot, leaving "dangling type variables" behind.  HOWEVER, in some
cases the flag is wrong. In particular, we sometimes create a
"mini-fulfilment-cx" in which we enroll obligations. As long as this
fulfillment cx is fully drained before we return, this is not a problem,
as there won't be any escaping obligations in the main cx. So we add a
fn to save/restore the flag.
src/librustc/infer/mod.rs
src/librustc/traits/specialize/mod.rs
src/test/compile-fail/issue-36053-2.rs [new file with mode: 0644]
src/test/run-pass/issue-36053.rs [new file with mode: 0644]