about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty
AgeCommit message (Collapse)AuthorLines
2025-08-14Revert "Remove the witness type from coroutine args"lcnr-12/+25
This reverts commit e9765781b2857da90161157a3fc523f9e1d58848.
2025-08-01Auto merge of #144458 - compiler-errors:no-witness-mini, r=lcnrbors-25/+12
Remove the witness type from coroutine *args* (without actually removing the type) This does as much of rust-lang/rust#144157 as we can without having to break rust-lang/rust#143545 and/or introduce some better way of handling higher ranked assumptions. Namely, it: * Stalls coroutines based off of the *coroutine* type rather than the witness type. * Reworks the dtorck constraint hack to not rely on the witness type. * Removes the witness type from the args of the coroutine, eagerly creating the type for nested obligations when needed (auto/clone impls). I'll experiment with actually removing the witness type in a follow-up. r? lcnr
2025-07-31Remove the witness type from coroutine argsMichael Goulet-25/+12
2025-07-31Rollup merge of #144726 - jdonszelmann:move-attr-data-structures, r=lcnrJana Dönszelmann-11/+12
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-11/+12
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-31Auto merge of #144723 - Zalathar:rollup-f9e0rfo, r=Zalatharbors-105/+37
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-14/+26
- 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-144/+0
It's only used there.
2025-07-31Remove unused `ParameterizedOverTcx` impls.Nicholas Nethercote-13/+0
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/+9
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-31Remove unused `impl_decodable_via_ref!` entries.Nicholas Nethercote-3/+0
2025-07-30Auto merge of #144577 - oli-obk:wrapping-niche, r=scottmcmbors-3/+3
Pick the largest niche even if the largest niche is wrapped around fixes rust-lang/rust#144388 r? `@scottmcm`
2025-07-29Reuse `sign_extend` helperOli Scherer-1/+1
2025-07-29Pick the largest niche even if the largest niche is wrapped aroundOli Scherer-2/+2
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-28Auto merge of #144469 - Kivooeo:chains-cleanup, r=SparrowLiibors-12/+12
Some `let chains` clean-up Not sure if this kind of clean-up is welcoming because of size, but I decided to try out one r? compiler
2025-07-28use let chains in hir, lint, mirKivooeo-12/+12
2025-07-28Rollup merge of #143607 - JonathanBrouwer:proc_macro_attrs, ↵Matthias Krüger-1/+4
r=jdonszelmann,traviscross Port the proc macro attributes to the new attribute parsing infrastructure Ports `#[proc_macro]`, `#[proc_macro_attribute]`, `#[proc_macro_derive]` and `#[rustc_builtin_macro]` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971351163 I've split this PR into commits for reviewability, and left some comments to clarify things I did 4 related attributes in one PR because they share a lot of their code and logic, and doing them separately is kind of annoying as I need to leave both the old and new parsing in place then. r? ``@oli-obk`` cc ``@jdonszelmann``
2025-07-27Auto merge of #144434 - nnethercote:preintern-ty-bounds, r=compiler-errorsbors-9/+38
Preintern some `TyKind::Bound` values The new trait solver produces a lot of these. r? `@compiler-errors`
2025-07-26Use the new attributes throughout the codebaseJonathan Brouwer-1/+4
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-26Rollup merge of #144412 - camsteffen:localkey-cell-refactors, r=petrochenkovTrevor Gross-3/+3
Small cleanup: Use LocalKey<Cell> methods more
2025-07-25Pre-intern some `TyKind::Bound` values.Nicholas Nethercote-1/+30
We already do the same thing for bound regions. This is a small perf win for the new trait solver.
2025-07-25Tweak bound region pre-interning.Nicholas Nethercote-8/+8
- Cover `DebruijnIndex(2)`, for slightly better coverage. - Rename some things, to account for other region things that were renamed.
2025-07-24Use LocalKey<Cell> methods moreCameron Steffen-3/+3
2025-07-24Rollup merge of #144094 - saethlin:codegen-the-main-fn, r=petrochenkovLeón Orell Valerian Liehr-0/+14
Ensure we codegen the main fn This fixes two bugs. The one that was identified in the linked issue is that when we have a `main` function, mono collection didn't consider it as an extra collection root. The other is that since CGU partitioning doesn't know about the call edges between the entrypoint functions, naively it can put them in different CGUs and mark them all as internal. Which would result in LLVM just deleting all of them. There was an existing hack to exclude `lang = "start"` from internalization, which I've extended to include `main`. Fixes https://github.com/rust-lang/rust/issues/144052
2025-07-24Rollup merge of #143374 - cjgillot:bare-extern-crate-map, r=petrochenkovLeón Orell Valerian Liehr-2/+5
Unquerify extern_mod_stmt_cnum. Based on https://github.com/rust-lang/rust/pull/143247 r? `````@ghost````` for perf
2025-07-23Remove useless lifetime parameter.Camille GILLOT-1/+2
2025-07-23Give an AllocId to ConstValue::Slice.Camille GILLOT-2/+14
2025-07-22Unquerify extern_mod_stmt_cnum.Camille GILLOT-2/+5
2025-07-22Rollup merge of #143373 - cjgillot:bare-unused-trait-imports, r=petrochenkovMatthias Krüger-2/+0
Unquerify maybe_unused_trait_imports. Based on https://github.com/rust-lang/rust/pull/143247 r? ```@ghost``` for perf
2025-07-21Ensure we codegen and don't internalize the entrypointBen Kimock-0/+14
2025-07-20Rollup merge of #144216 - Nadrieril:revert-pin-hack, r=compiler-errorsJacob Pratt-16/+0
Don't consider unstable fields always-inhabited This reverts the hack in https://github.com/rust-lang/rust/pull/133889 now that `Pin`'s field is no longer public. Fixes https://github.com/rust-lang/rust/issues/143468. r? ```@compiler-errors```
2025-07-20Don't consider unstable fields always-inhabitedNadrieril-16/+0
This reverts the hack in https://github.com/rust-lang/rust/pull/133889 now that `Pin`'s field is no longer public.
2025-07-20Unquerify maybe_unused_trait_imports.Camille GILLOT-2/+0
2025-07-20Rollup merge of #144148 - compiler-errors:async-print-hack, r=lqdMatthias Krüger-25/+1
Remove pretty print hack for async blocks I introduced this hack 3 years ago, but it's not needed anymore, probably due to https://github.com/rust-lang/rust/pull/104321.
2025-07-18Remove pretty print hack for async blocksMichael Goulet-25/+1
2025-07-18Auto merge of #143845 - cjgillot:stability-query, r=jieyouxubors-5/+1
Split-up stability_index query This PR aims to move deprecation and stability processing away from the monolithic `stability_index` query, and directly implement `lookup_{deprecation,stability,body_stability,const_stability}` queries. The basic idea is to: - move per-attribute sanity checks into `check_attr.rs`; - move attribute compatibility checks into the `MissingStabilityAnnotations` visitor; - progressively dismantle the `Annotator` visitor and the `stability_index` query. The first commit contains functional change, and now warns when `#[automatically_derived]` is applied on a non-trait impl block. The other commits should not change visible behaviour. Perf in https://github.com/rust-lang/rust/pull/143845#issuecomment-3066308630 shows small but consistent improvement, except for unused-warnings case. That case being a stress test, I'm leaning towards accepting the regression. This PR changes `check_attr`, so has a high conflict rate on that file. This should not cause issues for review.