about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2025-10-02Auto merge of #147138 - jackh726:split-canonical-bound, r=lcnrbors-1/+1
Split Bound index into Canonical and Bound See [#t-types/trait-system-refactor > perf `async-closures/post-mono-higher-ranked-hang.rs`](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/perf.20.60async-closures.2Fpost-mono-higher-ranked-hang.2Ers.60/with/541535613) for context Things compile and tests pass, but not sure if this actually solves the perf issue (edit: it does). Opening up this to do a perf (and maybe crater) run. r? lcnr
2025-10-02Auto merge of #147055 - beepster4096:subtype_is_not_a_projection, r=lcnrbors-4/+0
Turn ProjectionElem::Subtype into CastKind::Subtype I noticed that drop elaboration can't, in general, handle `ProjectionElem::SubType`. It creates a disjoint move path that overlaps with other move paths. (`Subslice` does too, and I'm working on a different PR to make that special case less fragile.) If its skipped and treated as the same move path as its parent then `MovePath.place` has multiple possible projections. (It would probably make sense to remove all `Subtype` projections for the canonical place but it doesn't make sense to have this special case for a problem that doesn't actually occur in real MIR.) The only reason this doesn't break is that `Subtype` is always the sole projection of the local its applied to. For the same reason, it works fine as a `CastKind` so I figured that makes more sense than documenting and validating this hidden invariant. cc rust-lang/rust#112651, rust-lang/rust#133258 r? Icnr (bc you've been the main person dealing with `Subtype` it looks like)
2025-09-30Split Bound into Canonical and Boundjackh726-1/+1
2025-09-29more renameBoxy Uwu-2/+5
2025-09-27Rename various "concrete opaque type" terminology to say "hidden type"Boxy Uwu-5/+2
2025-09-26ProjectionElem::Subtype -> CastKind::Subtypebeepster4096-4/+0
2025-09-18Rollup merge of #146664 - fmease:clean-up-dyn, r=jdonszelmannStuart Cook-2/+2
Clean up `ty::Dynamic` 1. As a follow-up to PR rust-lang/rust#143036, remove `DynKind` entirely. 2. Inside HIR ty lowering, consolidate modules `dyn_compatibility` and `lint` into `dyn_trait` * `dyn_compatibility` wasn't about dyn compatibility itself, it's about lowering trait object types * `lint` contained dyn-Trait-specific diagnostics+lints only
2025-09-17Remove `DynKind`León Orell Valerian Liehr-2/+2
2025-09-16Remove Rvalue::Len.Camille Gillot-2/+1
2025-09-01use defining uses of all bodies to constrain non-defining useslcnr-33/+84
support non-defining uses in closures
2025-08-22change HIR typeck unification handling approachlcnr-4/+10
2025-08-20handle opaque types before region inferencelcnr-5/+14
2025-08-08borrowck: defer opaque type errorslcnr-2/+6
2025-08-07move `type_check` out of `compute_regions`lcnr-4/+41
2025-07-08Expose nested bodies in rustc_borrowck::consumersNico Lehmann-24/+19
2025-06-22Init local_names lazily for borrowck diagnosticsKornel-25/+5
2025-06-13use `MixedBitSet` for borrows-in-scope computationRémy Rakic-3/+3
Some code can have a few thousand loans, and this bitset is better suited to these somewhat sparse cases. That includes a couple of rustc-perf benchmarks.
2025-06-05Auto merge of #140466 - amandasystems:move-to-preprocessing-step, r=lcnrbors-0/+1
Move placeholder handling to a proper preprocessing step This commit breaks out the logic of placheolder rewriting into its own preprocessing step. It's one of the more boring parts of #130227. The only functional change from this is that the preprocessing step (where extra `r: 'static` constraints are added) is performed upstream of Polonius legacy, finally affecting Polonius. That is mostly a by-product, though. This should be reviewable by anyone in the compiler team, so r? rust-lang/compiler
2025-06-04Use an enum for SCC representatives, plus other code reviewAmanda Stjerna-1/+1
Co-authored-by: lcnr <rust@lcnr.de>
2025-06-03Move placeholder handling to a proper preprocessing stepAmanda Stjerna-0/+1
This commit breaks out the logic of placheolder rewriting into its own preprocessing step. The only functional change from this is that the preprocessing step (where extra `r: 'static` constraints are added) is performed upstream of Polonius legacy, finally affecting Polonius. That is mostly a by-product, though.
2025-05-27move `MaybeInitializedPlaces` computation to where it's usedRémy Rakic-8/+1
This dataflow analysis is only used by `liveness::trace`. We move it there to make it lazy.
2025-05-12update cfg(bootstrap)Pietro Albini-1/+0
2025-05-07Auto merge of #140751 - GuillaumeGomez:rollup-eahw4ta, r=GuillaumeGomezbors-12/+14
Rollup of 8 pull requests Successful merges: - #140234 (Separate dataflow analysis and results) - #140614 (Correct warning message in restricted visibility) - #140671 (Parser: Recover error from named params while parse_path) - #140700 (Don't crash on error codes passed to `--explain` which exceed our internal limit of 9999 ) - #140706 ([rustdoc] Ensure that temporary doctest folder is correctly removed even if doctests failed) - #140734 (Fix regression from #140393 for espidf / horizon / nuttx / vita) - #140741 (add armv5te-unknown-linux-gnueabi target maintainer) - #140745 (run-make-support: set rustc dylib path for cargo wrapper) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-07Rollup merge of #140234 - nnethercote:separate-Analysis-and-Results, r=davidtwcoGuillaume Gomez-12/+14
Separate dataflow analysis and results `Analysis` gets put into `Results` with `EntryStates`, by `iterate_to_fixpoint`. This has two problems: - `Results` is passed various places where only `Analysis` is needed. - `EntryStates` is passed around mutably everywhere even though it is immutable. This commit mostly separates `Analysis` from `Results` and fixes these two problems. r? `@davidtwco`
2025-05-02borrowck nested items in dead codelcnr-0/+8
2025-04-28AsyncDrop implementation using shim codegen of ↵Andrew Zhogin-1/+8
async_drop_in_place::{closure}, scoped async drop added.
2025-04-25Rollup merge of #140202 - est31:let_chains_feature_compiler, r=lcnrMatthias Krüger-1/+1
Make #![feature(let_chains)] bootstrap conditional in compiler/ Let chains have been stabilized recently in #132833, so we can remove the gating from our uses in the compiler (as the compiler uses edition 2024).
2025-04-24Separate `Analysis` and `Results`.Nicholas Nethercote-9/+11
`Results` contains and `Analysis` and an `EntryStates`. The unfortunate thing about this is that the analysis needs to be mutable everywhere (`&mut Analysis`) which forces the `Results` to be mutable everywhere, even though `EntryStates` is immutable everywhere. To fix this, this commit renames `Results` as `AnalysisAndResults`, renames `EntryStates` as `Results`, and separates the analysis and results as much as possible. (`AnalysisAndResults` doesn't get much use, it's mostly there to facilitate method chaining of `iterate_to_fixpoint`.) `Results` is immutable everywhere, which: - is a bit clearer on how the data is used, - avoids an unnecessary clone of entry states in `locals_live_across_suspend_points`, and - moves the results outside the `RefCell` in Formatter. The commit also reformulates `ResultsHandle` as the generic `CowMut`, which is simpler than `ResultsHandle` because it doesn't need the `'tcx` lifetime and the trait bounds. It also which sits nicely alongside the new use of `Cow` in `ResultsCursor`.
2025-04-24Pass `Analysis` to `visit_*` instead of `Results`.Nicholas Nethercote-3/+3
Every `Results` contains an `Analysis`, but these methods only need the `Analysis`. No point passing them more data than they need.
2025-04-23Make #![feature(let_chains)] bootstrap conditional in compiler/est31-1/+1
2025-04-22Remove unnecessary lifetime on `ResultsVisitor`.Nicholas Nethercote-6/+6
2025-04-14Rollup merge of #139767 - compiler-errors:www, r=oli-obkMatthias Krüger-1/+1
Visit place in `BackwardIncompatibleDropHint` statement Remove a weird hack from the `LocalUpdater` where we were manually visiting the place stored in a `StatementKind::BackwardIncompatibleDropHint` because the MIR visitor impls weren't doing so. Also, clean up `BackwardIncompatibleDropHint`s in `CleanupPostBorrowck`, since they're not needed for runtime MIR.
2025-04-14Auto merge of #139781 - jhpratt:rollup-qadsjvb, r=jhprattbors-84/+63
Rollup of 9 pull requests Successful merges: - #138336 (Improve `-Z crate-attr` diagnostics) - #139636 (Encode dep node edge count as u32 instead of usize) - #139666 (cleanup `mir_borrowck`) - #139695 (compiletest: consistently use `camino::{Utf8Path,Utf8PathBuf}` throughout) - #139699 (Proactively update coroutine drop shim's phase to account for later passes applied during shim query) - #139718 (enforce unsafe attributes in pre-2024 editions by default) - #139722 (Move some things to rustc_type_ir) - #139760 (UI tests: migrate remaining compile time `error-pattern`s to line annotations when possible) - #139776 (Switch attrs to `diagnostic::on_unimplemented`) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-14Auto merge of #124141 - ↵bors-1/+0
nnethercote:rm-Nonterminal-and-TokenKind-Interpolated, r=petrochenkov Remove `Nonterminal` and `TokenKind::Interpolated` A third attempt at this; the first attempt was #96724 and the second was #114647. r? `@ghost`
2025-04-13Visit place in BackwardIncompatibleDropHint statementMichael Goulet-1/+1
2025-04-11don't rely on `locals_are_invalidated_at_exit`lcnr-32/+24
2025-04-11move `dump_polonius_mir`lcnr-10/+8
2025-04-11`MirBorrowckCtxt::polonius_output` to reflcnr-6/+4
2025-04-11do not buffer `#[rustc_regions]` dumplcnr-2/+2
2025-04-11`local_names` creation to `mbcx` creationlcnr-20/+20
2025-04-11use input `def_id` to compute `movable_coroutine`lcnr-11/+2
This previously incorrectly returned `true` for parent functions whose first statement was `let local = <coroutine>;`. While that didn't cause any bugs as we only ever access `movable_coroutine` for `yield` terminators. It was still wrong.
2025-04-11consistent name for `UniversalRegions`lcnr-2/+2
2025-04-08add negative impllcnr-4/+8
2025-04-08move `ClosureRegionRequirements` to `rustc_borrowck`lcnr-1/+138
2025-04-08borrowck typeck children together with their parentlcnr-49/+68
2025-04-03add `TypingMode::Borrowck`lcnr-31/+7
2025-04-02Remove `recursion_limit` increases.Nicholas Nethercote-1/+0
These are no longer needed now that `Nonterminal` is gone.
2025-04-01simplify Interner opaque types APIlcnr-1/+2
2025-04-01call `mir_promoted` inside of `do_mir_borrowck`lcnr-9/+7
2025-03-19merge opaque types of nested bodieslcnr-3/+4