Move FulfillmentContext into InferCtxt and remove Typer + ClosureTyper#26677
Move FulfillmentContext into InferCtxt and remove Typer + ClosureTyper#26677bors merged 10 commits intorust-lang:masterfrom
Conversation
Update all uses of FulfillmentContext to be ones obtained via an InferCtxt. This is another step of flattening the type checking context into a single piece of state.
This commit finalizes the work of the past commits by fully moving the fulfillment context into the InferCtxt, cleaning up related context interfaces, removing the Typer and ClosureTyper traits and cleaning up related intefaces
There was a problem hiding this comment.
Why doesn't this use the caching Ty::moves_by_default method?
There was a problem hiding this comment.
@eddyb there isn't a good reason, most likely this code was moved from one of the implementations for Typer. I will update it to use that instead.
There was a problem hiding this comment.
So making this change causes the compiler to crash because of the assertion here: https://github.com/rust-lang/rust/blob/master/src/librustc/middle/ty.rs#L4421.
|
LGTM modulo nits. |
There was a problem hiding this comment.
I would just use a closure rather than a named function here
There was a problem hiding this comment.
@nrc this was related to a weird bug that I found wrt to higher ranked closure type inference. It appears fixed in the nightly but not in our current snapshot. I had a comment about this in the code at another place I had to do this. I'll add back a comment.
|
r+ with nits addressed and passing make tidy |
3b582a0 to
ce089e5
Compare
|
@bors: r+ |
|
📌 Commit ce089e5 has been approved by |
|
⌛ Testing commit ce089e5 with merge ed06840... |
|
💔 Test failed - auto-mac-64-nopt-t |
|
@bors r=nrc |
|
📌 Commit c64bda3 has been approved by |
This patch implements the next chunk of flattening out the type checking context. In a series of patches I moved around the necessary state and logic in order to delete the `Typer` and `ClosureTyper` traits. My next goal is to clean the interfaces and start to move the normalization code behind them. r? @nrc I hope my PR is coherent, doing this too late at night ;)
|
⌛ Testing commit c64bda3 with merge 560b1da... |
This patch implements the next chunk of flattening out the type checking context. In a series of patches I moved around the necessary state and logic in order to delete the
TyperandClosureTypertraits. My next goal is to clean the interfaces and start to move the normalization code behind them.r? @nrc I hope my PR is coherent, doing this too late at night ;)