SIGN IN SIGN UP
rust-lang / rust UNCLAIMED

Empowering everyone to build reliable and efficient software.

0 0 63 Rust

Auto merge of #144704 - compiler-errors:explode-wf, r=lcnr

expand WF obligations when checking method calls

Don't wrap a bunch of signatures in `FnPtr` then check their WF; instead, check the WFness of each input/output separately.

This is useful for the new trait solver, since because we stall on root obligations we end up needing to repeatedly recompute the WFness of possibly very large function signature types if it ends up bottoming out in ambiguity.

This may also give us more chances to hit the WF fast path for certain types like built-ins.

Finally, this just seems conceptually correct to do. There's nothing conceptually that suggests that wrapping the function signature in an fn pointer makes sense at all to do; I'm guessing that it was just convenient so that we didn't have to register WF obligations in a loop, but it doesn't affect the readability of this code at all.
B
bors committed
7cd950546b4ce68843b4cbdb1ab3a43776202d3a