]> git.lizzy.rs Git - rust.git/commit
Fix case when ExprUseVisitor is called after typeck writeback
authorAman Arora <me@aman-arora.com>
Sun, 15 Nov 2020 22:09:51 +0000 (17:09 -0500)
committerAman Arora <me@aman-arora.com>
Sun, 15 Nov 2020 22:09:51 +0000 (17:09 -0500)
commitbb8c5e5d8b4961a26f88b320f719249a9db8225e
treeedf2da90649c0da6edafa9980f5a8776ee4165e2
parentc50e57f946ee5a73b50fa5c52bb7a2a8a0cecf3f
Fix case when ExprUseVisitor is called after typeck writeback

Clippy uses `ExprUseVisitor` and atleast in some cases it runs
after writeback.

We currently don't writeback the min_capture results of closure
capture analysis since no place within the compiler itself uses it.

In the short term to fix clippy we add a fallback when walking captures
of a closure to check if closure_capture analysis has any entries in it.

Writeback for closure_min_captures will be implemented in
rust-lang/project-rfc-2229#18
compiler/rustc_typeck/src/expr_use_visitor.rs