about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src/nll.rs
AgeCommit message (Collapse)AuthorLines
2025-08-08borrowck: defer opaque type errorslcnr-5/+0
2025-08-07move `type_check` out of `compute_regions`lcnr-34/+12
2025-07-08Expose nested bodies in rustc_borrowck::consumersNico Lehmann-4/+2
2025-07-04Remove Symbol for Named LateParam/Bound variantsMichael Goulet-2/+2
2025-06-05Auto merge of #140466 - amandasystems:move-to-preprocessing-step, r=lcnrbors-3/+14
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-2/+2
Co-authored-by: lcnr <rust@lcnr.de>
2025-06-03Move placeholder handling to a proper preprocessing stepAmanda Stjerna-3/+14
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-5/+1
This dataflow analysis is only used by `liveness::trace`. We move it there to make it lazy.
2025-04-11eagerly initialize `definitions` in sub-fnlcnr-12/+2
2025-04-11do not buffer `#[rustc_regions]` dumplcnr-5/+2
2025-04-08move `ClosureRegionRequirements` to `rustc_borrowck`lcnr-5/+5
2025-04-08borrowck typeck children together with their parentlcnr-13/+6
2025-03-26Add environment variable tracking in places where it was convenientMads Marquart-4/+3
This won't work with Cargo's change tracking, but it should work with incremental.
2025-03-19merge opaque types of nested bodieslcnr-9/+11
2025-01-31record boring locals in polonius contextRémy Rakic-1/+1
this is used in diagnostics to focus on relevant live locals to match NLL diagnostics
2025-01-31create context for errors and diagnostics for last borrowck phaseRémy Rakic-5/+6
2025-01-12replace location-insensitive analysis with location-sensitive analysisRémy Rakic-1/+1
we're in in the endgame now set up the location-sensitive analysis end to end: - stop recording inflowing loans and loan liveness in liveness - replace location-insensitive liveness data with live loans computed by reachability - remove equivalence between polonius scopes and NLL scopes, and only run one scope computation
2025-01-12introduce reachability to the constraint graphRémy Rakic-5/+5
2025-01-08rename `AllFacts` to `PoloniusFacts`Rémy Rakic-10/+12
This is another strangely named struct (and associated fields) that is hard to see was related to datalog polonius.
2025-01-08rename `LocationTable` to `PoloniusLocationTable`Rémy Rakic-2/+2
Its original naming hides the fact that it's related to datalog polonius, and bound to be deleted in the near future. It also conflicts with the expected name for the actual NLL location map, and prefixing it with its use will make the differentiation possible.
2025-01-08stop calling `DenseLocationMap` "elements"Rémy Rakic-3/+3
"Elements" are `RegionElement`s. The dense location mapping was removed from the element containers a while ago but didn't rename its use-sites. Most of the old naming only used the mapping, and are better named `location_map`.
2025-01-01localize typeck constraintsRémy Rakic-3/+3
it's still partially a skeleton, but works well enough for almost all tests to pass
2024-12-30rename `diags` fieldRémy Rakic-2/+2
2024-12-30clean up `BorrowckDiags`Rémy Rakic-2/+2
- rename it to what it does, buffer diagnostics - remove single-use functions - use derives
2024-12-30merge `diags` module into `diagnostics`Rémy Rakic-2/+2
it's a more natural place for diagnostics-related structures and functions
2024-12-30move `facts` module to polonius legacy moduleRémy Rakic-4/+1
this is specific to the old datalog implementation and wasn't noticed in the previous module move
2024-12-30move `location` module to polonius legacy moduleRémy Rakic-1/+1
this is specific to the old datalog implementation and wasn't noticed in the previous module move
2024-12-30fix a couple nitsRémy Rakic-2/+2
- remove unneeded type ascription - fix variable name - fix typo in comment - fix `var_origins` var and function name: these are `VarInfos`
2024-12-29introduce polonius contextRémy Rakic-19/+20
This context struct will hold data to help creating localized constraints: - the live regions, with the shape matching a CFG walk, indexed per point - the variance of these live regions, represented as the direction we'll add the appropriate We also add this structure to the mir typeck to record liveness data, and make it responsible for localized constraint creation.
2024-12-18address review commentsRémy Rakic-10/+7
- move constraints to an Option - check `-Zpolonius=next` only once - rewrite fixme comments to make the actionable part clear
2024-12-18extract main NLL MIR dump functionRémy Rakic-34/+46
this will allow calling from polonius MIR
2024-12-18set up skeleton for localized constraints conversionRémy Rakic-0/+17
2024-12-18Auto merge of #134243 - nnethercote:re-export-more-rustc_span, r=jieyouxubors-1/+1
Re-export more `rustc_span::symbol` things from `rustc_span`. `rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers to `rustc_span::`. This is a 300+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one. r? `@jieyouxu`
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-1/+1
`rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers in `compiler/` to `rustc_span::`. This is a 200+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
2024-12-15simplify `emit_outlives_facts`Rémy Rakic-0/+1
- integrate into `emit_facts` and remove from typeck
2024-12-14move datalog fact generation into a legacy moduleRémy Rakic-1/+1
2024-11-19Pass `flow_inits` by value.Nicholas Nethercote-1/+1
It's simpler that way, and we don't need the explicit `drop`.
2024-11-19Put `param_env` into `infcx`.Nicholas Nethercote-5/+2
Because they get passed around together a lot.
2024-11-19Pass `constraints` to `RegionInferenceContext::new`.Nicholas Nethercote-26/+2
Instead of destructuring it in advance and passing all the components individually. It's less code that way.
2024-11-19Don't refcount `PlaceholderIndices`.Nicholas Nethercote-1/+0
It's not necessary.
2024-11-19Compute `upvars` lazily.Nicholas Nethercote-2/+0
It can be computed from `tcx` on demand, instead of computing it eagerly and passing it around.
2024-11-19Clean up `UniversalRegions`.Nicholas Nethercote-6/+2
There is an `Rc<UniversalRegions>` within `UniversalRegionRelations`, and yet the two types get passed around in tandem a lot. This commit makes `UniversalRegionRelations` own `UniversalRegions`, removing the `Rc` (which wasn't truly needed) and the tandem-passing. This requires adding a `universal_relations` method to `UniversalRegionRelations`, and renaming a couple of existing methods producing iterators to avoid a name clash.
2024-10-28fix clippy::clone_on_ref_ptr for compilerklensy-2/+2
2024-10-12yeet some clonesMatthias Krüger-1/+1
2024-10-04Avoid `&Rc<T>` arguments.Nicholas Nethercote-4/+4
Either `&T` or `Rc<T>` is preferable.
2024-10-04Use `Box` instead of `Rc` for `polonius_output`.Nicholas Nethercote-2/+2
Refcounting isn't needed.
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-5/+5
2024-09-09Rename some lifetimes.Nicholas Nethercote-3/+3
Give them the names used in most places.
2024-09-09Remove unnecessary lifetimes in dataflow structs.Nicholas Nethercote-2/+2
There are four related dataflow structs: `MaybeInitializedPlaces`, `MaybeUninitializedPlaces`, and `EverInitializedPlaces`, `DefinitelyInitializedPlaces`. They all have a `&Body` and a `&MoveData<'tcx>` field. The first three use different lifetimes for the two fields, but the last one uses the same lifetime for both. This commit changes the first three to use the same lifetime, removing the need for one of the lifetimes. Other structs that also lose a lifetime as a result of this are `LivenessContext`, `LivenessResults`, `InitializationData`. It then does similar things in various other structs.
2024-08-31Rollup merge of #129767 - nnethercote:rm-extern-crate-tracing-4, r=jieyouxuMatthias Krüger-0/+1
Remove `#[macro_use] extern crate tracing`, round 4 Because explicit importing of macros via use items is nicer (more standard and readable) than implicit importing via #[macro_use]. Continuing the work from #124511, #124914, and #125434. After this PR no `rustc_*` crates use `#[macro_use] extern crate tracing` except for `rustc_codegen_gcc` which is a special case and I will do separately. r? ```@jieyouxu```