about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/walk.rs
AgeCommit message (Collapse)AuthorLines
2025-04-12Move FlagComputation, PatternKind, and TypeWalker to rustc_type_irjackh726-217/+0
2025-03-06Remove the `Option` part of range ends in the HIROli Scherer-1/+1
2025-03-06Avoid having to handle an `Option` in the type systemOli Scherer-2/+2
2025-01-30introduce `ty::Value`Lukas Markeffsky-1/+1
Co-authored-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
2024-12-22Begin to implement type system layer of unsafe bindersMichael Goulet-0/+3
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-08-12Streamline some inputs/output traversals.Nicholas Nethercote-4/+2
2024-08-09Shrink `TyKind::FnPtr`.Nicholas Nethercote-3/+6
By splitting the `FnSig` within `TyKind::FnPtr` into `FnSigTys` and `FnHeader`, which can be packed more efficiently. This reduces the size of the hot `TyKind` type from 32 bytes to 24 bytes on 64-bit platforms. This reduces peak memory usage by a few percent on some benchmarks. It also reduces cache misses and page faults similarly, though this doesn't translate to clear cycles or wall-time improvements on CI.
2024-07-29Reformat `use` declarations.Nicholas Nethercote-2/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-06Remove walk_shallowMichael Goulet-17/+0
2024-06-05Add `Ty` to `ConstKind::Value`Boxy-1/+2
2024-06-05Basic removal of `Ty` from places (boring)Boxy-14/+11
2024-06-04Downsize `ty::Expr`Boxy-18/+1
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_middle`.Nicholas Nethercote-0/+1
2024-04-29Remove `extern crate smallvec` from a couple of crates.Nicholas Nethercote-1/+1
2024-04-08Actually create ranged int types in the type system.Oli Scherer-0/+9
2024-03-22Make RawPtr take Ty and Mutbl separatelyMichael Goulet-2/+2
2024-02-06Add CoroutineClosure to TyKind, AggregateKind, UpvarArgsMichael Goulet-0/+1
2023-12-28Remove movability from TyKind::CoroutineMichael Goulet-1/+1
2023-10-20s/Generator/Coroutine/Oli Scherer-2/+2
2023-09-23Remove GeneratorWitness and rename GeneratorWitnessMIR.Camille GILLOT-4/+1
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-14/+14
2023-04-18Remove `as_substs` usageMaybe Waffle-1/+1
2023-01-27Introduce GeneratorWitnessMIR.Camille GILLOT-0/+1
2022-12-26remove unused importsTakayuki Maeda-1/+1
2022-12-13Combine identical alias armsMichael Goulet-2/+1
2022-12-13Combine projection and opaque into aliasMichael Goulet-2/+2
2022-12-13squash OpaqueTy and ProjectionTy into AliasTyMichael Goulet-1/+1
2022-12-13Use ty::OpaqueTy everywhereMichael Goulet-1/+1
2022-11-25Add empty ConstKind::Abstractkadmin-0/+18
Initial pass at expr/abstract const/s Address comments Switch to using a list instead of &[ty::Const], rm `AbstractConst` Remove try_unify_abstract_consts Update comments Add edits Recurse more More edits Prevent equating associated consts Move failing test to ui Changes this test from incremental to ui, and mark it as failing and a known bug. Does not cause the compiler to ICE, so should be ok.
2022-10-18change `ConstEvaluatable` to use `ty::Const`lcnr-0/+16
2022-09-12Plumb dyn trait representation through ty::DynamicEric Holk-1/+1
2022-09-05Pack `Term` in the same way as `GenericArg`.Nicholas Nethercote-3/+3
This shrinks the `PredicateS` type, which is instanted frequently.
2022-06-14Rename the `ConstS::val` field as `kind`.Nicholas Nethercote-1/+1
And likewise for the `Const::val` method. Because its type is called `ConstKind`. Also `val` is a confusing name because `ConstKind` is an enum with seven variants, one of which is called `Value`. Also, this gives consistency with `TyS` and `PredicateS` which have `kind` fields. The commit also renames a few `Const` variables from `val` to `c`, to avoid confusion with the `ConstKind::Value` variant.
2022-05-02fix most compiler/ doctestsElliot Roberts-1/+1
2022-02-21use `List<Ty<'tcx>>` for tupleslcnr-1/+1
2022-02-15Overhaul `Const`.Nicholas Nethercote-2/+2
Specifically, rename the `Const` struct as `ConstS` and re-introduce `Const` as this: ``` pub struct Const<'tcx>(&'tcx Interned<ConstS>); ``` This now matches `Ty` and `Predicate` more closely, including using pointer-based `eq` and `hash`. Notable changes: - `mk_const` now takes a `ConstS`. - `Const` was copy, despite being 48 bytes. Now `ConstS` is not, so need a we need separate arena for it, because we can't use the `Dropless` one any more. - Many `&'tcx Const<'tcx>`/`&Const<'tcx>` to `Const<'tcx>` changes - Many `ct.ty` to `ct.ty()` and `ct.val` to `ct.val()` changes. - Lots of tedious sigil fiddling.
2022-02-15Overhaul `TyS` and `Ty`.Nicholas Nethercote-3/+3
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.
2022-01-17Add term to ExistentialProjectionkadmin-2/+5
Also prevent ICE when adding a const in associated const equality.
2022-01-15initial revertEllen-30/+11
2021-12-15Remove `in_band_lifetimes` from `rustc_middle`Aaron Hill-1/+1
See #91867 This was mostly straightforward. In several places, I take advantage of the fact that lifetimes are non-hygenic: a macro declares the 'tcx' lifetime, which is then used in types passed in as macro arguments.
2021-08-26ignore const substs in `implicit_infer`lcnr-9/+22
2021-08-26add `tcx` to `fn walk`lcnr-18/+23
2021-08-26make unevaluated const substs optionallcnr-1/+2
2021-03-20extract `ConstKind::Unevaluated` into a structlcnr-2/+2
2021-02-23Small optimizations to obligation forestkadmin-1/+1
2020-09-26MiniSet/MiniMap moved and renamed into SsoHashSet/SsoHashMapValerii Lashmanov-4/+4
It is a more descriptive name and with upcoming changes there will be nothing "mini" about them.
2020-09-23Move MiniSet to data_structuresAndreas Jonson-43/+1
remove the need for T to be copy from MiniSet as was done for MiniMap
2020-09-17Only visit types once when walking the type treeValerii Lashmanov-8/+72
This fixes #72408. Nested closures were resulting in exponential compilation time. As a performance optimization this change introduces MiniSet, which is a simple small storage optimized set.
2020-09-04Change ty.kind to a methodLeSeulArtichaut-1/+1