about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/mir/statement.rs
AgeCommit message (Collapse)AuthorLines
2025-10-02mir-opt: Eliminate dead statements even if they are used by debuginfosdianqk-0/+15
2025-10-02mir-opt: Eliminate trivial unnecessary storage annotationsdianqk-10/+4
2025-10-02mir-opt: Eliminate dead ref statementsdianqk-3/+100
2025-09-26ProjectionElem::Subtype -> CastKind::Subtypebeepster4096-6/+2
2025-09-16Remove Rvalue::Len.Camille Gillot-2/+0
2025-09-05rustc_middle: clippy fixesMarijn Schouten-11/+11
2025-08-21Introduce ProjectionElem::try_map.Camille GILLOT-1/+35
2025-07-01mir: Mark `Statement` and `BasicBlockData` as `#[non_exhaustive]`dianqk-0/+1
Ensure they are always created using constructors.
2025-06-29mir: Add a `new` method to `statement`dianqk-1/+5
Avoid introducing a large number of changes when adding optional initialization fields.
2025-06-05Replace some `Option<Span>` with `Span` and use DUMMY_SP instead of NoneOli Scherer-1/+1
2025-05-29Structurally normalize types as needed in projection_ty_coreMichael Goulet-36/+42
2025-03-15Fix the OperandRef type for NullOp::{UbChecks,ContractChecks}Scott McMurray-0/+9
2025-02-24Move `impl` blocks out of `rustc_middle/src/mir/syntax.rs`.Nicholas Nethercote-0/+57
As the comment at the top says, this file is not supposed to contain any code. But some has crept in. This commit moves it out.
2025-02-19Rollup merge of #137213 - nnethercote:rm-rustc_middle-mir-tcx, r=compiler-errorsMatthias Krüger-0/+396
Remove `rustc_middle::mir::tcx` module. This is a really weird module. For example, what does `tcx` in `rustc_middle::mir::tcx::PlaceTy` mean? The answer is "not much". The top-level module comment says: > Methods for the various MIR types. These are intended for use after > building is complete. Awfully broad for a module that has a handful of impl blocks for some MIR types, none of which really relates to `TyCtxt`. `git blame` indicates the comment is ancient, from 2015, and made sense then. This module is now vestigial. This commit removes it and moves all the code within into `rustc_middle::mir::statement`. Some specifics: - `Place`, `PlaceRef`, `Rvalue`, `Operand`, `BorrowKind`: they all have `impl` blocks in both the `tcx` and `statement` modules. The commit merges the former into the latter. - `BinOp`, `UnOp`: they only have `impl` blocks in `tcx`. The commit moves these into `statement`. - `PlaceTy`, `RvalueInitializationState`: they are defined in `tcx`. This commit moves them into `statement` *and* makes them available in `mir::*`, like many other MIR types. r? `@tmandry`
2025-02-19Remove `rustc_middle::mir::tcx` module.Nicholas Nethercote-0/+396
This is a really weird module. For example, what does `tcx` in `rustc_middle::mir::tcx::PlaceTy` mean? The answer is "not much". The top-level module comment says: > Methods for the various MIR types. These are intended for use after > building is complete. Awfully broad for a module that has a handful of impl blocks for some MIR types, none of which really relates to `TyCtxt`. `git blame` indicates the comment is ancient, from 2015, and made sense then. This module is now vestigial. This commit removes it and moves all the code within into `rustc_middle::mir::statement`. Some specifics: - `Place`, `PlaceRef`, `Rvalue`, `Operand`, `BorrowKind`: they all have `impl` blocks in both the `tcx` and `statement` modules. The commit merges the former into the latter. - `BinOp`, `UnOp`: they only have `impl` blocks in `tcx`. The commit moves these into `statement`. - `PlaceTy`, `RvalueInitializationState`: they are defined in `tcx`. This commit moves them into `statement` *and* makes them available in `mir::*`, like many other MIR types.
2025-02-18Inline and replace `Statement::replace_nop`.Nicholas Nethercote-9/+0
It has a single call site, and doesn't seem worth having as an API function.
2025-01-31Implement MIR, CTFE, and codegen for unsafe bindersMichael Goulet-3/+9
2025-01-18Revert "Auto merge of #134330 - scottmcm:no-more-rvalue-len, r=matthewjasper"Rémy Rakic-0/+1
This reverts commit e108481f74ff123ad98a63bd107a18d13035b275, reversing changes made to 303e8bd768526a5812bb1776e798e829ddb7d3ca.
2025-01-01remove `allow_two_phase_borrow`Rémy Rakic-0/+2
it's been simplified over the years, but now it's no longer useful. - document its replacement in `BorrowKind` - use that everywhere instead
2024-12-22Delete `Rvalue::Len`Scott McMurray-1/+0
Everything's moved to `PtrMetadata` instead.
2024-11-18use `TypingEnv` when no `infcx` is availablelcnr-2/+2
the behavior of the type system not only depends on the current assumptions, but also the currentnphase of the compiler. This is mostly necessary as we need to decide whether and how to reveal opaque types. We track this via the `TypingMode`.
2024-09-24be even more precise about "cast" vs "coercion"Lukas Markeffsky-1/+1
2024-09-24unify dyn* coercions with other pointer coercionsLukas Markeffsky-1/+0
2024-08-18rename AddressOf -> RawBorrow inside the compilerRalf Jung-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-1/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-20Convert some module-level `//` and `///` comments to `//!`.Nicholas Nethercote-1/+2
This makes their intent and expected location clearer. We see some examples where these comments were not clearly separate from `use` declarations, which made it hard to understand what the comment is describing.
2024-05-17Remove `Rvalue::CheckedBinaryOp`Scott McMurray-1/+0
2024-04-20Add a non-shallow fake borrowNadrieril-2/+2
2024-04-20Rework fake borrow calculationNadrieril-0/+5
2024-04-03rename `expose_addr` to `expose_provenance`joboet-1/+1
2024-03-23rename MIR int2ptr casts to match library nameRalf Jung-1/+1
2023-12-07ctfe interpreter: extend provenance so that it can track whether a pointer ↵Ralf Jung-1/+1
is immutable
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-08rename `BorrowKind::Shallow` to `Fake`lcnr-2/+2
also adds some comments
2023-10-02Add docs, remove code, change subtyper codeouz-a-0/+3
2023-09-21rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::ConstRalf Jung-8/+28
2023-09-19organize mir pretty.rs and move more things into it; move statement-related ↵Ralf Jung-0/+441
things out of mir/mod.rs