about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
AgeCommit message (Collapse)AuthorLines
2025-06-13collect delayed lints in hir_crate_itemsJana Dönszelmann-0/+25
2025-06-13Rollup merge of #140770 - folkertdev:custom-abi, r=tgross35Matthias Krüger-0/+1
add `extern "custom"` functions tracking issue: rust-lang/rust#140829 previous discussion: https://github.com/rust-lang/rust/issues/140566 In short, an `extern "custom"` function is a function with a custom ABI, that rust does not know about. Therefore, such functions can only be defined with `#[unsafe(naked)]` and `naked_asm!`, or via an `extern "C" { /* ... */ }` block. These functions cannot be called using normal rust syntax: calling them can only be done from inline assembly. The motivation is low-level scenarios where a custom calling convention is used. Currently, we often pick `extern "C"`, but that is a lie because the function does not actually respect the C calling convention. At the moment `"custom"` seems to be the name with the most support. That name is not final, but we need to pick something to actually implement this. r? `@traviscross` cc `@tgross35` try-job: x86_64-apple-2
2025-06-13Rollup merge of #142158 - xizheyin:141617, r=jdonszelmannMatthias Krüger-2/+2
Tracking the old name of renamed unstable library features This PR resolves the first problem of rust-lang/rust#141617 : tracking renamed unstable features. The first commit is to add a ui test, and the second one tracks the changes. I will comment on the code for clarification. r? `@jdonszelmann` There have been a lot of PR's reviewed by you lately, thanks for your time! cc `@jyn514`
2025-06-13Unimplement unsized_localsmejrs-8/+1
2025-06-13Use more slicing and slice interning over iterable interningLeón Orell Valerian Liehr-1/+1
2025-06-13[perf] Change asserts to debug ones in trait_ref_and_own_argsLeón Orell Valerian Liehr-3/+3
2025-06-12add `extern "custom"` functionsFolkert de Vries-0/+1
2025-06-12Tracking the old name of renamed unstable library attributexizheyin-2/+2
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-06-12introduce new lint infraJana Dönszelmann-6/+36
lint on duplicates during attribute parsing To do this we stuff them in the diagnostic context to be emitted after hir is constructed
2025-06-11Use `rustc_thread_pool` instead of `rustc-rayon-core`Celina G. Val-1/+1
2025-06-11Auto merge of #142358 - matthiaskrgr:rollup-fxe6m7k, r=matthiaskrgrbors-6/+4
Rollup of 9 pull requests Successful merges: - rust-lang/rust#141967 (Configure bootstrap backport nominations through triagebot) - rust-lang/rust#142042 (Make E0621 missing lifetime suggestion verbose) - rust-lang/rust#142272 (tests: Change ABIs in tests to more future-resilient ones) - rust-lang/rust#142282 (Only run `citool` tests on the `auto` branch) - rust-lang/rust#142297 (Implement `//@ needs-target-std` compiletest directive) - rust-lang/rust#142298 (Make loongarch-none target maintainers more easily pingable) - rust-lang/rust#142306 (Dont unwrap and re-wrap typing envs) - rust-lang/rust#142324 (Remove unneeded `FunctionCx` from some codegen methods) - rust-lang/rust#142328 (feat: Add `bit_width` for unsigned integer types) Failed merges: - rust-lang/rust#141639 (Expose discriminant values in stable_mir) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-11Rollup merge of #142306 - compiler-errors:nit-reveal-param-env-query, r=lcnrMatthias Krüger-6/+4
Dont unwrap and re-wrap typing envs Just a tiny tweak to make the query less awkward. r? lcnr
2025-06-11Auto merge of #141763 - lcnr:fixme-gamer, r=BoxyUwUbors-0/+4
`FIXME(-Znext-solver)` triage r? `@BoxyUwU`
2025-06-10Auto merge of #141883 - oli-obk:remove-check-mod-loops, r=nnethercotebors-5/+0
Remove check_mod_loops query and run the checks per-body instead This analysis is older than my first rustc contribution I believe. It was never querified. Ideally we'd merge it into the analysis happening within typeck anyway (typeck just uses span_delayed_bug instead of erroring), but I didn't want to do that within this PR that also moves things around and subtly changes diagnostic ordering.
2025-06-10Dont unwrap and re-wrap typing envsMichael Goulet-6/+4
2025-06-10Rollup merge of #142124 - oli-obk:transmute-cast, r=scottmcmLeón Orell Valerian Liehr-2/+0
Allow transmute casts in pre-runtime-MIR r? ``@scottmcm`` cc ``@BoxyUwU`` turns out in https://github.com/rust-lang/rust/pull/138393 I erroneously used transmute casts in https://github.com/rust-lang/rust/blob/fd3da4bebdff63b7529483ff7025986ef16bf463/compiler/rustc_mir_build/src/builder/matches/test.rs#L209 I don't think they have any issues using them before runtime, we just checked for them because we didn't have code exercising those code paths
2025-06-10Auto merge of #141451 - lcnr:canonicalize-env-cache, r=compiler-errorsbors-0/+14
cache `param_env` canonicalization BLocked on rust-lang/rust#141581
2025-06-10Remove check_mod_loops query and run the checks per-body insteadOli Scherer-5/+0
2025-06-08add `param_env` cache to canonicalizationlcnr-0/+14
2025-06-08Remove all unused feature gates from the compilerbjorn3-1/+0
2025-06-08Auto merge of #142074 - oli-obk:its-finally-gone, r=petrochenkovbors-0/+9
Remove CollectItemTypesVisitor I always felt like we were very unnecessarily walking the HIR, let's see if perf agrees There is lots to ~~improve~~ consolidate further here, as we still have 3 item wfchecks: * check_item (matching on the hir::ItemKind) * actually doing trait solver based checks (by using HIR spans) * lower_item (matching on the hir::ItemKind after loading it again??) * just ensure_ok-ing a bunch of queries * check_item_type (matching on DefKind) * some type based checks, mostly ensure_ok-ing a bunch of queries fixes rust-lang/rust#121429
2025-06-07Rollup merge of #141558 - Diggsey:db-limit-cgu-name-length, r=matthewjasperJacob Pratt-1/+26
Limit the size of cgu names when using the `-Zhuman-readable-cgu-name… …s` option Prior to this change, cgu names could be generated which would result in filenames longer than the limit imposed by the OS.
2025-06-06Rollup merge of #142112 - ada4a:patch-1, r=wesleywiserGuillaume Gomez-1/+1
fix typo
2025-06-06Auto merge of #141774 - oli-obk:naked-fn-queries, r=petrochenkovbors-4/+0
Change per-module naked fn checks to happen during typeck instead cc `@Lokathor` `@Amanieu` `@folkertdev` just seems nicer this way
2025-06-06Allow transmute casts in pre-runtime-MIROli Scherer-2/+0
2025-06-06fix typoAda Alakbarova-1/+1
2025-06-05Replace some `Option<Span>` with `Span` and use DUMMY_SP instead of NoneOli Scherer-19/+19
2025-06-05wfcheck closuresOli Scherer-0/+9
2025-06-05Auto merge of #142033 - matthiaskrgr:rollup-99lvg0j, r=matthiaskrgrbors-6/+13
Rollup of 11 pull requests Successful merges: - rust-lang/rust#141890 (Add link to correct documentation in htmldocck.py) - rust-lang/rust#141932 (Fix for async drop inside async gen fn) - rust-lang/rust#141960 (Use non-2015 edition paths in tests that do not test for their resolution) - rust-lang/rust#141968 (Run wfcheck in one big loop instead of per module) - rust-lang/rust#141969 (Triagebot: Remove `assign.users_on_vacation`) - rust-lang/rust#141985 (Ensure query keys are printed with reduced queries) - rust-lang/rust#141999 (Visit the ident in `PreciseCapturingNonLifetimeArg`.) - rust-lang/rust#142005 (Change `tag_field` to `FieldIdx` in `Variants::Multiple`) - rust-lang/rust#142017 (Fix incorrect use of "recommend" over "recommended") - rust-lang/rust#142024 (Don't refer to 'this tail expression' in expansion.) - rust-lang/rust#142025 (Don't refer to 'local binding' in extern macro.) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-04Rollup merge of #142005 - scottmcm:fieldidx-in-variantsmultiple, ↵Matthias Krüger-3/+5
r=workingjubilee Change `tag_field` to `FieldIdx` in `Variants::Multiple` It was already available as a generic parameter anyway, and it's not like we'll ever put a tag in the 5-billionth field. This is a first part of pulling smaller pieces out of rust-lang/rust#138759, so r? workingjubilee
2025-06-04Rollup merge of #141985 - compiler-errors:cycle-in-dep-graph-print, r=oli-obkMatthias Krüger-1/+6
Ensure query keys are printed with reduced queries Using `-Z query-dep-graph` and debug assertions leads to an ICE that was originally discovered in rust-lang/rust#141700: > This isn't an incremental bug per se, but instead a bug that has to do with debug printing query keys when debug assertions and `-Z query-dep-graph` is enabled. We end up printing a const (b/c we're using generic const args here) whose debug printing for -Z query-dep-graph requires invoking the same query cyclically 😃 > > I've pushed a commit which should fix this. This isn't related to the standard library changes, but instead b/c it seems to be the first usage of `feature(adt_const_params)` in the standard library that ends up being triggered in incremental tests. r? oli-obk
2025-06-04Rollup merge of #141968 - oli-obk:wfck-everything-at-once, r=wesleywiserMatthias Krüger-2/+2
Run wfcheck in one big loop instead of per module Maybe we can merge this big loop in the future with the `par_hir_body_owners` call below and run typeck only on items that didn't fail wfcheck. For now let's just see if perf likes it, as it by itself should be beneficial to parallel rustc
2025-06-03Change `tag_field` to `FieldIdx` in `Variants::Multiple`Scott McMurray-3/+5
It was already available as a generic parameter anyway, and it's not like we'll ever put a tag in the 5-billionth field.
2025-06-04Improve some `Visitor` comments.Nicholas Nethercote-0/+3
For AST/HIR/THIR visitors, explain the use of deconstruction.
2025-06-03Ensure query keys are printed with reduced queriesMichael Goulet-1/+6
2025-06-03Auto merge of #141961 - matthiaskrgr:rollup-r09j2sp, r=matthiaskrgrbors-10/+16
Rollup of 8 pull requests Successful merges: - rust-lang/rust#141724 (fix(rust-lang/rust#141141): When expanding `PartialEq`, check equality of scalar types first.) - rust-lang/rust#141833 (`tests/ui`: A New Order [2/N]) - rust-lang/rust#141861 (Switch `x86_64-msvc-{1,2}` back to Windows Server 2025 images) - rust-lang/rust#141914 (redesign stage 0 std follow-ups) - rust-lang/rust#141918 (Deconstruct values in the THIR visitor) - rust-lang/rust#141923 (Update books) - rust-lang/rust#141931 (Deconstruct values in the THIR visitor) - rust-lang/rust#141956 (Remove two trait methods from cg_ssa) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-03Run wfcheck in one big loop instead of per moduleOli Scherer-2/+2
2025-06-03Rollup merge of #141918 - ArtemIsmagilov:issue-141849, r=nnethercoteMatthias Krüger-10/+16
Deconstruct values in the THIR visitor Hi! I am a beginner rust developer. I'm trying to solve your problem rust-lang/rust#141849 I see that 2 files need to be corrected, so I’m starting with a simpler step, `compiler/rustc_middle/src/thir/visit.rs` r? `@krikera`
2025-06-03`FIXME(-Znext-solver)` triagelcnr-0/+4
Co-authored-by: Michael Goulet <michael@errs.io>
2025-06-03Deconstruct values in the THIR visitorArtemIsmagilov-10/+16
2025-06-03Move metadata object generation for dylibs to the linker codebjorn3-17/+8
This deduplicates some code between codegen backends and may in the future allow adding extra metadata that is only known at link time.
2025-06-03Rollup merge of #141936 - WaffleLapkin:report-in-deps-decoupling, r=oli-obkMatthias Krüger-3/+2
Decouple "reporting in deps" from `FutureIncompatibilityReason` The reason should just be it -- the reason. It never felt right to me that it was also responsible for whatever we include the warning in cargo's reports. It gets especially unruly if you want to add non-`FutureReleaseError*` warnings which are included in the reports. I just added a field to `FutureIncompatibleInfo` to control whatever the diagnostic is included in the cargo's reports.
2025-06-03decouple "reporting in deps" from future incompatibility reasonWaffle Lapkin-3/+2
2025-06-01Optionally don't steal the THIRNadrieril-1/+2
2025-06-01Auto merge of #141731 - compiler-errors:tweak-fast-path-trait, r=lcnrbors-4/+2
Tweak fast path trait handling (1.) Make it more sound by considering polarity (lol) (2.) Make it more general, by considering higher-ranked size/copy/clone (2.) Make it less observable, by only doing copy/clone fast path if there are no regions involved r? lcnr
2025-05-31Rollup merge of #141740 - nnethercote:hir-ItemKind-field-order, r=fee1-deadMatthias Krüger-1/+1
Hir item kind field order A follow-up to rust-lang/rust#141675. r? `@fee1-dead`
2025-05-30Move naked fn checks to hir_typeckOli Scherer-5/+0
2025-05-30Change a per-module query to just run on the items it internally filters forOli Scherer-4/+5
2025-05-30Rollup merge of #141703 - compiler-errors:deref-place, r=lcnrMatthias Krüger-36/+42
Structurally normalize types as needed in `projection_ty_core` Introduce a `structurally_normalize` callback to `projection_ty_core`, and then use it before we match on the ty kind in `projection_ty_core`. Previously we were only structurally normalizing the return type of the `handle_field` struct, but if we were to (e.g.) apply a deref projection to that type, then the resulting type is not guaranteed to be structurally normalized and any subsequent projections applied would ICE. Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/221 I'll leave a few comments inline to explain the changes. r? lcnr --- Also fixes rust-lang/rust#141708
2025-05-30Rollup merge of #141507 - RalfJung:atomic-intrinsics, r=bjorn3Matthias Krüger-3/+35
atomic_load intrinsic: use const generic parameter for ordering We have a gazillion intrinsics for the atomics because we encode the ordering into the intrinsic name rather than making it a parameter. This is particularly bad for those operations that take two orderings. Let's fix that! This PR only converts `load`, to see if there's any feedback that would fundamentally change the strategy we pursue for the const generic intrinsics. The first two commits are preparation and could be a separate PR if you prefer. `@BoxyUwU` -- I hope this is a use of const generics that is unlikely to explode? All we need is a const generic of enum type. We could funnel it through an integer if we had to but an enum is obviously nicer... `@bjorn3` it seems like the cranelift backend entirely ignores the ordering?