Simplify memory categorization With AST borrowck gone, mem_categorization can be simplified, a lot. * `cmt_` is now called `Place`. Most local variable names have been updated to reflect this, but the `cat_*` methods retain their names. * `MemCategorizationContext` no longer needs a `ScopeTree` and always needs an `InferCtxt`. * `Place` now uses a similar representation to `mir::Place` with a `Vec` of projections. * `Upvar` places don't include the implicit environment and capture derefs. These are now handled by `regionck` when needed. * Various types, methods and variants only used by AST borrowck have been removed. * `ExprUseVisitor` now lives in `rustc_typeck::expr_use_visitor`. * `MemCategorizationContext` and `Place` live in `rustc_typeck::mem_categorization`. * `Place` is re-exported in `rustc_typeck::expr_use_visitor` so that Clippy can access it. The loss of an error in `issue-4335.rs` is due to a change in capture inference in ill-formed programs. If any projection from a variable is moved from then we capture that variable by move, whether or not the place being moved from allows this. Closes #66270 |
||
|---|---|---|
| .. | ||
| benches | ||
| dep_graph | ||
| hir | ||
| ich | ||
| infer | ||
| lint | ||
| middle | ||
| mir | ||
| query | ||
| session | ||
| traits | ||
| ty | ||
| util | ||
| arena.rs | ||
| build.rs | ||
| Cargo.toml | ||
| lib.rs | ||
| macros.rs | ||
| README.md | ||
| tests.rs | ||
For more information about how rustc works, see the rustc guide.