about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
AgeCommit message (Collapse)AuthorLines
2025-08-14Revert "Remove the witness type from coroutine args"lcnr-12/+25
This reverts commit e9765781b2857da90161157a3fc523f9e1d58848.
2025-08-02Auto merge of #144479 - cjgillot:incr-privacy-mod, r=petrochenkovbors-2/+5
Perform check_private_in_public by module. Based on https://github.com/rust-lang/rust/pull/116316
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-34/+33
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-34/+33
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 #116316 - cjgillot:incr-privacy, r=petrochenkovbors-1/+0
Remove eval_always from check_private_in_public. This PR attempts to avoid re-computing `check_private_in_public` query. First by marking the query as non-`eval_always`, and by reducing the amount of accesses to HIR as much as possible. Latest perf https://github.com/rust-lang/rust/pull/116316#issuecomment-3094672105 shows that we manage it. The cost is extra dep-graph bookkeeping.
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-29Rollup merge of #144573 - BoxyUwU:patkind_constant_ptr_docs, r=lcnrStuart Cook-0/+2
Raw Pointers are Constant PatKinds too raw pointers can be matched on with a const pattern: ```rust const FOO: *const u8 = core::ptr::null(); fn foo(a: *const u8) { match a { FOO => (), _ => todo!(), } } ``` as far as I can tell this is represented with a `PatKind::Constant`: https://github.com/rust-lang/rust/blob/master/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs#L333-L337
2025-07-28Tweak docsCameron Steffen-5/+4
2025-07-28Rename impl_of_method -> impl_of_assocCameron Steffen-2/+2
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-28Raw Pointers are Constant PatKinds tooBoxy-0/+2
2025-07-28Auto merge of #144469 - Kivooeo:chains-cleanup, r=SparrowLiibors-29/+28
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-29/+28
2025-07-28Rollup merge of #144535 - RalfJung:abi-mismatch-err, r=compiler-errorsMatthias Krüger-1/+6
miri: for ABI mismatch errors, say which argument is the problem
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-27miri: for ABI mismatch errors, say which argument is the problemRalf Jung-1/+6
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-26Perform check_private_in_public by module.Camille GILLOT-2/+5
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-25Remove eval_always from check_private_in_public.Camille GILLOT-1/+0
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-4/+16
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-5/+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-26/+26
2025-07-23Give an AllocId to ConstValue::Slice.Camille GILLOT-32/+44
2025-07-22Unquerify extern_mod_stmt_cnum.Camille GILLOT-5/+5