about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src/region_infer/values.rs
AgeCommit message (Collapse)AuthorLines
2025-09-01use defining uses of all bodies to constrain non-defining useslcnr-0/+2
support non-defining uses in closures
2025-04-24Some drive-by housecleaning in `rustc_borrowck`Amanda Stjerna-1/+1
This commit picks up a few odd ends discovered during the work on #130227. It adds some documentation and renames a few methods with too generic names to describe what they actually do. It also adds some debug output that was helpful during bug hunting.
2025-02-22Greatly simplify lifetime captures in edition 2024Michael Goulet-15/+9
2025-01-12replace location-insensitive analysis with location-sensitive analysisRémy Rakic-45/+12
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-08stop calling `DenseLocationMap` "elements"Rémy Rakic-26/+27
"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-07Avoid naming variables `str`Josh Triplett-3/+3
This renames variables named `str` to other names, to make sure `str` always refers to a type. It's confusing to read code where `str` (or another standard type name) is used as an identifier. It also produces misleading syntax highlighting.
2024-12-29finish filling polonius contextRémy Rakic-0/+8
transpose liveness matrix and record live regions at the end of MIR typeck
2024-12-18introduce beginnings of polonius MIR dumpRémy Rakic-0/+5
This is mostly for test purposes to show the localized constraints until the MIR debugger is set up.
2024-11-19Don't refcount `PlaceholderIndices`.Nicholas Nethercote-3/+2
It's not necessary.
2024-11-04Reduce visibilities.Nicholas Nethercote-1/+1
2024-10-04Avoid `&Rc<T>` arguments.Nicholas Nethercote-5/+6
Either `&T` or `Rc<T>` is preferable.
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-09-11Also fix if in elseMichael Goulet-8/+4
2024-08-30Remove `#[macro_use] extern crate tracing` from `rustc_borrowck`.Nicholas Nethercote-0/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-6/+5
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-02-06Invert diagnostic lints.Nicholas Nethercote-2/+0
That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has be converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted.
2024-01-19perf: Don't track specific live points for promotedsMark Rousskov-17/+72
We don't query this information out of the promoted (it's basically a single "unit" regardless of the complexity within it) and this saves on re-initializing the SparseIntervalMatrix's backing IndexVec with mostly empty rows for all of the leading regions in the function. Typical promoteds will only contain a few regions that need up be uplifted, while the parent function can have thousands. For a simple function repeating println!("Hello world"); 50,000 times this reduces compile times from 90 to 15 seconds in debug mode. The previous implementations re-initialization led to an overall roughly n^2 runtime as each promoted initialized slots for ~n regions, now we scale closer to linearly (5000 hello worlds takes 1.1 seconds).
2024-01-07Move PointIndex to mir_dataflow.Camille GILLOT-94/+10
2023-12-01move and maintain live loans in `LivenessValues`Rémy Rakic-1/+61
Liveness data is pushed from multiple parts of NLL. Instead of changing the call sites to maintain live loans, move the latter to `LivenessValues` where this liveness data is pushed to, and maintain live loans there. This fixes the differences in polonius scopes on some CFGs where a variable was dead in tracing but as a MIR terminator its regions were marked live from "constraint generation"
2023-11-26Auto merge of #117880 - lqd:liveness-values, r=cjgillotbors-40/+45
Refactor borrowck liveness values This PR starts cleaning up `rustc_borrowck`, in particular around liveness values: - refactors simple names that make no sense anymore: either referring to older structures using region elements, or to bitset containers and values. - improves comments and fixes others - removes unused return values and unneeded generic arguments r? `@matthewjasper`
2023-11-22Replace `no_ord_impl` with `orderable`.Nicholas Nethercote-0/+1
Similar to the previous commit, this replaces `newtype_index`'s opt-out `no_ord_impl` attribute with the opt-in `orderable` attribute.
2023-11-14rename debugging support functionsRémy Rakic-7/+10
2023-11-14`LivenessValues` does not need to be generic over regionsRémy Rakic-12/+12
2023-11-14introduce `is_live_anywhere` instead of peeking into pointsRémy Rakic-5/+11
and refactor misnamed `get_elements`
2023-11-13fix docRémy Rakic-5/+3
2023-11-13regions do not contain liveness elementsRémy Rakic-4/+4
2023-11-13refer to points and not "elements", and remove unused return valueRémy Rakic-5/+4
2023-11-13add locations instead of "element"s, and remove unused return valueRémy Rakic-6/+5
2023-11-13iterate over regions and not "rows" in liveness valuesRémy Rakic-1/+1
2023-11-13stop referring to a region as a "row" in liveness valuesRémy Rakic-17/+17
2023-10-05allow access to liveness' `PointIndex`esRémy Rakic-0/+5
2023-07-25inline format!() args from rustc_codegen_llvm to the end (4)Matthias Krüger-3/+3
r? @WaffleLapkin
2023-05-25Auto merge of #111925 - Manishearth:rollup-z6z6l2v, r=Manishearthbors-1/+1
Rollup of 5 pull requests Successful merges: - #111741 (Use `ObligationCtxt` in custom type ops) - #111840 (Expose more information in `get_body_with_borrowck_facts`) - #111876 (Roll compiler_builtins to 0.1.92) - #111912 (Use `Option::is_some_and` and `Result::is_ok_and` in the compiler ) - #111915 (libtest: Improve error when missing `-Zunstable-options`) r? `@ghost` `@rustbot` modify labels: rollup
2023-05-24Use `Option::is_some_and` and `Result::is_ok_and` in the compilerMaybe Waffle-1/+1
2023-05-19Leverage the interval property to precompute borrow kill points.Camille GILLOT-0/+16
2023-04-24Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle-2/+2
2023-03-03Match unmatched backticks in compiler/ that are part of rustdocest31-1/+1
2023-02-19sccs infob-naber-1/+1
2023-02-09Cleanup free_region_relations a bitJack Huey-0/+1
2022-12-18Make `#[debug_format]` an attribute in `newtype_index`Nilstrieb-2/+4
This removes the `custom` format functionality as its only user was trivially migrated to using a normal format. If a new use case for a custom formatting impl pops up, you can add it back.
2022-11-09lint auto passAndyJado-0/+2
Revert "lint auto pass" This reverts commit e58e4466384924c491a932d3f18ef50ffa5a5065.
2022-08-26Replace `Body::basic_blocks()` with field accessTomasz Miąsko-2/+2
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-38/+44
2021-12-30Use SparseIntervalMatrix instead of SparseBitMatrixMark Rousskov-9/+11
Region inference contains several bitsets which are filled with large intervals representing liveness. These can cause excessive memory usage, and are relatively slow when growing to large sizes compared to the IntervalSet.
2021-11-03Optimize live point computationMark Rousskov-23/+5
This is just replicating the previous algorithm, but taking advantage of the bitset structures to optimize into tighter and better optimized loops. Particularly advantageous on enormous MIR blocks, which are relatively rare in practice.
2021-10-07Add check that region is live in sanitize_promotedNoble-Mushtak-9/+11
2021-09-07Move rustc_mir::borrow_check to new crate rustc_borrowck.Camille GILLOT-0/+496