about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src/dataflow.rs
AgeCommit message (Collapse)AuthorLines
2023-06-28Rollup merge of #112236 - cjgillot:interval-kill, r=davidtwcoDylan DPC-51/+43
Simplify computation of killed borrows Follow-up to https://github.com/rust-lang/rust/pull/111759 Processing the first block manually once makes the pre-order walk simpler.
2023-06-08Auto merge of #108293 - Jarcho:mut_analyses, r=eholkbors-9/+9
Take MIR dataflow analyses by mutable reference The main motivation here is any analysis requiring dynamically sized scratch memory to work. One concrete example would be pointer target tracking, where tracking the results of a dereference can result in multiple possible targets. This leads to processing multi-level dereferences requiring the ability to handle a changing number of potential targets per step. A (simplified) function for this would be `fn apply_deref(potential_targets: &mut Vec<Target>)` which would use the scratch space contained in the analysis to send arguments and receive the results. The alternative to this would be to wrap everything in a `RefCell`, which is what `MaybeRequiresStorage` currently does. This comes with a small perf cost and loses the compiler's guarantee that we don't try to take multiple borrows at the same time. For the implementation: * `AnalysisResults` is an unfortunate requirement to avoid an unconstrained type parameter error. * `CloneAnalysis` could just be `Clone` instead, but that would result in more work than is required to have multiple cursors over the same result set. * `ResultsVisitor` now takes the results type on in each function as there's no other way to have access to the analysis without cloning it. This could use an associated type rather than a type parameter, but the current approach makes it easier to not care about the type when it's not necessary. * `MaybeRequiresStorage` now no longer uses a `RefCell`, but the graphviz formatter now does. It could be removed, but that would require even more changes and doesn't really seem necessary.
2023-06-02Simplify pre-order algorithm.Camille GILLOT-51/+43
2023-05-25Auto merge of #111925 - Manishearth:rollup-z6z6l2v, r=Manishearthbors-15/+20
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-23Allow consumers to retrieve borrowck outputJonáš Fiala-15/+20
2023-05-19Leverage the interval property to precompute borrow kill points.Camille GILLOT-49/+46
2023-05-18Take MIR dataflow analyses by mutable reference.Jason Newcomb-9/+9
2023-05-09Reduce BitSet size used in `Borrows` dataflow analysisvlad20012-1/+1
2023-04-13Remove `impl ToRegionVid for RegionVid`.Nicholas Nethercote-4/+2
It's weird and unnecessary.
2023-03-15unequal → not equalgimbles-1/+1
2023-03-09Introduce a no-op PlaceMention statement for `let _ =`.Camille GILLOT-0/+1
2023-03-05Remove `allow(potential_query_instability)` from `borrowck`clubby789-4/+4
2023-01-23Create stable metric to measure long computation in Const EvalBryan Garza-0/+1
This patch adds a `MirPass` that tracks the number of back-edges and function calls in the CFG, adds a new MIR instruction to increment a counter every time they are encountered during Const Eval, and emit a warning if a configured limit is breached.
2022-12-18A few small cleanups for `newtype_index`Nilstrieb-2/+1
Remove the `..` from the body, only a few invocations used it and it's inconsistent with rust syntax. Use `;` instead of `,` between consts. As the Rust syntax gods inteded.
2022-12-18Make `#[debug_format]` an attribute in `newtype_index`Nilstrieb-1/+1
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-12-06`rustc_borrowck`: remove `ref` patternsMaybe Waffle-5/+5
2022-11-09lint auto passAndyJado-0/+2
Revert "lint auto pass" This reverts commit e58e4466384924c491a932d3f18ef50ffa5a5065.
2022-09-06Generalize the Assume intrinsic statement to a general Intrinsic statementOli Scherer-2/+1
2022-09-06Lower the assume intrinsic to a MIR statementOli Scherer-0/+1
2022-08-26Replace `Body::basic_blocks()` with field accessTomasz Miąsko-1/+1
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-1/+1
2022-05-17Change `Successors` to `impl Iterator<Item = BasicBlock>`SparrowLii-1/+1
2022-04-11Add new `Deinit` statement kindJakob Degen-0/+1
2022-03-30Spellchecking compiler codeYuri Astrakhan-2/+2
Address some spelling mistakes in strings, private function names, and function params.
2022-01-12Remove deprecated LLVM-style inline assemblyTomasz Miąsko-9/+0
2021-12-03Add initial AST and MIR support for unwinding from inline assemblyAmanieu d'Antras-4/+2
2021-10-08clippy::complexity fixesMatthias Krüger-1/+1
2021-09-07Move the dataflow framework to its own crate.Camille GILLOT-6/+6
2021-09-07Move rustc_mir::borrow_check to new crate rustc_borrowck.Camille GILLOT-0/+448