about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/mod.rs
AgeCommit message (Collapse)AuthorLines
2025-09-19autodiff: typetree recursive depth query from enzyme with fallbackKaran Janthe-14/+7
Signed-off-by: Karan Janthe <karanjanthe@gmail.com>
2025-09-19autodiff: recurion added for typetreeKaran Janthe-8/+68
2025-09-19autodiff: fixed test to be more precise for type tree checkingKaran Janthe-27/+9
2025-09-19autodiff: struct support in typetreeKaran Janthe-0/+32
2025-09-19autodiff: tuple support in typetreeKaran Janthe-0/+36
2025-09-19autodiff: slice support in typetreeKaran Janthe-0/+7
2025-09-19autodiff: add TypeTree support for arraysKaran Janthe-1/+41
2025-09-19added typetree support for memcpyKaran Janthe-2/+2
2025-09-19Add TypeTree metadata attachment for autodiffKaran Janthe-13/+6
- Add F128 support to TypeTree Kind enum - Implement TypeTree FFI bindings and conversion functions - Add typetree.rs module for metadata attachment to LLVM functions - Integrate TypeTree generation with autodiff intrinsic pipeline - Support scalar types: f32, f64, integers, f16, f128 - Attach enzyme_type attributes as LLVM string metadata for Enzyme Signed-off-by: Karan Janthe <karanjanthe@gmail.com>
2025-09-19autodiff: Add basic TypeTree with NoTT flagKaran Janthe-0/+80
Signed-off-by: Karan Janthe <karanjanthe@gmail.com>
2025-09-17Remove ImplSubjectCameron Steffen-6/+0
2025-09-12Split AssocContainer::{InherentImpl,TraitImpl}Cameron Steffen-12/+3
2025-09-12Rename AssocItemContainer -> AssocContainerCameron Steffen-2/+2
2025-09-12Introduce trait_item_ofCameron Steffen-0/+9
2025-09-08Move `rustc_middle::MaxUniverse` to `rustc_infer`.Nicholas Nethercote-1/+0
Because `rust_infer` is the only crate that uses it.
2025-08-25fold regions, don't eraselcnr-3/+4
erase regions also anonymizes bound vars, which is undesirable
2025-08-22Refactor lint buffering to avoid requiring a giant enumJosh Triplett-2/+1
Lint buffering currently relies on a giant enum `BuiltinLintDiag` containing all the lints that might potentially get buffered. In addition to being an unwieldy enum in a central crate, this also makes `rustc_lint_defs` a build bottleneck: it depends on various types from various crates (with a steady pressure to add more), and many crates depend on it. Having all of these variants in a separate crate also prevents detecting when a variant becomes unused, which we can do with a dedicated type defined and used in the same crate. Refactor this to use a dyn trait, to allow using `LintDiagnostic` types directly. This requires boxing, but all of this is already on the slow path (emitting an error). Because the existing `BuiltinLintDiag` requires some additional types in order to decorate some variants, which are only available later in `rustc_lint`, use an enum `DecorateDiagCompat` to handle both the `dyn LintDiagnostic` case and the `BuiltinLintDiag` case.
2025-08-13Cleanup assoc parent utilsCameron Steffen-5/+34
2025-08-08remove unnecessary `TypeFoldable` implslcnr-0/+2
2025-08-06Add support for shortening `Instance` and use itEsteban Küber-1/+1
Replace ad-hoc type path shortening logic for recursive mono instantiation errors to use `tcx.short_string()` instead.
2025-08-03Auto merge of #144677 - nnethercote:bound-const-handling, r=lcnrbors-7/+16
Improve bound const handling A few changes to make const handling more similar to type handling. r? `@compiler-errors` -errors
2025-07-31Rollup merge of #144726 - jdonszelmann:move-attr-data-structures, r=lcnrJana Dönszelmann-5/+5
merge rustc_attr_data_structures into rustc_hir this move was discussed on zulip: [#t-compiler > attribute parsing rework @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/attribute.20parsing.20rework/near/528530091) Many PRs in the attribute rework depend on this move.
2025-07-31Rollup merge of #144712 - nnethercote:dedup-num-types, r=fmeaseJana Dönszelmann-53/+0
Deduplicate `IntTy`/`UintTy`/`FloatTy`. There are identical definitions in `rustc_type_ir` and `rustc_ast`. This commit removes them and places a single definition in `rustc_ast_ir`. This requires adding `rust_span` as a dependency of `rustc_ast_ir`, but means a bunch of silly conversion functions can be removed. r? `@fmease`
2025-07-31remove rustc_attr_data_structuresJana Dönszelmann-5/+5
2025-07-31Deduplicate `IntTy`/`UintTy`/`FloatTy`.Nicholas Nethercote-53/+0
There are identical definitions in `rustc_type_ir` and `rustc_ast`. This commit removes them and places a single definition in `rustc_ast_ir`. This requires adding `rust_span` as a dependency of `rustc_ast_ir`, but means a bunch of silly conversion functions can be removed. The one annoying wrinkle is that the old version had differences in their `Debug` impls, e.g. one printed `u32` while the other printed `U32`. Some compiler error messages rely on the former (yuk), and some clippy output depends on the latter. So the commit also changes clippy to not rely on `Debug` and just implement what it needs itself.
2025-07-31Check consts in `ValidateBoundVars`.Nicholas Nethercote-2/+2
Alongside the existing type and region checking.
2025-07-31Make const bound handling more like types/regions.Nicholas Nethercote-7/+16
Currently there is `Ty` and `BoundTy`, and `Region` and `BoundRegion`, and `Const` and... `BoundVar`. An annoying inconsistency. This commit repurposes the existing `BoundConst`, which was barely used, so it's the partner to `Const`. Unlike `BoundTy`/`BoundRegion` it lacks a `kind` field but it's still nice to have because it makes the const code more similar to the ty/region code everywhere. The commit also removes `impl From<BoundVar> for BoundTy`, which has a single use and doesn't seem worth it. These changes fix the "FIXME: We really should have a separate `BoundConst` for consts".
2025-07-31Auto merge of #144723 - Zalathar:rollup-f9e0rfo, r=Zalatharbors-100/+3
Rollup of 3 pull requests Successful merges: - rust-lang/rust#144657 (fix: Only "close the window" when its the last annotated file) - rust-lang/rust#144665 (Re-block SRoA on SIMD types) - rust-lang/rust#144713 (`rustc_middle::ty` cleanups) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-31Fix up size asserts.Nicholas Nethercote-12/+0
- Put them in the module that defines the type. - Add some `WithCachedTypeInfo<T>` asserts for consistency.
2025-07-31Move `InferVarInfo` out of `rustc_middle`.Nicholas Nethercote-13/+0
It's only used in `rustc_hir_typeck`.
2025-07-31Remove `TyCtxt::get_attrs_unchecked`.Nicholas Nethercote-10/+2
It's identical to `TyCtxt::get_all_attrs` except it takes `DefId` instead of `impl Into<DefIf>`.
2025-07-31Remove `ParamEnvAnd::into_parts`.Nicholas Nethercote-6/+0
The fields are public, so this doesn't need a method, normal deconstruction and/or field access is good enough.
2025-07-31Move `TermVid` out of `rustc_middle`.Nicholas Nethercote-18/+0
It's only used in `rustc_infer`.
2025-07-31Move `rustc_middle::parameterized` to `rustc_metadata`.Nicholas Nethercote-2/+0
It's only used there.
2025-07-31Move `ParamTerm` out of `rustc_middle`.Nicholas Nethercote-15/+0
It's only used in `rustc_hir_typeck`.
2025-07-31Move an `EarlyParamRegion` impl block.Nicholas Nethercote-9/+1
Next to all the other `EarlyParamRegion` pieces.
2025-07-31Move `ImplHeader` out of `rustc_middle`.Nicholas Nethercote-12/+0
It's not used in `rustc_middle`, and `rustc_trait_selection` is a better place for it.
2025-07-31Move `ResolverOutputs` out of `rustc_middle`.Nicholas Nethercote-5/+0
It's not used in `rustc_middle`, and `rustc_resolve` is a better place for it.
2025-07-28Tweak docsCameron Steffen-5/+4
2025-07-28Rename impl_of_method -> impl_of_assocCameron Steffen-1/+1
2025-07-28Rename trait_of_item -> trait_of_assocCameron Steffen-2/+2
2025-07-28Introduce assoc_parentCameron Steffen-14/+7
2025-07-28Remove TraitAlias from trait_of_itemCameron Steffen-1/+1
This is dead code.
2025-07-26Use the new attributes throughout the codebaseJonathan Brouwer-1/+4
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-15Add alias for ArgOutlivesPredicateMichael Goulet-1/+1
2025-07-15Define datastructures for `#[cfg]` attribute, move StrippedCfgItemJonathan Brouwer-2/+1
2025-07-14Auto merge of #143779 - JonathanBrouwer:automatically_derived_parser, r=oli-obkbors-2/+2
Port `#[automatically_derived]` to the new attribute parsing infrastructure Ports `#[automatically_derived]` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971351163 r? `@oli-obk` cc `@jdonszelmann`
2025-07-13Generalize TyCtxt::item_name.Camille GILLOT-4/+8
2025-07-12Port `#[automatically_derived]` to the new attribute parsing infrastructureJonathan Brouwer-2/+2
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-09Port `#[const_trait]` to the new attribute systemPavel Grigorenko-7/+4