about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-06-07store `target.min_global_align` as an `Align`Folkert de Vries-63/+37
2025-06-07Auto merge of #141950 - oli-obk:big-body-owner-loop, r=compiler-errorsbors-9/+7
Move coroutine_by_move_body_def_id into the big check_crate body owner loop This avoids starting a parallel loop in sequence and instead runs all the queries for a specific DefId together.
2025-06-07move all intrinsic typeck logic into the one big matchRalf Jung-495/+457
2025-06-07intrinsics: use const generic to set atomic orderingRalf Jung-290/+208
2025-06-07Stabilize `sha512_sm_x86`, and the `sha512`, `sm3` and `sm4` target featuressayantn-5/+5
2025-06-07Stabilize the `keylocker_x86` flag, and the `kl` and `widekl` target featuressayantn-4/+4
2025-06-07Auto merge of #141927 - compiler-errors:perf-select, r=lcnrbors-41/+70
Clear nested candidates in select if certainty is yes Proving these goals is redundant.
2025-06-07Auto merge of #141964 - sayantn:update-stdarch, r=Amanieubors-9/+9
Update stdarch submodule Updates the stdarch submodule. ## Merged PRs - rust-lang/stdarch#1797 - rust-lang/stdarch#1758 - rust-lang/stdarch#1798 - rust-lang/stdarch#1811 - rust-lang/stdarch#1810 - rust-lang/stdarch#1807 - rust-lang/stdarch#1806 - rust-lang/stdarch#1812 - rust-lang/stdarch#1795 - rust-lang/stdarch#1796 - rust-lang/stdarch#1813 - rust-lang/stdarch#1816 - rust-lang/stdarch#1818 - rust-lang/stdarch#1820 - rust-lang/stdarch#1819 r? `@Amanieu` `@rustbot` label T-libs-api Closes rust-lang/rust#111137
2025-06-07const-eval error: always say in which item the error occurredRalf Jung-20/+6
also adjust the wording a little so that we don't say "the error occurred here" for two different spans
2025-06-07rustc_resolve: Improve `resolve_const_param_in_non_trivial_anon_const` wordingMartin Nordholts-1/+1
In some contexts, const expressions are OK. Add a `here` to the error message to clarify this.
2025-06-07compiler: Treat ForceWarning as a Warning for diagnostic levelJubilee Young-1/+1
This silences an ICE.
2025-06-07Rollup merge of #142131 - estebank:cast-sugg, r=UrgauJacob Pratt-69/+43
Make cast suggestions verbose ``` error[E0604]: only `u8` can be cast as `char`, not `u32` --> $DIR/E0604.rs:2:5 | LL | 1u32 as char; | ^^^^^^^^^^^^ invalid cast | help: try `char::from_u32` instead | LL - 1u32 as char; LL + char::from_u32(1u32); | ``` ``` error[E0620]: cast to unsized type: `&[u8]` as `[char]` --> $DIR/cast-to-slice.rs:6:5 | LL | arr as [char]; | ^^^^^^^^^^^^^ | help: try casting to a reference instead | LL | arr as &[char]; | + ``` ``` error[E0620]: cast to unsized type: `Box<{integer}>` as `dyn Send` --> $DIR/cast-to-unsized-trait-object-suggestion.rs:3:5 | LL | Box::new(1) as dyn Send; | ^^^^^^^^^^^^^^^^^^^^^^^ | help: you can cast to a `Box` instead | LL | Box::new(1) as Box<dyn Send>; | ++++ + ``` Part of rust-lang/rust#141973.
2025-06-07Rollup merge of #142045 - estebank:obligation-cause-code-suggestion, ↵Jacob Pratt-9/+11
r=compiler-errors Make obligation cause code suggestions verbose ``` error[E0277]: `()` is not a future --> $DIR/unnecessary-await.rs:28:10 | LL | e!().await; | ^^^^^ `()` is not a future | = help: the trait `Future` is not implemented for `()` = note: () must be a future or must implement `IntoFuture` to be awaited = note: required for `()` to implement `IntoFuture` help: remove the `.await` | LL - e!().await; LL + e!(); | ``` ``` error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/const-fn-in-vec.rs:1:47 | LL | static _MAYBE_STRINGS: [Option<String>; 5] = [None; 5]; | ^^^^ the trait `Copy` is not implemented for `String` | = note: required for `Option<String>` to implement `Copy` = note: the `Copy` trait is required because this value will be copied for each element of the array help: create an inline `const` block | LL | static _MAYBE_STRINGS: [Option<String>; 5] = [const { None }; 5]; | +++++++ + ``` Part of rust-lang/rust#141973
2025-06-07Rollup merge of #141797 - ↵Jacob Pratt-36/+23
workingjubilee:apple-likes-frame-pointers-but-not-that-much, r=madsmtm compiler: set Apple frame pointers by architecture All Apple targets stop overriding this configuration and instead use the default base of FramePointer::NonLeaf, which means some Apples will have less frame pointers in leaf functions. r? ``@madsmtm`` cc ``@thomcc``
2025-06-07Rollup merge of #141558 - Diggsey:db-limit-cgu-name-length, r=matthewjasperJacob Pratt-6/+31
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-06compiler: Remove superfluous renaming import of ExternAbiJubilee Young-3/+1
2025-06-06compiler: Sort and doc ExternAbi variantsJubilee Young-33/+62
2025-06-07Unify normalization of terms in deeply normalizeMichael Goulet-71/+30
2025-06-06Add `-Z hint-mostly-unused` to tell rustc that most of a crate will go unusedJosh Triplett-0/+10
This hint allows the compiler to optimize its operation based on this assumption, in order to compile faster. This is a hint, and does not guarantee any particular behavior. This option can substantially speed up compilation if applied to a large dependency where the majority of the dependency does not get used. This flag may slow down compilation in other cases. Currently, this option makes the compiler defer as much code generation as possible from functions in the crate, until later crates invoke those functions. Functions that never get invoked will never have code generated for them. For instance, if a crate provides thousands of functions, but only a few of them will get called, this flag will result in the compiler only doing code generation for the called functions. (This uses the same mechanisms as cross-crate inlining of functions.) This does not affect `extern` functions, or functions marked as `#[inline(never)]`. Some performance numbers, based on a crate with many dependencies having just *one* large dependency set to `-Z hint-mostly-unused` (using Cargo's `profile-rustflags` option): A release build went from 4m07s to 2m04s. A non-release build went from 2m26s to 1m28s.
2025-06-06Rollup merge of #142118 - hkBst:lexer-patch1, r=oli-obkGuillaume Gomez-10/+8
rustc_lexer: typo fix + small cleanups
2025-06-06Rollup merge of #142112 - ada4a:patch-1, r=wesleywiserGuillaume Gomez-1/+1
fix typo
2025-06-06Rollup merge of #142103 - scottmcm:fieldidx-in-interp, r=oli-obkGuillaume Gomez-56/+72
Update `InterpCx::project_field` to take `FieldIdx` As suggested by Ralf in https://github.com/rust-lang/rust/pull/142005#discussion_r2125839015
2025-06-06Rollup merge of #142086 - fee1-dead-contrib:ast-visitor-dedup, r=oli-obkGuillaume Gomez-397/+314
duduplicate more AST visitor methods r? oli-obk
2025-06-06Rollup merge of #142043 - estebank:const-suggestion, r=wesleywiserGuillaume Gomez-1/+1
Verbose suggestion to make param `const` ``` error[E0747]: type provided when a constant was expected --> $DIR/invalid-const-arguments.rs:10:19 | LL | impl<N> Foo for B<N> {} | ^ | help: consider changing this type parameter to a const parameter | LL - impl<N> Foo for B<N> {} LL + impl<const N: u8> Foo for B<N> {} | ``` Part of rust-lang/rust#141973.
2025-06-06Rollup merge of #141603 - nnethercote:reduce-P, r=fee1-deadGuillaume Gomez-286/+69
Reduce `ast::ptr::P` to a typedef of `Box` As per the MCP at https://github.com/rust-lang/compiler-team/issues/878. r? `@fee1-dead`
2025-06-06reword suggestion messageEsteban Küber-4/+7
2025-06-06Apply `mismatched-lifetime-syntaxes` to trait and extern functionsJake Goulding-7/+33
2025-06-06Make obligation cause code suggestions verboseEsteban Küber-9/+11
``` error[E0277]: `()` is not a future --> $DIR/unnecessary-await.rs:28:10 | LL | e!().await; | ^^^^^ `()` is not a future | = help: the trait `Future` is not implemented for `()` = note: () must be a future or must implement `IntoFuture` to be awaited = note: required for `()` to implement `IntoFuture` help: remove the `.await` | LL - e!().await; LL + e!(); | ``` ``` error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/const-fn-in-vec.rs:1:47 | LL | static _MAYBE_STRINGS: [Option<String>; 5] = [None; 5]; | ^^^^ the trait `Copy` is not implemented for `String` | = note: required for `Option<String>` to implement `Copy` = note: the `Copy` trait is required because this value will be copied for each element of the array help: create an inline `const` block | LL | static _MAYBE_STRINGS: [Option<String>; 5] = [const { None }; 5]; | +++++++ + ```
2025-06-06Make cast suggestions verboseEsteban Küber-67/+38
``` error[E0604]: only `u8` can be cast as `char`, not `u32` --> $DIR/E0604.rs:2:5 | LL | 1u32 as char; | ^^^^^^^^^^^^ invalid cast | help: try `char::from_u32` instead | LL - 1u32 as char; LL + char::from_u32(1u32); | ``` ``` error[E0620]: cast to unsized type: `&[u8]` as `[char]` --> $DIR/cast-to-slice.rs:6:5 | LL | arr as [char]; | ^^^^^^^^^^^^^ | help: try casting to a reference instead | LL | arr as &[char]; | + ``` ``` error[E0620]: cast to unsized type: `Box<{integer}>` as `dyn Send` --> $DIR/cast-to-unsized-trait-object-suggestion.rs:3:5 | LL | Box::new(1) as dyn Send; | ^^^^^^^^^^^^^^^^^^^^^^^ | help: you can cast to a `Box` instead | LL | Box::new(1) as Box<dyn Send>; | ++++ + ```
2025-06-06Auto merge of #141774 - oli-obk:naked-fn-queries, r=petrochenkovbors-150/+105
Change per-module naked fn checks to happen during typeck instead cc `@Lokathor` `@Amanieu` `@folkertdev` just seems nicer this way
2025-06-06Treat normalizing consts like normalizing types in deeply normalizeMichael Goulet-23/+24
2025-06-06compiler: set Apple frame pointers by architectureJubilee Young-36/+23
Apple targets can now overriding this configuration and instead use the default based on their architecture, which means aarch64 targets now have less frame pointers in leaf functions.
2025-06-06Don't walk into Certainty::Yes subgoals in NestedObligationsForSelfTyMichael Goulet-0/+15
2025-06-06Allow transmute casts in pre-runtime-MIROli Scherer-31/+19
2025-06-06Filter out universals and lifetimes from stalled_varsMichael Goulet-3/+16
2025-06-06Auto merge of #141681 - compiler-errors:fast-path-stalled, r=lcnrbors-1/+22
Fast path for stalled obligations on self ty If we see that the `self` type of a goal is an infer var, then don't try to compute the goal at all, since we know that it'll be forced ambiguous. This is currently only implemented when there are no opaques in the environment. We could extend it to check that the self type is not related to any already defined opaques via subtyping, but I'll leave that as a follow-up. --- Also stall coerce and subtype predicates if both of their vars are not resolved to concrete types. --- ~~Also, we don't care if the goal is higher-ranked for the sized and copy/clone fast path.~~ pulling this out into another PR. r? lcnr
2025-06-06Fix review commentsbjorn3-14/+10
2025-06-06rustc_lexer: typo fix + small cleanupsMarijn Schouten-10/+8
2025-06-06Auto merge of #142099 - matthiaskrgr:rollup-r9s3c35, r=matthiaskrgrbors-305/+308
Rollup of 11 pull requests Successful merges: - rust-lang/rust#125087 (Optimize `Seek::stream_len` impl for `File`) - rust-lang/rust#141982 (`tests/ui`: A New Order [5/N]) - rust-lang/rust#142012 (Replace some `Option<Span>` with `Span` and use DUMMY_SP instead of None) - rust-lang/rust#142044 (compiler: Document the offset invariant of `OperandValue::Pair`) - rust-lang/rust#142047 (Ensure stack in two places that affect s390x) - rust-lang/rust#142058 (Clean `rustc_attr_parsing/src/lib.rs` documentation) - rust-lang/rust#142067 (canon_abi: make to_erased_extern_abi just a detail in formatting) - rust-lang/rust#142072 (doc: Fix inverted meaning in E0783.md) - rust-lang/rust#142084 (add myself to rotation) - rust-lang/rust#142091 (Fix AIX build) - rust-lang/rust#142092 (rustdoc: Support middle::ty associated const equality predicates again) Failed merges: - rust-lang/rust#142042 (Make E0621 missing lifetime suggestion verbose) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-06fix typoAda Alakbarova-1/+1
2025-06-06Force exhaustive handling of every parsed attributemejrs-6/+16
2025-06-06Delete unused variant and document AttributeKindmejrs-20/+24
2025-06-06Update compiler/rustc_abi/src/layout/ty.rsscottmcm-1/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-06-05compiler: Add track_caller to AbiMapping::unwrapJubilee Young-0/+1
Same reason as it is on Option's.
2025-06-06deduplicate more `walk_*` methods in AST visitDeadbeef-257/+188
2025-06-05Update `InterpCx::project_field` to take `FieldIdx`Scott McMurray-56/+72
As suggested by Ralf in 142005.
2025-06-06Add new Tier-3 targets: `loongarch32-unknown-none*`WANG Rui-11/+81
MCP: https://github.com/rust-lang/compiler-team/issues/865
2025-06-05`SlotIndex::from_index`: Factor out a constant for the first bucket sizeJosh Triplett-3/+12
2025-06-06Rollup merge of #142072 - maflcko:patch-1, r=aDotInTheVoidMatthias Krüger-1/+1
doc: Fix inverted meaning in E0783.md `...` (three dots) was the old way of saying `..=`, which both denote the *inclusive* range, not the *exclusive* one.
2025-06-06Rollup merge of #142067 - RalfJung:abi-map-to-str, r=workingjubileeMatthias Krüger-13/+6
canon_abi: make to_erased_extern_abi just a detail in formatting I think ideally we'd avoid ever printing `CanonAbi` to users, but that needs further changes. Personally I think it's fine for Miri to use the debug printing of `CanonAbi` until we figure that out, but I think others disagree. ;) r? ``@workingjubilee``