about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-02-19Auto merge of #137248 - matthiaskrgr:rollup-s18zjau, r=matthiaskrgrbors-546/+585
Rollup of 9 pull requests Successful merges: - #136936 (Use 'yes' instead of 'while-echo' in tests/ui/process/process-sigpipe.rs except 'nto') - #137026 (Stabilize (and const-stabilize) `integer_sign_cast`) - #137059 (fix: Alloc new errorcode E0803 for E0495) - #137177 (Update `minifier-rs` version to `0.3.5`) - #137210 (compiler: Stop reexporting stuff in cg_llvm::abi) - #137213 (Remove `rustc_middle::mir::tcx` module.) - #137216 (eval_outlives: bail out early if both regions are in the same SCC) - #137228 (Fix typo in hidden internal docs of `TrustedRandomAccess`) - #137242 (Add reference annotations for the `do_not_recommend` attribute) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-19Auto merge of #135408 - RalfJung:x86-sse2, r=workingjubileebors-151/+273
x86: use SSE2 to pass float and SIMD types This builds on the new X86Sse2 ABI landed in https://github.com/rust-lang/rust/pull/137037 to actually make it a separate ABI from the default x86 ABI, and use SSE2 registers. Specifically, we use it in two ways: to return `f64` values in a register rather than by-ptr, and to pass vectors of size up to 128bit in a register (or, well, whatever LLVM does when passing `<4 x float>` by-val, I don't actually know if this ends up in a register). Cc `@workingjubilee` Fixes #133611 try-job: aarch64-apple try-job: aarch64-gnu try-job: aarch64-gnu-debug try-job: test-various try-job: x86_64-gnu-nopt try-job: dist-i586-gnu-i586-i686-musl try-job: x86_64-msvc-1
2025-02-19Rollup merge of #137242 - ehuss:reference-do_not_recommend, r=compiler-errorsMatthias Krüger-50/+59
Add reference annotations for the `do_not_recommend` attribute This adds reference rule identifiers for the tests of the `diagnostic::do_not_recommend` attribute.
2025-02-19Rollup merge of #137228 - steffahn:one-coerces-to-supertypes-not-subtypes, ↵Matthias Krüger-4/+4
r=the8472 Fix typo in hidden internal docs of `TrustedRandomAccess` I typoed the coercion direction here 4 years ago; fixing it now
2025-02-19Rollup merge of #137216 - amandasystems:cheap-outlives-eval, r=compiler-errorsMatthias Krüger-0/+5
eval_outlives: bail out early if both regions are in the same SCC A drive-by optimisation of region outlives evaluation: if we are evaluating whether an outlives holds for two regions, bail out early if they are both in the same SCC. This probably won't make a huge difference, but the cost is one comparison of SCC indices (integers). May want a perf run, depending on how confident whomever reviewing this is!
2025-02-19Rollup merge of #137213 - nnethercote:rm-rustc_middle-mir-tcx, r=compiler-errorsMatthias Krüger-430/+402
Remove `rustc_middle::mir::tcx` module. This is a really weird module. For example, what does `tcx` in `rustc_middle::mir::tcx::PlaceTy` mean? The answer is "not much". The top-level module comment says: > Methods for the various MIR types. These are intended for use after > building is complete. Awfully broad for a module that has a handful of impl blocks for some MIR types, none of which really relates to `TyCtxt`. `git blame` indicates the comment is ancient, from 2015, and made sense then. This module is now vestigial. This commit removes it and moves all the code within into `rustc_middle::mir::statement`. Some specifics: - `Place`, `PlaceRef`, `Rvalue`, `Operand`, `BorrowKind`: they all have `impl` blocks in both the `tcx` and `statement` modules. The commit merges the former into the latter. - `BinOp`, `UnOp`: they only have `impl` blocks in `tcx`. The commit moves these into `statement`. - `PlaceTy`, `RvalueInitializationState`: they are defined in `tcx`. This commit moves them into `statement` *and* makes them available in `mir::*`, like many other MIR types. r? `@tmandry`
2025-02-19Rollup merge of #137210 - workingjubilee:fixup-passmode-import, r=RalfJungMatthias Krüger-27/+27
compiler: Stop reexporting stuff in cg_llvm::abi The reexports confuse tooling like rustdoc into thinking cg_llvm is the source of key types that originate in rustc_target.
2025-02-19Rollup merge of #137177 - GuillaumeGomez:update-minifier, r=notriddleMatthias Krüger-3/+3
Update `minifier-rs` version to `0.3.5` Encountered a bug around handling of `*` which blocked me for something I'm working on. Also includes multiple fixes from ```@notriddle.``` r? ```@notriddle```
2025-02-19Rollup merge of #137059 - xizheyin:issue-136827, r=davidtwcoMatthias Krüger-18/+65
fix: Alloc new errorcode E0803 for E0495 As discussion in #136827, I alloc a new errorcode.
2025-02-19Rollup merge of #137026 - GrigorenkoPV:integer_sign_cast, r=jhprattMatthias Krüger-9/+8
Stabilize (and const-stabilize) `integer_sign_cast` Tracking issue: #125882 Closes: #125882 FCP completed: https://github.com/rust-lang/rust/issues/125882#issuecomment-2658274124
2025-02-19Rollup merge of #136936 - xingxue-ibm:sigpipe-test, r=workingjubileeMatthias Krüger-5/+12
Use 'yes' instead of 'while-echo' in tests/ui/process/process-sigpipe.rs except 'nto' The `sh` of AIX prints a message about a broken pipe when using the `while-echo` command. It works as expected when using the `yes` command instead. `yes` was originally used in this test but was later replaced with `while-echo` because QNX Neutrino does not have `yes` ([Replace yes command by while-echo in test tests/ui/process/process-sigpipe.rs](https://github.com/rust-lang/rust/pull/109379)). This PR updates the test to use `while-echo` for QNX Neutrino while reverting to `yes` for other platforms.
2025-02-19Remove `rustc_middle::mir::tcx` module.Nicholas Nethercote-430/+402
This is a really weird module. For example, what does `tcx` in `rustc_middle::mir::tcx::PlaceTy` mean? The answer is "not much". The top-level module comment says: > Methods for the various MIR types. These are intended for use after > building is complete. Awfully broad for a module that has a handful of impl blocks for some MIR types, none of which really relates to `TyCtxt`. `git blame` indicates the comment is ancient, from 2015, and made sense then. This module is now vestigial. This commit removes it and moves all the code within into `rustc_middle::mir::statement`. Some specifics: - `Place`, `PlaceRef`, `Rvalue`, `Operand`, `BorrowKind`: they all have `impl` blocks in both the `tcx` and `statement` modules. The commit merges the former into the latter. - `BinOp`, `UnOp`: they only have `impl` blocks in `tcx`. The commit moves these into `statement`. - `PlaceTy`, `RvalueInitializationState`: they are defined in `tcx`. This commit moves them into `statement` *and* makes them available in `mir::*`, like many other MIR types.
2025-02-18Auto merge of #137235 - matthiaskrgr:rollup-2kjua2t, r=matthiaskrgrbors-732/+688
Rollup of 10 pull requests Successful merges: - #135711 (Do not ICE on default_field_value const with lifetimes) - #136599 (librustdoc: more usages of `Joined::joined`) - #136876 (Locking documentation updates) - #137000 (Deeply normalize item bounds in new solver) - #137126 (fix docs for inherent str constructors) - #137161 (Pattern Migration 2024: fix incorrect messages/suggestions when errors arise in macro expansions) - #137191 (Update mdbook and move error_index_generator) - #137203 (Improve MIR modification) - #137206 (Make E0599 a structured error) - #137218 (misc `layout_of` cleanup) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-18Add reference annotations for the `do_not_recommend` attributeEric Huss-50/+59
2025-02-18Auto merge of #137231 - Urgau:rollup-heiq934, r=Urgaubors-35/+134
Rollup of 9 pull requests Successful merges: - #136750 (Make ub_check message clear that it's not an assert) - #137151 (Install more signal stack trace handlers) - #137167 (tests: Also gate `f16::erfc()` doctest with `reliable_f16_math` cfg) - #137195 (cg_clif: use exclusively ABI alignment) - #137202 (Enforce T: Hash for Interned<...>) - #137205 (Remove `std::os::wasi::fs::FileExt::tell`) - #137211 (don't ICE for alias-relate goals with error term) - #137214 (add last std diagnostic items for clippy) - #137221 (Remove scrutinee_hir_id from ExprKind::Match) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-18Rollup merge of #137218 - lukas-code:layout_of_cleanup, r=compiler-errorsMatthias Krüger-104/+174
misc `layout_of` cleanup See individual commits for details. r? `@oli-obk` but feel free to reassign
2025-02-18Rollup merge of #137206 - estebank:e0599-structured, r=jieyouxuMatthias Krüger-18/+25
Make E0599 a structured error
2025-02-18Rollup merge of #137203 - nnethercote:improve-MIR-modification, ↵Matthias Krüger-206/+135
r=compiler-errors Improve MIR modification A few commits that simplify code that manipulates MIR bodies. r? `@tmiasko`
2025-02-18Rollup merge of #137191 - ehuss:update-mdbook, r=jieyouxuMatthias Krüger-214/+14
Update mdbook and move error_index_generator This moves error_index_generator to the rustbook workspace so that it can share the dependency with mdbook. I had forgotten that error_index_generator is using mdbook. This includes a corresponding update to mdbook which avoids a regression in error_index_generator. Closes https://github.com/rust-lang/rust/issues/137052
2025-02-18Rollup merge of #137161 - dianne:pat-migration-bookkeeping-for-macros, ↵Matthias Krüger-17/+54
r=Nadrieril Pattern Migration 2024: fix incorrect messages/suggestions when errors arise in macro expansions See the diff between the two commits for how this affected the error message and suggestion. In order to decide how to format those, the pattern migration diagnostic keeps track of which parts of the user's pattern cause problems in Edition 2024. However, it neglected to do some of this bookkeeping when pointing to macro expansion sites. This fixes that.
2025-02-18Rollup merge of #137126 - m4rch3n1ng:fix-inherent-str-docs, r=AmanieuMatthias Krüger-8/+8
fix docs for inherent str constructors related to #131114 when implementing inherent str constructors in #136517, i forgot to change the docs, so the code examples still imported the `std::str` module and used the constructor from there, instead of using "itself" (the inherent constructor).
2025-02-18Rollup merge of #137000 - compiler-errors:deeply-normalize-item-bounds, r=lcnrMatthias Krüger-75/+116
Deeply normalize item bounds in new solver Built on #136863. Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/142. Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/151. cc https://github.com/rust-lang/trait-system-refactor-initiative/issues/116 First commit reworks candidate preference for projection bounds to prefer param-env projection clauses even if the corresponding trait ref doesn't come from the param-env. Second commit adjusts the associated type item bounds check to deeply normalize in the new solver. This causes some test fallout which I will point out. r? lcnr
2025-02-18Rollup merge of #136876 - joshtriplett:locking-might-not-be-advisory, r=AmanieuMatthias Krüger-38/+58
Locking documentation updates - Reword file lock documentation to clarify advisory vs mandatory. Remove the word "advisory", and make it more explicit that the lock may be advisory or mandatory depending on platform. - Document that locking a file fails on Windows if the file is opened only for append
2025-02-18Rollup merge of #136599 - yotamofek:pr/rustdoc-more-joined, r=GuillaumeGomezMatthias Krüger-51/+70
librustdoc: more usages of `Joined::joined` Some missed opportunities from #136244 r? ```@GuillaumeGomez``` since you reviewed the last one (feel free to re-assign, of course 😊) First two commits are just drive-by cleanups
2025-02-18Rollup merge of #135711 - estebank:issue-135649, r=davidtwcoMatthias Krüger-1/+34
Do not ICE on default_field_value const with lifetimes `#![feature(default_field_values)]` uses a `const` body that should be treated as inline `const`s, but is actually being detected otherwise. This is similar to the situation in #78174, so we take the same solution: we check if the const actually comes from a field, and if it does, we use that logic to get the appropriate lifetimes and not ICE during borrowck. Fix #135649.
2025-02-18Rollup merge of #137221 - bjorn3:remove_unused_field, r=compiler-errorsUrgau-3/+1
Remove scrutinee_hir_id from ExprKind::Match It is unused.
2025-02-18Rollup merge of #137214 - cyrgani:clippy_diagnostic_items, r=compiler-errorsUrgau-0/+14
add last std diagnostic items for clippy Part of https://github.com/rust-lang/rust-clippy/issues/5393. Add diagnostic item attributes to the items in `std` and `core` where clippy currently uses hardcoded paths (https://github.com/rust-lang/rust-clippy/blob/master/clippy_utils/src/paths.rs).
2025-02-18Rollup merge of #137211 - lcnr:alias-relate-accept-error, r=compiler-errorsUrgau-1/+26
don't ICE for alias-relate goals with error term see comment, fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/165 r? ``@compiler-errors``
2025-02-18Rollup merge of #137205 - thaliaarchi:remove-wasi-fileext-tell, r=alexcrichtonUrgau-11/+0
Remove `std::os::wasi::fs::FileExt::tell` Following #137165 (Use `tell` for `<File as Seek>::stream_position`), `tell` is now directly exposed via `stream_position`, making `<File as FileExt>::tell` redundant. Remove it. `std::os::wasi::fs::FileExt::tell` is currently unstable and tracked in https://github.com/rust-lang/rust/issues/71213. ``@rustbot`` ping wasi
2025-02-18Rollup merge of #137202 - Mark-Simulacrum:interned-is-hash, r=saethlinUrgau-1/+43
Enforce T: Hash for Interned<...> This adds panicking Hash impls for several resolver types that don't actually satisfy this condition. It's not obvious to me that rustc_resolve actually upholds the Interned guarantees but fixing that seems pretty hard (the structures have at minimum some interior mutability, so it's not really recursively hashable in place...). FIXME comments as such on those impls. cc https://github.com/rust-lang/rust/pull/137196#issuecomment-2664350287 r? ``@saethlin``
2025-02-18Rollup merge of #137195 - workingjubilee:remove-pref-align-from-cg-clif, ↵Urgau-5/+4
r=bjorn3 cg_clif: use exclusively ABI alignment This will minimize possible conflict with future updates to AbiAndPrefAlign that may remove some fields. It is also almost a bug to consider them. r? ``@bjorn3``
2025-02-18Rollup merge of #137167 - martn3:reliable_f16_math-f16-erfc, r=tgross35Urgau-0/+2
tests: Also gate `f16::erfc()` doctest with `reliable_f16_math` cfg In #136324 the doctest for `f16::erf()` was gated with `reliable_f16_math`. Add the same gate on `f16::erfc()` to avoid: rust_out.71e2e529d20ea47d-cgu.0:\ (.text._ZN8rust_out4main43_doctest_main_library_std_src_f16_rs_1321_017h485f3ffe6bf2a981E+0x38): \ undefined reference to `__gnu_h2f_ieee' on MIPS (and maybe other architectures). r? tgross35
2025-02-18Rollup merge of #137151 - Urgau:register-more-signals, r=workingjubileeUrgau-11/+39
Install more signal stack trace handlers This PR install the signal stack handler to more signals (`SIGILL`, ~~`SIGTRAP`~~, ~~`SIGABRT`~~, ~~`SIGFPE`~~, `SIGBUS`, ~~`SIGQUIT`~~). Noticed in https://github.com/rust-lang/rust/issues/137138 that we didn't print anything for `SIGILL`, so I though we could just handle more signals. r? `````@workingjubilee````` since you last touched it
2025-02-18Rollup merge of #136750 - kornelski:ub-bug, r=saethlinUrgau-3/+5
Make ub_check message clear that it's not an assert I've seen a user assume that their unsound code was *safe*, because ub_check prevented the program from performing the unsafe operation. This PR makes the panic message clearer that ub_check is a bug detector, not run-time safety protection.
2025-02-18Fix typo in hidden internal docs of `TrustedRandomAccess`Frank Steffahn-4/+4
I typoed the coercion direction here 4 years ago; fixing it now
2025-02-18Reorder "This lock may be advisory or mandatory." earlier in the lock docsJosh Triplett-18/+18
2025-02-18Clarify that locking on Windows also works for files opened with `.read(true)`Josh Triplett-5/+5
2025-02-18Use `yes` except target_os = "nto".Xing Xue-5/+12
2025-02-18x86-sse2 ABI: use SSE registers for floats and SIMDRalf Jung-151/+273
2025-02-18Remove scrutinee_hir_id from ExprKind::Matchbjorn3-3/+1
It is unused
2025-02-18cosmetic changesLukas Markeffsky-18/+22
- change function parameter order to `cx, ty, ...` to match the other functions in this file - use `ct` identifier for `ty::Const` to match the majority of the compiler codebase - remove useless return - bring match arms in a more natural order
2025-02-18remove useless parameterLukas Markeffsky-36/+10
Remove the `repr` parameter from the wrappers around `calc.univariant`, because it's always defaulted. Only ADTs can have a repr and those call `calc.layout_of_struct_or_enum` and not `calc.univariant`.
2025-02-18remove redundant codeLukas Markeffsky-11/+9
- we normalize before calling `layout_of_uncached`, so we don't need to normalize again later - we check for type/const errors at the top of `layout_of_uncached`, so we don't need to check again later
2025-02-18remove unreachable casesLukas Markeffsky-15/+8
`ty::Placeholder` is used by the trait solver and computing its layout was necessary, because the `PointerLike` trait used to be automatically implemented for all types with pointer-like layout. Nowadays, `PointerLike` requires user-written impls and the trait solver no longer computes any layouts, so this can be removed. Unevaluated constants that aren't generic should have caused a const eval error earlier during normalization.
2025-02-18clean up layout error diagnosticsLukas Markeffsky-27/+27
- group the fluent slugs together - reword (internal-only) "too generic" error to be more in line with the other errors
2025-02-18document and test all `LayoutError` variantsLukas Markeffsky-1/+102
2025-02-18eval_outlives: bail out early if both regions are in the same SCCAmanda Stjerna-0/+5
2025-02-18add last std diagnostic items for clippycyrgani-0/+14
2025-02-18don't ICE for alias-relate goals with error termlcnr-1/+26
2025-02-18cg_clif: Tweak formatting of global commentsJubilee-2/+2
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>