about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-06-11Move rayon-core to rustc_thread_pool files as isCelina G. Val-0/+8225
This commit literally copied the directory rayon-core from revision `5fadf44`. Link: https://github.com/rust-lang/rustc-rayon/tree/5fadf44/rayon-core
2025-06-11compiler: Avoid reporting unsupported_calling_conventions in depsJubilee Young-1/+1
2025-06-11consistently rename (old) attribute groupsJana Dönszelmann-12/+14
2025-06-11document attribute parsers betterJana Dönszelmann-0/+9
2025-06-11Add expectation for `{` when parsing lone coroutine qualifiersLukas Wirth-13/+19
2025-06-11stabilize gaiBoxy-46/+6
2025-06-11Rollup merge of #142324 - scottmcm:less-functioncx, r=workingjubileeMatthias Krüger-96/+94
Remove unneeded `FunctionCx` from some codegen methods No changes; just removing the `self` that wasn't needed. r? workingjubilee cc https://github.com/rust-lang/rust/pull/138759#issuecomment-2920860686
2025-06-11Rollup merge of #142306 - compiler-errors:nit-reveal-param-env-query, r=lcnrMatthias Krüger-11/+7
Dont unwrap and re-wrap typing envs Just a tiny tweak to make the query less awkward. r? lcnr
2025-06-11Rollup merge of #142042 - estebank:explicit-lifetime-verbose-suggestion, ↵Matthias Krüger-4/+8
r=compiler-errors Make E0621 missing lifetime suggestion verbose ``` error[E0621]: explicit lifetime required in the type of `x` --> $DIR/42701_one_named_and_one_anonymous.rs:10:9 | LL | &*x | ^^^ lifetime `'a` required | help: add explicit lifetime `'a` to the type of `x` | LL | fn foo2<'a>(a: &'a Foo, x: &'a i32) -> &'a i32 { | ++ ``` Part of rust-lang/rust#141973.
2025-06-11Auto merge of #141763 - lcnr:fixme-gamer, r=BoxyUwUbors-36/+67
`FIXME(-Znext-solver)` triage r? `@BoxyUwU`
2025-06-11Fix enter_trace_span!() using wrong $crate pathsStypox-2/+2
2025-06-11move fast reject into innerlcnr-3/+4
to also fast reject inside of the folder
2025-06-11Use closure to allow passing custom tracing layersStypox-13/+29
The previous method, where a layer would be passed directly, required to pass a "no-op" layer when no custom layer was needed. This should have in theory worked, however having a no-op layer seems to change the way the tracing lib applies filters internally, leading to some debug!() being printed despite them being out of the minimum level for the filters. Note however that this behavior was very inconsistent, and e.g. some debug!() would get printed and some others wouldn't, for no apparent reason.
2025-06-11Allow initializing logger with additional tracing LayerStypox-3/+26
2025-06-11Auto merge of #141942 - ShoyuVanilla:smir-repr, r=oli-obkbors-5/+96
Implement representation options to smir Resolves rust-lang/project-stable-mir#89
2025-06-11compiler: Update all targets to the new c_int_width typeJubilee Young-7/+7
2025-06-11compiler: Change c_int_width to be an integer typeJubilee Young-19/+17
2025-06-11Remove useless and wrong std crates special casing when un-remap sysrootUrgau-28/+1
2025-06-11Auto merge of #142090 - compiler-errors:perf-stable-root-var, r=lcnrbors-17/+6
Make root vars more stable Never resolve a ty/ct vid to a higher vid as its root. This should make the optimization in rust-lang/rust#141500 more "stable" when there are a lot of vars flying around. r? `@ghost`
2025-06-10Auto merge of #141883 - oli-obk:remove-check-mod-loops, r=nnethercotebors-204/+187
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-10Remove unneeded `FunctionCx` from some codegen methodsScott McMurray-96/+94
No changes; just removing the `self` that wasn't needed.
2025-06-10Remove unneeded `check_id` calls as they are already called in `visit_id` in ↵Guillaume Gomez-2/+0
`EarlyContextAndPass` type
2025-06-10Auto merge of #142299 - fmease:rollup-u86s80a, r=fmeasebors-1340/+880
Rollup of 16 pull requests Successful merges: - rust-lang/rust#134442 (Specify the behavior of `file!`) - rust-lang/rust#140372 (Exhaustively handle parsed attributes in CheckAttr) - rust-lang/rust#140766 (Stabilize keylocker) - rust-lang/rust#141642 (Note the version and PR of removed features when using it) - rust-lang/rust#141818 (Don't create .msi installer for gnullvm hosts) - rust-lang/rust#141909 (Add central execution context to bootstrap) - rust-lang/rust#141992 (use `#[naked]` for `__rust_probestack`) - rust-lang/rust#142101 (core::ptr: deduplicate more method docs) - rust-lang/rust#142102 (docs: Small clarification on the usage of read_to_string and read_to_end trait methods) - rust-lang/rust#142124 (Allow transmute casts in pre-runtime-MIR) - rust-lang/rust#142240 (deduplicate the rest of AST walker functions) - rust-lang/rust#142258 (platform-support.md: Mention specific Linux kernel version or later) - rust-lang/rust#142262 (Mark `core::slice::memchr` as `#[doc(hidden)]`) - rust-lang/rust#142271 (compiler: fn ptrs should hit different lints based on ABI) - rust-lang/rust#142275 (rustdoc: Refractor `clean_ty_generics`) - rust-lang/rust#142288 (const_eval: fix some outdated comments) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-10Dont unwrap and re-wrap typing envsMichael Goulet-11/+7
2025-06-10Rollup merge of #142288 - RalfJung:const-eval-comments, r=oli-obkLeón Orell Valerian Liehr-12/+8
const_eval: fix some outdated comments r? ``@oli-obk``
2025-06-10Rollup merge of #142271 - workingjubilee:fn-ptrs-have-two-different-lints, ↵León Orell Valerian Liehr-16/+26
r=RalfJung compiler: fn ptrs should hit different lints based on ABI I was looking closer at the code for linting on ABIs and realized a mistake was probably made during rebase or review. I think that for function pointers in the HIR, the lint that fires should probably depend on the ABI we encountered, e.g. if it's on the newly-deprecated set of ABIs or not. This will be slightly confusing for a little bit, but I think we can do more to reduce that confusion by switching `unsupported_fn_ptr_calling_conventions` to a hard error. r? ``@RalfJung``
2025-06-10Rollup merge of #142240 - fee1-dead-contrib:push-zkkzoxlymslv, r=oli-obkLeón Orell Valerian Liehr-1165/+666
deduplicate the rest of AST walker functions After this, we can tidy things up and deduplicate the visitor traits themselves too. Fixes rust-lang/rust#139825, apparently r? ``@oli-obk``
2025-06-10Rollup merge of #142124 - oli-obk:transmute-cast, r=scottmcmLeón Orell Valerian Liehr-31/+19
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-10Rollup merge of #141992 - folkertdev:probestack-naked-function, r=tgross35León Orell Valerian Liehr-2/+3
use `#[naked]` for `__rust_probestack` Let's see if this works now. Previously this change was in https://github.com/rust-lang/compiler-builtins/pull/897, but we decided to wait until `compiler-builtins` was a subtree (and also `cfg(bootstrap)` is gone now). r? ``@tgross35`` cc ``@bjorn3`` try-job: `dist-various*` try-job: `test-various*`
2025-06-10Rollup merge of #141642 - xizheyin:issue-141619, r=BoxyUwULeón Orell Valerian Liehr-84/+114
Note the version and PR of removed features when using it Fixes rust-lang/rust#141619 I added the diagnostic information. Since all the current version information is present, it prints the version information anyway, as shown in tests/ui. And PR will not print if it is None, we can gradually add the PR links. Split into two commits for easier review. r? compiler cc ``@jyn514`` Since you're on vocation in the review list, I can't r? you.
2025-06-10Rollup merge of #140766 - sayantn:stabilize-keylocker, r=traviscross,tgross35León Orell Valerian Liehr-4/+4
Stabilize keylocker This PR stabilizes the feature flag `keylocker_x86` (tracking issue rust-lang/rust#134813). # Public API The 2 `x86` target features `kl` and `widekl`, and the associated intrinsics in stdarch. These target features are very specialized, and are only used to signal the presence of the corresponding CPU instruction. They don't have any nontrivial interaction with the ABI (contrary to something like AVX), and serve the only purpose of enabling 11 stdarch intrinsics, all of which have been implemented and propagated to rustc via a stdarch submodule update. Also, these were added way back in LLVM12, and as the minimum LLVM required for rustc is LLVM19, we are safe in that front too! # Associated PRs - rust-lang/rust#134814 - rust-lang/stdarch#1706 - rust-lang/rust#136831 (stdarch submodule update) - rust-lang/stdarch#1795 (stabilizing the runtime detection and intrinsics) - rust-lang/rust#141964 (stdarch submodule update for the stabilization of the runtime detection and intrinsics) As all of the required tasks have been done (adding the target features to rustc, implementing their runtime detection in std_detect and implementing the associated intrinsics in core_arch), these target features can be stabilized now. cc ````@rust-lang/lang```` cc ````@rust-lang/libs-api```` for the intrinsics and runtime detection I don't think anyone else worked on this feature, so no one else to ping, maybe cc ````@Amanieu.```` I will send the reference pr soon.
2025-06-10Rollup merge of #140372 - mejrs:attrs, r=jdonszelmannLeón Orell Valerian Liehr-26/+40
Exhaustively handle parsed attributes in CheckAttr This pr - Deletes the unused `DiagnosticAttribute ` struct and variant - Comments the `AttributeKind ` enum - The match in `CheckAttrVisitor` is now exhaustive for `AttributeKind::Parsed`. - Moved some checks around after that change I did *not* thoroughly check that there's no duplicated logic between this pass and the attribute parsing but I think it's OK. r? ````@jdonszelmann````
2025-06-10Auto merge of #141485 - dianqk:early_otherwise_branch_loop, r=oli-obkbors-29/+3
mir-opt: Do not create storage marks in EarlyOtherwiseBranch Fixes #141212. The first commit add `StorageDead` by creating new indirect BB that makes CFG more complicated, but I think it's better to just not create storage marks. r? mir-opt
2025-06-10Implement representation options to smirShoyu Vanilla-5/+96
2025-06-10Add supported asm types for LoongArch32WANG Rui-4/+6
2025-06-10Auto merge of #141451 - lcnr:canonicalize-env-cache, r=compiler-errorsbors-28/+109
cache `param_env` canonicalization BLocked on rust-lang/rust#141581
2025-06-10const_eval: fix some outdated commentsRalf Jung-12/+8
2025-06-10Loop check anon consts on their ownOli Scherer-10/+10
2025-06-10Remove check_mod_loops query and run the checks per-body insteadOli Scherer-202/+185
2025-06-10use `#[naked]` for `__rust_probestack`Folkert de Vries-2/+3
2025-06-09hir_analysis: Elaborate on lint strategy for unsupported ABIsJubilee-1/+3
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-06-09compiler: Fix reusing same lint on fn ptrs with newly-deprecated ABIsJubilee Young-16/+24
2025-06-09assert more often in release in ast_loweringJubilee Young-13/+13
2025-06-09assert in release in ast_lowering::itemJubilee Young-5/+5
2025-06-09use correct edition when warning for unsafe attributesFolkert de Vries-1/+6
If an attribute is re-emitted by a macro, the incorrect edition was used to emit warnings for unsafe attributes
2025-06-09Make E0621 missing lifetime suggestion verboseEsteban Küber-4/+8
``` error[E0621]: explicit lifetime required in the type of `x` --> $DIR/42701_one_named_and_one_anonymous.rs:10:9 | LL | &*x | ^^^ lifetime `'a` required | help: add explicit lifetime `'a` to the type of `x` | LL | fn foo2<'a>(a: &'a Foo, x: &'a i32) -> &'a i32 { | ++ ```
2025-06-09Rollup merge of #142208 - Urgau:dead_code-const_, r=petrochenkovTrevor Gross-1/+12
Always consider `const _` items as live for dead code analysis This PR alters dead code analysis to always consider `const _: () = { ... };` to be live. This doesn't address the `_name` pattern from https://github.com/rust-lang/rust/issues/142075. Fixes https://github.com/rust-lang/rust/issues/142104
2025-06-09Rollup merge of #141993 - tgross35:use-in-tree-builtins, r=bjorn3Trevor Gross-1/+1
Use the in-tree `compiler-builtins` for the sysroot Many of `std`'s dependency have a dependency on the crates.io `compiler-builtins` when used with the feature `rustc-std-workspace-core`. Use a Cargo patch to select the in-tree version instead. `compiler-builtins` is also added as a dependency of `rustc-std-workspace-core` so these crates can remove their crates.io dependency in the future. Zulip discussion: [#t-compiler > Using in-tree compiler-builtins](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Using.20in-tree.20compiler-builtins/with/522445336) Once this merges, the following PRs will need to make it to a release for the relevant crates: - https://github.com/rust-lang/getopts/pull/119 (can merge at any time) - https://github.com/rust-lang/hashbrown/pull/625 (can merge at any time) - https://github.com/rust-lang/stdarch/pull/1825 - https://github.com/rust-lang/rustc-demangle/pull/80 - https://github.com/rust-lang/cfg-if/pull/84 - https://github.com/unicode-rs/unicode-width/pull/77 The above should cover all tier 1 targets with no `std` features enabled. The remaining cover the rest: - https://github.com/alexcrichton/dlmalloc-rs/pull/50 (wasm, xous, sgx) - https://github.com/gimli-rs/gimli/pull/769 - https://github.com/r-efi/r-efi/pull/89 (efi) - https://github.com/r-efi/r-efi-alloc/pull/9 (efi) - https://github.com/fortanix/rust-sgx/pull/770 (sgx) - https://github.com/hermit-os/hermit-rs/pull/718 (hermit) - https://github.com/bytecodealliance/wasi-rs/pull/108 (wasi) - https://github.com/gimli-rs/addr2line/pull/345 - https://github.com/oyvindln/adler2/pull/2 - https://github.com/BurntSushi/memchr/pull/180 - https://github.com/Frommi/miniz_oxide/pull/173 - https://github.com/gimli-rs/object/pull/777 try-job: x86_64-gnu try-job: test-various
2025-06-09Rollup merge of #140767 - sayantn:stabilize-sha512, r=traviscross,tgross35Trevor Gross-5/+5
Stabilize `sha512`, `sm3` and `sm4` for x86 This PR stabilizes the feature flag `sha512_sm_x86` (tracking issue rust-lang/rust#126624). # Public API The 3 `x86` target features `sha512`, `sm3` and `sm4`, and the associated intrinsics in stdarch. These target features are very specialized, and are only used to signal the presence of the corresponding CPU instruction. They don't have any nontrivial interaction with the ABI (contrary to something like AVX), and serve the only purpose of enabling 10 stdarch intrinsics, all of which have been implemented and propagated to rustc via a stdarch submodule update. Also, these were added in LLVM17, and as the minimum LLVM required for rustc is LLVM19, we are safe in that front too! # Associated PRs - rust-lang/rust#126704 - rust-lang/stdarch#1592 - rust-lang/stdarch#1790 - rust-lang/rust#140389 (stdarch submodule update) - rust-lang/stdarch#1796 (stabilizing the runtime detection and intrinsics) - rust-lang/rust#141964 (stdarch submodule update for the stabilization of the runtime detection and intrinsics) As all of the required tasks have been done (adding the target features to rustc, implementing their runtime detection in std_detect and implementing the associated intrinsics in core_arch), these target features can be stabilized now. cc `@rust-lang/lang` cc `@rust-lang/libs-api` for the intrinsics and runtime detection I don't think anyone else worked on this feature, so no one else to ping, maybe cc `@Amanieu.` I will send the reference pr soon.
2025-06-09Apply nested goals certainty to InspectGoals for normalizes-toMichael Goulet-44/+65