summaryrefslogtreecommitdiff
path: root/compiler/rustc_mir_transform/src/coverage/tests.rs
Commit message (Collapse)AuthorAgeFilesLines
* Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle2023-04-241-1/+1
|
* Refactor unwind from Option to a new enumGary Guo2023-04-061-1/+1
|
* Rename `IndexVec::last` → `last_index`Scott McMurray2023-03-291-1/+1
| | | | | | | | As I've been trying to replace a `Vec` with an `IndexVec`, having `last` exist on both but returning very different types makes the transition a bit awkward -- the errors are later, where you get things like "there's no `ty` method on `mir::Field`" rather than a more localized error like "hey, there's no `last` on `IndexVec`". So I propose renaming `last` to `last_index` to help distinguish `Vec::last`, which returns an element, and `IndexVec::last_index`, which returns an index. (Similarly, `Iterator::last` also returns an element, not an index.)
* Remove DropAndReplace terminatorGiacomo Pasini2023-03-071-2/+0
| | | | | PR 107844 made DropAndReplace unused, let's remove it completely from the codebase.
* Add missing anonymous lifetimeJeremy Stucki2022-12-201-1/+1
|
* rustc: Remove needless lifetimesJeremy Stucki2022-12-201-1/+1
|
* Remove unneeded field from `SwitchTargets`Jakob Degen2022-12-091-4/+1
|
* Replace `Body::basic_blocks()` with field accessTomasz Miąsko2022-08-261-3/+3
|
* Make MIR basic blocks field publicTomasz Miąsko2022-07-071-0/+1
| | | | | | | | | | | | This makes it possible to mutably borrow different fields of the MIR body without resorting to methods like `basic_blocks_local_decls_mut_and_var_debug_info`. To preserve validity of control flow graph caches in the presence of modifications, a new struct `BasicBlocks` wraps together basic blocks and control flow graph caches. The `BasicBlocks` dereferences to `IndexVec<BasicBlock, BasicBlockData>`. On the other hand a mutable access requires explicit `as_mut()` call.
* Make TyCtxt implement Interner, make HashStable generic and move to ↵Michael Goulet2022-05-281-2/+2
| | | | rustc_type_ir
* Initial fixes on top of type interner commitMichael Goulet2022-05-281-2/+4
|
* Refactor call terminator to always hold a destination placeJakob Degen2022-05-231-3/+4
|
* Overhaul `TyS` and `Ty`.Nicholas Nethercote2022-02-151-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically, change `Ty` from this: ``` pub type Ty<'tcx> = &'tcx TyS<'tcx>; ``` to this ``` pub struct Ty<'tcx>(Interned<'tcx, TyS<'tcx>>); ``` There are two benefits to this. - It's now a first class type, so we can define methods on it. This means we can move a lot of methods away from `TyS`, leaving `TyS` as a barely-used type, which is appropriate given that it's not meant to be used directly. - The uniqueness requirement is now explicit, via the `Interned` type. E.g. the pointer-based `Eq` and `Hash` comes from `Interned`, rather than via `TyS`, which wasn't obvious at all. Much of this commit is boring churn. The interesting changes are in these files: - compiler/rustc_middle/src/arena.rs - compiler/rustc_middle/src/mir/visit.rs - compiler/rustc_middle/src/ty/context.rs - compiler/rustc_middle/src/ty/mod.rs Specifically: - Most mentions of `TyS` are removed. It's very much a dumb struct now; `Ty` has all the smarts. - `TyS` now has `crate` visibility instead of `pub`. - `TyS::make_for_test` is removed in favour of the static `BOOL_TY`, which just works better with the new structure. - The `Eq`/`Ord`/`Hash` impls are removed from `TyS`. `Interned`s impls of `Eq`/`Hash` now suffice. `Ord` is now partly on `Interned` (pointer-based, for the `Equal` case) and partly on `TyS` (contents-based, for the other cases). - There are many tedious sigil adjustments, i.e. adding or removing `*` or `&`. They seem to be unavoidable.
* rustc_mir_itertools: Avoid needless `collect` with itertoolsMateusz Mikuła2022-01-221-4/+1
|
* Remove `in_band_lifetimes` from `rustc_mir_transform`Scott McMurray2021-12-071-4/+4
| | | | | | | | | | | | | | | | | | | This one is a heavy `'tcx` user. Two interesting ones: This one had the `'tcx` declared on the function, despite the trait taking a `'tcx`: ```diff -impl Visitor<'_> for UsedLocals { +impl<'tcx> Visitor<'tcx> for UsedLocals { fn visit_statement(&mut self, statement: &Statement<'tcx>, location: Location) { ``` This one use in-band for one, and underscore for the other: ```diff -pub fn remove_dead_blocks(tcx: TyCtxt<'tcx>, body: &mut Body<'_>) { +pub fn remove_dead_blocks<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { ```
* Move rustc_mir::transform to rustc_mir_transform.Camille GILLOT2021-09-071-0/+721