about summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow/src/elaborate_drops.rs
AgeCommit message (Collapse)AuthorLines
2025-02-14Move drop elaboration infrastructure.Nicholas Nethercote-1042/+0
`rustc_mir_dataflow/src/elaborate_drops.rs` contains some infrastructure used by a few MIR passes: the `elaborate_drop` function, the `DropElaborator` trait, etc. `rustc_mir_transform/src/elaborate_drops.rs` (same file name, different crate) contains the `ElaborateDrops` pass. It relies on a lot of the infrastructure from `rustc_mir_dataflow/src/elaborate_drops.rs`. It turns out that the drop infrastructure is only used in `rustc_mir_transform`, so this commit moves it there. (The only exception is the small `DropFlagState` type, which is moved to the existing `rustc_mir_dataflow/src/drop_flag_effects.rs`.) The file is renamed from `rustc_mir_dataflow/src/elaborate_drops.rs` to `rustc_mir_transform/src/elaborate_drop.rs` (with no trailing `s`) because (a) the `elaborate_drop` function is the most important export, and (b) `rustc_mir_transform/src/elaborate_drops.rs` already exists. All the infrastructure pieces that used to be `pub` are now `pub(crate)`, because they are now only used within `rustc_mir_transform`.
2025-02-08Rustfmtbjorn3-12/+18
2025-01-28Represent the raw pointer for a array length check as a new kind of fake borrowMichael Goulet-2/+2
2024-12-14Use `PtrMetadata` instead of `Len` in slice drop shimsScott McMurray-9/+66
2024-11-18use `TypingEnv` when no `infcx` is availablelcnr-7/+6
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-10-27compiler: Add rustc_abi dependence to the compilerJubilee Young-1/+1
Depend on rustc_abi in compiler crates that use it indirectly but have not yet taken on that dependency, and are not entangled in my other PRs. This leaves an "excise rustc_target" step after the dust settles.
2024-10-19Get rid of const eval_* and try_eval_* helpersMichael Goulet-1/+1
2024-10-04Fix some pub(crate) that were undetected bc of instrumentMichael Goulet-1/+1
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-20/+14
2024-09-13Rename some lifetimes.Nicholas Nethercote-3/+3
Giving them more typical names.
2024-08-18rename AddressOf -> RawBorrow inside the compilerRalf Jung-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-3/+3
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-21Save 2 pointers in `TerminatorKind` (96 → 80 bytes)Scott McMurray-4/+2
These things don't need to be `Vec`s; boxed slices are enough. The frequent one here is call arguments, but MIR building knows the number of arguments from the THIR, so the collect is always getting the allocation right in the first place, and thus this shouldn't ever add the shrink-in-place overhead.
2024-06-14Use is_lang_item more aggressivelyMichael Goulet-2/+1
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_mir_dataflow`.Nicholas Nethercote-0/+1
2024-05-02Inline & delete `Ty::new_unit`, since it's just a field accessWaffle Lapkin-1/+1
2024-04-29Remove `extern crate rustc_middle` from numerous crates.Nicholas Nethercote-0/+1
2024-04-03rustc_index: Add a `ZERO` constant to index typesVadim Petrochenkov-5/+5
It is commonly used.
2024-03-22Eagerly convert some ctors to use their specialized ctorsMichael Goulet-7/+2
2024-02-06Add CoroutineClosure to TyKind, AggregateKind, UpvarArgsMichael Goulet-0/+3
2024-01-15compiler: Lower fn call arg spans down to MIRMartin Nordholts-1/+6
To enable improved accuracy of diagnostics in upcoming commits.
2023-12-28Remove movability from TyKind::CoroutineMichael Goulet-1/+1
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-9/+5
`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-10-20s/generator/coroutine/Oli Scherer-5/+5
2023-10-20s/Generator/Coroutine/Oli Scherer-1/+1
2023-09-28Some tracing cleanupsOli Scherer-4/+3
2023-09-21rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::ConstRalf Jung-2/+2
2023-08-24when terminating during unwinding, show the reason whyRalf Jung-1/+1
2023-08-01Use upvar_tys in more places, make it a listMichael Goulet-8/+2
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-21/+25
2023-07-05Move `TyCtxt::mk_x` to `Ty::new_x` where applicableBoxy-5/+8
2023-06-20merge `BorrowKind::Unique` into `BorrowKind::Mut`Ziru Niu-1/+1
2023-06-18Better error for non const `PartialEq` call generated by `match`Deadbeef-1/+1
2023-06-16remove box_free and replace with drop implDrMeepster-74/+26
2023-05-25Remove DesugaringKind::Replace.Camille GILLOT-2/+8
2023-05-10don't inline polymorphic adt instances whose fields contain projectionsb-naber-8/+3
in DropGlue.
2023-04-28dont expect normalization to succeed in elaborate_dropsb-naber-3/+9
2023-04-24Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle-1/+1
2023-04-06Revert box_free unwind actionGary Guo-1/+5
2023-04-06Add `UnwindAction::Terminate`Gary Guo-2/+2
2023-04-06Add `UnwindAction::Unreachable`Gary Guo-1/+1
This also makes eval machine's `StackPopUnwind` redundant so that is replaced.
2023-04-06Refactor unwind from Option to a new enumGary Guo-8/+8
2023-04-02Auto merge of #109008 - clubby789:drop-elaborate-array, r=davidtwcobors-18/+54
Drop array patterns using subslices Fixes #109004 Drops contiguous subslices of an array when moving elements out with a pattern, which improves perf for large arrays r? `@compiler-errors`
2023-03-30Update `ty::VariantDef` to use `IndexVec<FieldIdx, FieldDef>`Scott McMurray-3/+3
And while doing the updates for that, also uses `FieldIdx` in `ProjectionKind::Field` and `TypeckResults::field_indices`. There's more places that could use it (like `rustc_const_eval` and `LayoutS`), but I tried to keep this PR from exploding to *even more* places. Part 2/? of https://github.com/rust-lang/compiler-team/issues/606
2023-03-28Move `mir::Field` → `abi::FieldIdx`Scott McMurray-9/+9
The first PR for https://github.com/rust-lang/compiler-team/issues/606 This is just the move-and-rename, because it's plenty big-and-bitrotty already. Future PRs will start using `FieldIdx` more broadly, and concomitantly removing `FieldIdx::new`s.
2023-03-25Refactor: `VariantIdx::from_u32(0)` -> `FIRST_VARIANT`Scott McMurray-3/+3
Since structs are always `VariantIdx(0)`, there's a bunch of files where the only reason they had `VariantIdx` or `vec::Idx` imported at all was to get the first variant. So this uses a constant for that, and adds some doc-comments to `VariantIdx` while I'm there, since it doesn't have any today.
2023-03-17Drop subslices of arraysclubby789-18/+54
2023-03-14Use index based drop loop for slices and arraysTomasz Miąsko-101/+32
Instead of building two kinds of drop pair loops, of which only one will be eventually used at runtime in a given monomorphization, always use index based loop.
2023-02-14s/eval_usize/eval_target_usize/ for clarityOli Scherer-1/+1
2022-12-14Remove one more usage of `mk_substs_trait`Oli Scherer-2/+6