about summary refs log tree commit diff
path: root/compiler/stable_mir/src/mir/visit.rs
AgeCommit message (Collapse)AuthorLines
2025-07-14rename `stable_mir` to `rustc_public`, and `rustc_smir` to `rustc_public_bridge`Makai-588/+0
2025-07-06move `stable_mir` back to its own crate and move `rustc_internal` to ↵Makai-0/+588
the`stable_mir` crate As part of this reorganization, some traits need to be moved from `rustc_smir::context::traits` to `stable_mir::unstable::internal_cx`. These traits are specifically designed for `InternalCx` to clarify the behavior of different functions that share the same name. This move is necessary to avoid orphan rule violations.
2025-04-05let `rustc_smir` host `stable_mir` for refactoringMakai-586/+0
2025-03-28use `try_fold` instead of `fold`Yotam Ofek-1/+1
2025-03-18Add `MutMirVisitor`makai410-331/+411
Implement `make_mir_visitor` macro to generate `MirVisitor` and `MutMirVisitor`. Add `ret_local_mut()`, `arg_locals_mut()` and `inner_locals_mut()` to `Body`, specifically for `MutMirVisitor`.
2025-01-31Insert null checks for pointer dereferences when debug assertions are enabledBastian Kersting-1/+4
Similar to how the alignment is already checked, this adds a check for null pointer dereferences in debug mode. It is implemented similarly to the alignment check as a MirPass. This is related to a 2025H1 project goal for better UB checks in debug mode: https://github.com/rust-lang/rust-project-goals/pull/177.
2025-01-28Represent the raw pointer for a array length check as a new kind of fake borrowMichael Goulet-1/+1
2024-10-16Rollup merge of #131778 - practicalrs:fix_needless_lifetimes, r=jieyouxuMatthias Krüger-1/+1
Fix needless_lifetimes in stable_mir Hi, This PR fixes the following clippy warning ``` warning: the following explicit lifetimes could be elided: 'a --> compiler/stable_mir/src/mir/visit.rs:490:6 | 490 | impl<'a> PlaceRef<'a> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes = note: `#[warn(clippy::needless_lifetimes)]` on by default help: elide the lifetimes | 490 - impl<'a> PlaceRef<'a> { 490 + impl PlaceRef<'_> { | ``` Best regards, Michal
2024-10-16Fix needless_lifetimes in stable_mirMichal Piotrowski-1/+1
2024-10-14Fix match_same_arms in stable_mirMichal Piotrowski-23/+13
2024-10-03Fix needless_lifetimes in stable_mirMichal Piotrowski-2/+2
2024-08-23Introduce methods for obtaining `Location` for statements and terminatorsArtem Agvanian-4/+14
2024-08-16Add an ability to convert between `Span` and `visit::Location`Artem Agvanian-0/+6
2024-06-13smir: merge identical Constant and ConstOperand typesRalf Jung-6/+6
2024-06-04Split smir `Const` into `TyConst` and `MirConst`Boxy-8/+17
2024-01-11Add more information to `visit_projection_elem`Celina G. Val-4/+20
Without the starting place, it's hard to retrieve any useful information from visiting a projection.
2023-12-18Add the function body span to StableMIRCelina G. Val-1/+3
2023-12-13Add spread arg and missing CoroutineKindCelina G. Val-1/+1
2023-12-05Change ty_with_args to return Ty instead of ResultCelina G. Val-1/+1
Although, we would like to avoid crashes whenever possible, and that's why I wanted to make this API fallible. It's looking pretty hard to do proper validation. I think many of our APIs will unfortunately depend on the user doing the correct thing since at the MIR level we are working on, we expect types to have been checked already.
2023-11-30Change SwitchTarget representationCelina G. Val-3/+2
The new structure encodes its invariant, which reduces the likelihood of having an inconsistent representation. It is also more intuitive and user friendly. I encapsulated the structure for now in case we decide to change it back.
2023-11-22Auto merge of #118152 - matthiaskrgr:rollup-bqcck4w, r=matthiaskrgrbors-1/+27
Rollup of 5 pull requests Successful merges: - #117972 (Add VarDebugInfo to Stable MIR) - #118109 (rustdoc-search: simplify `checkPath` and `sortResults`) - #118110 (Document `DefiningAnchor` a bit more) - #118112 (Don't ICE when ambiguity is found when selecting `Index` implementation in typeck) - #118135 (Remove quotation from filename in stable_mir) Failed merges: - #118012 (Add support for global allocation in smir) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-1/+1
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-11-21de-structure variable and add stablesouz-a-4/+6
2023-11-21Add VarDebugInfo to Stable MIRouz-a-1/+25
2023-11-17better formatting for statementsOğuz Ağcayazı-1/+1
2023-11-16Fix bug on MIRVisitorCelina G. Val-2/+2
We were not iterating over all local variables due to a typo.
2023-11-10Add SMIR visitor for Places and projectionsKirby Linvill-1/+32
2023-10-30Add a stable MIR visitorCelina G. Val-0/+414
Add a few utility functions as well and extend most `mir` and `ty` ADTs to implement `PartialEq` and `Eq`.