Skip to content

Commit 4752c05

Browse files
committed
Auto merge of #66246 - matthewjasper:simplify-mem-cat, r=pnkfelix
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
2 parents 2539b5f + 5bc1586 commit 4752c05

11 files changed

+993
-1957
lines changed

src/librustc/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,13 @@ pub mod infer;
9696
pub mod lint;
9797

9898
pub mod middle {
99-
pub mod expr_use_visitor;
10099
pub mod cstore;
101100
pub mod dependency_format;
102101
pub mod diagnostic_items;
103102
pub mod exported_symbols;
104103
pub mod free_region;
105104
pub mod lib_features;
106105
pub mod lang_items;
107-
pub mod mem_categorization;
108106
pub mod privacy;
109107
pub mod reachable;
110108
pub mod region;

0 commit comments

Comments
 (0)