about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-05-14Add `Ipv4Addr` and `Ipv6Addr` diagnostic itemsSamuel Tardieu-0/+2
They will be used in Clippy to detect runtime parsing of known-valid IP addresses.
2025-05-14Suggest replace `f` with `f: Box<f>` when expr field is short handxizheyin-0/+21
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-14Handle `rustc_query_system` cases of `rustc::potential_query_instability` lintismailarilik-1/+9
2025-05-13type_ir: add faster exit for `types_may_unify`David Wood-0/+3
2025-05-13Add TRACING_ENABLED to Machine traitStypox-0/+6
2025-05-13Auto merge of #140887 - pietroalbini:pa-bootstrap-update, r=compiler-errorsbors-55/+13
Stage0 bootstrap update This PR [follows the release process](https://forge.rust-lang.org/release/process.html#master-bootstrap-update-tuesday) to update the stage0 compiler. The only thing of note is https://github.com/rust-lang/rust/commit/58651d1b316e268fac2100c3ae37bb502a36b8ba, which was flagged by clippy as a correctness fix. I think allowing that lint in our case makes sense, but it's worth to have a second pair of eyes on it. r? `@Mark-Simulacrum`
2025-05-13Expect deep norm to fail if query norm failedMichael Goulet-12/+18
2025-05-13Invoke a query only when it doesn't return immediately anywayOli Scherer-4/+4
2025-05-13Run rustc_attrs dumps after typeckOli Scherer-11/+11
2025-05-13Some require_lang_item -> is_lang_item replacementsOli Scherer-9/+5
2025-05-13trait_sel: deep reject `match_normalize_trait_ref`David Wood-2/+9
Spotted during an in-person review of unrelated changes, `match_normalize_trait_ref` could be using `DeepRejectCtxt` to exit early as an optimisation for prejection candidates, like is done in param candidates.
2025-05-13Auto merge of #140935 - omahs:patch-5, r=jieyouxubors-11/+11
Fix typos Fix typos
2025-05-12Flush errors before deep normalize in dropck_outlivesMichael Goulet-0/+8
2025-05-12Auto merge of #140914 - Zalathar:asm-bindings, r=compiler-errorsbors-109/+89
cg_llvm: Clean up some inline assembly bindings This PR combines a few loosely-related cleanups to LLVM bindings related to inline assembly. These include: - Replacing `LLVMRustInlineAsm` with LLVM-C's `LLVMGetInlineAsm` - Adjusting FFI declarations to avoid the need for explicit `as_c_char_ptr` conversions - Flattening control flow in `inline_asm_call` There should be no functional changes.
2025-05-12Fix typosomahs-11/+11
2025-05-12update cfg(bootstrap)Pietro Albini-42/+0
2025-05-12update version placeholdersPietro Albini-13/+13
2025-05-12Use unreachable instead of panictiif-1/+1
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
2025-05-12Auto merge of #140923 - Zalathar:operand-bundle, r=lcnrbors-17/+18
cg_llvm: Rename `OperandBundleOwned` to `OperandBundleBox` As with `DIBuilderBox`, the "Box" suffix does a better job of communicating that this is an owning pointer to some borrowable resource. This also renames the `raw` method to `as_ref`, which is what it would have been named originally if the `Deref` problem (#137603) had been known at the time. No functional change.
2025-05-11Auto merge of #140842 - tmiasko:print-mono-items, r=saethlinbors-37/+9
Remove mono item collection strategy override from -Zprint-mono-items Previously `-Zprint-mono-items` would override the mono item collection strategy. When debugging one doesn't want to change the behaviour, so this was counter productive. Additionally, the produced behaviour was artificial and might never arise without using the option in the first place (`-Zprint-mono-items=eager` without `-Clink-dead-code`). Finally, the option was incorrectly marked as `UNTRACKED`. Resolve those issues, by turning `-Zprint-mono-items` into a boolean flag that prints results of mono item collection without changing the behaviour of mono item collection. For codegen-units test incorporate `-Zprint-mono-items` flag directly into compiletest tool. Test changes are mechanical. `-Zprint-mono-items=lazy` was removed without additional changes, and `-Zprint-mono-items=eager` was turned into `-Clink-dead-code`. Linking dead code disables internalization, so tests have been updated accordingly.
2025-05-11Return value of coroutine_layout fn changed to Result with LayoutErrorAndrew Zhogin-14/+25
2025-05-11feat: add generated parameters to generated functionHaeNoe-3/+52
- update pretty printing tests - only add generic parameters when function is actually generic (no empty turbofish)
2025-05-11feat: propagate generics to generated functionHaeNoe-8/+10
2025-05-11Auto merge of #140915 - matthiaskrgr:rollup-lxce4zr, r=matthiaskrgrbors-11/+24
Rollup of 3 pull requests Successful merges: - #140397 (Add T-compiler backports Zulip notifications) - #140851 (Warn when `#[export_name]` is used with generic functions) - #140862 (Enable non-leaf Frame Pointers for Arm64EC Windows) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-11Rename `OperandBundleOwned` to `OperandBundleBox`Zalathar-17/+18
As with `DIBuilderBox`, the "Box" suffix does a better job of communicating that this is an owning pointer to some borrowable resource. This also renames the `raw` method to `as_ref`, which is what it would have been named originally if the `Deref` problem had been known at the time.
2025-05-11Auto merge of #140902 - azhogin:azhogin/async-drop-open-drop-for-adt-fix, ↵bors-0/+3
r=oli-obk Async drop fix for async_drop_in_place<T> layout for unspecified T Fix for https://github.com/rust-lang/rust/issues/140423. Layout of `async_drop_in_place<T>::{closure}` is calculated for unspecified T from dataflow_const_prop `try_make_constant`. `@oli-obk,` do you think, it may be a better solution to add check like `if !args[0].is_fully_specialized() { return None; }` in `fn async_drop_coroutine_layout`? And could you, pls, recommend, how to implement `is_fully_specialized()` in a most simple way?
2025-05-11Rollup merge of #140862 - dpaoliello:arm64ecfp, r=wesleywiserMatthias Krüger-1/+7
Enable non-leaf Frame Pointers for Arm64EC Windows This was enabled for native Arm64 via #140828 r? `@workingjubilee`
2025-05-11Rollup merge of #140851 - mu001999-contrib:new-lint, r=bjorn3Matthias Krüger-10/+17
Warn when `#[export_name]` is used with generic functions Fixes #140742
2025-05-11Auto merge of #135015 - heiher:stabilize-loongarch-target-features, r=Amanieubors-7/+7
Partially stabilize LoongArch target features Stabilization PR for the LoongArch target features. This PR stabilizes some of the target features tracked by #44839. Specifically, this PR stabilizes the following target features: * f * d * frecipe * lasx * lbt * lsx * lvz Docs PR: https://github.com/rust-lang/reference/pull/1707 r? `@Amanieu`
2025-05-11Flatten control-flow in `inline_asm_call` after verificationZalathar-52/+53
2025-05-11Make `LLVMRustInlineAsmVerify` take `*const c_uchar`Zalathar-4/+3
This avoids the need for an explicit `as_c_char_ptr` conversion.
2025-05-11Add a safe wrapper for `LLVMAppendModuleInlineAsm`Zalathar-11/+17
This patch also changes the Rust-side declaration to take `*const c_uchar` instead of `*const c_char`, to avoid the need for `AsCCharPtr`.
2025-05-11Use `LLVMGetInlineAsm`Zalathar-43/+17
This LLVM-C binding replaces the existing `LLVMRustInlineAsm` function.
2025-05-11Add a searchable tag `PTR_LEN_STR` to explain `*const c_uchar` bindingsZalathar-2/+2
This module comment describes why it's OK for LLVM bindings to declare a parameter type of `*const c_uchar` for pointer/length strings, even though the corresponding parameter on the C/C++ side uses `const char *`. Adding a searchable term to each such parameter should make it easier for future maintainers to understand why `*const c_uchar` is being used instead of `*const c_char`.
2025-05-11Rollup merge of #140878 - nnethercote:two-expand-cleanups, r=compiler-errorsLeón Orell Valerian Liehr-71/+45
Two expand-related cleanups Minor improvements I found while looking at this code. Best reviewed one commit at a time. r? `@BoxyUwU`
2025-05-11Rollup merge of #140795 - mu001999-contrib:sugg-stable-import-first, ↵León Orell Valerian Liehr-6/+70
r=petrochenkov Prefer to suggest stable candidates rather than unstable ones Fixes #140240 The logic is to replace unstable suggestions if we meet a new stable one, and do nothing if any other situation. In old logic, we just use the first candidate we meet as the suggestion for the same items. E.g., `std::range::legacy::Range` vs `std::ops::Range`, `legacy` in the former is unstable, we prefer to suggest use the latter.
2025-05-11Rollup merge of #140792 - Urgau:minimum-maximum-intrinsics, ↵León Orell Valerian Liehr-0/+169
r=scottmcm,traviscross,tgross35 Use intrinsics for `{f16,f32,f64,f128}::{minimum,maximum}` operations This PR creates intrinsics for `{f16,f32,f64,f64}::{minimum,maximum}` operations. This wasn't done when those operations were added as the LLVM support was too weak but now that LLVM has libcalls for unsupported platforms we can finally use them. Cranelift and GCC[^1] support are partial, Cranelift doesn't support `f16` and `f128`, while GCC doesn't support `f16`. r? `@tgross35` try-job: aarch64-gnu try-job: dist-various-1 try-job: dist-various-2 [^1]: https://www.gnu.org/software///gnulib/manual/html_node/Functions-in-_003cmath_002eh_003e.html
2025-05-11Async drop fix for async_drop_in_place<T> layout calculated for unspecified TAndrew Zhogin-0/+3
2025-05-10Auto merge of #140895 - matthiaskrgr:rollup-rfvqv4t, r=matthiaskrgrbors-4/+1
Rollup of 7 pull requests Successful merges: - #129334 (Implement (part of) ACP 429: add `DerefMut` to `Lazy[Cell/Lock]`) - #139562 (rustdoc: add a handle that makes sidebar resizing more obvious) - #140151 (remove intrinsics::drop_in_place) - #140660 (remove 'unordered' atomic intrinsics) - #140783 (Update documentation of OnceLock::get_or_init.) - #140789 (Update hermit-abi to 0.5.1) - #140879 (1.87.0 release notes: remove nonsensical `~` operator) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-10Use the fallback body for `{minimum,maximum}f128` on LLVM as well.Urgau-6/+14
2025-05-10Rollup merge of #140660 - RalfJung:more-order, r=WaffleLapkinMatthias Krüger-4/+1
remove 'unordered' atomic intrinsics As their doc comment already indicates, these operations do not currently have a place in our memory model. The intrinsics were introduced to support a hack in compiler-builtins, but that hack recently got removed (see https://github.com/rust-lang/compiler-builtins/issues/788).
2025-05-10Auto merge of #140854 - oli-obk:merge-queries, r=nnethercotebors-4/+0
Merge typeck loop with static/const item eval loop r? `@ghost` Let's try a small one first. Doing this in general has some bad cache coherence issues because the query caches are laid out in `Vec<QueryResult>` lists per query where each index refers to a `DefId` in the same order as we're iterating. Iterating two or more lists at the same time does have cache issues, so I want to poke a bit at it to see if we can't merge just a few of them at a time.
2025-05-10Warn when #[export_name] is used with generic functionsMu001999-10/+17
2025-05-10Auto merge of #140880 - nnethercote:Ident-new-debug-assert, r=oli-obkbors-1/+1
Make the assertion in `Ident::new` debug-only. This fixes a perf regression introduced in #140252. r? `@oli-obk`
2025-05-10Make the assertion in `Ident::new` debug-only.Nicholas Nethercote-1/+1
This fixes a perf regression introduced in #140252.
2025-05-10Remove `AstDeref`.Nicholas Nethercote-53/+33
It's a "utility trait to reduce boilerplate" implemented for `P` and `AstNodeWrapper`, but removing it gives a net reduction of twenty lines of code. It's also simpler to just implement `HasNodeId`/`HasAttrs`/`HasTokens` directly on types instead of via `AstDeref`. (I decided to make this change when doing some related refactoring and the error messages involving `AstDeref` and `HasAttrs` were hard to understand; removing it helped a lot.)
2025-05-09don't depend on rustc_attr_parsing if rustc_data_structures will domejrs-54/+53
2025-05-09Rollup merge of #140848 - kornelski:not-a-dead-end, r=compiler-errorsMatthias Krüger-2/+2
Improved error message for top-level or-patterns I was confused by "top-level or-patterns are not allowed in `let` bindings" error, because it sounded like or-patterns were completely unsupported. This error has an auto-fix suggestion that shows otherwise, but the auto-fix isn't always visible in IDEs. I've changed the wording to be consistent with "`Fn` bounds require arguments in parentheses", and it doesn't sound like a dead-end any more.
2025-05-09Enable non-leaf Frame Pointers for Arm64EC WindowsDaniel Paoliello-1/+7
2025-05-09remove 'unordered' atomic intrinsicsRalf Jung-4/+1