Rollup of 9 pull requests#152924
Conversation
Since llvm/llvm-project 159143, llvm no longer weak links the __cpp_exception tag into each object that uses it. They are now defined in compiler-rt. Rust doesn't seem to get them from compiler-rt so llvm decides they need to be imported. This adds them to libunwind.
inline rest of the check try fix ci errors inline in check_let
As far as I can tell it was introduced to allow fat LTO with -Clinker-plugin-lto. Later a change was made to automatically disable ThinLTO summary generation when -Clinker-plugin-lto -Clto=fat is used, so we can safely remove it.
…r=petrochenkov Not linting irrefutable_let_patterns on let chains *[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/146832)* # Description this PR makes the lint `irrefutable_let_patterns` not check for `let chains`, only check for single `if let`, `while let`, and `if let guard`. # Motivation Since `let chains` were stabilized, the following code has become common: ```rust fn max() -> usize { 42 } fn main() { if let mx = max() && mx < usize::MAX { /* */ } } ``` This code naturally expresses "please call that function and then do something if the return value satisfies a condition". Putting the let binding outside the if would be bad as then it remains in scope after the if, which is not the intent. Current Output: ```bash warning: leading irrefutable pattern in let chain --> src/main.rs:7:8 | 7 | if let mx = max() && mx < usize::MAX { | ^^^^^^^^^^^^^^ | = note: this pattern will always match = help: consider moving it outside of the construct = note: `#[warn(irrefutable_let_patterns)]` on by default ``` Another common case is progressively destructuring a struct with enum fields, or an enum with struct variants: ```rust struct NameOfOuterStruct { middle: NameOfMiddleEnum, other: (), } enum NameOfMiddleEnum { Inner(NameOfInnerStruct), Other(()), } struct NameOfInnerStruct { id: u32, } fn test(outer: NameOfOuterStruct) { if let NameOfOuterStruct { middle, .. } = outer && let NameOfMiddleEnum::Inner(inner) = middle && let NameOfInnerStruct { id } = inner { /* */ } } ``` Current Output: ```bash warning: leading irrefutable pattern in let chain --> src\main.rs:17:8 | 17 | if let NameOfOuterStruct { middle, .. } = outer | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this pattern will always match = help: consider moving it outside of the construct = note: `#[warn(irrefutable_let_patterns)]` on by default warning: trailing irrefutable pattern in let chain --> src\main.rs:19:12 | 19 | && let NameOfInnerStruct { id } = inner | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this pattern will always match = help: consider moving it into the body ``` To avoid the warning, the readability would be much worse: ```rust fn test(outer: NameOfOuterStruct) { if let NameOfOuterStruct { middle: NameOfMiddleEnum::Inner(NameOfInnerStruct { id }), .. } = outer { /* */ } } ``` # related issue * rust-lang#139369 # possible questions 1. Moving the irrefutable pattern at the head of the chain out of it would cause a variable that was intended to be temporary to remain in scope, so we remove it. However, should we keep the check for moving the irrefutable pattern at the tail into the body? 2. Should we still lint `entire chain is made up of irrefutable let`? --- This is my first time contributing non-documentation code to Rust. If there are any irregularities, please feel free to point them out. : )
…ate, r=petrochenkov Support importing path-segment keyword with renaming *[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/146972)* #### Reference PR - rust-lang/reference#2010 - rust-lang/reference#2136 #### Description This PR unifies and extends the behavior of importing path-segment keywords (`crate`/`$crate`/`super`/`self`), resolving several long-standing inconsistencies. Previously, Rust only allowed `use crate as name;` without renaming support for other path keywords. This PR enables importing these keywords with explicit renaming. And it also denies importing these keywords without renaming. ##### What's now allowed For **`crate`** and **`$crate`**: - `use crate as name;` - `use crate::{self as name};` - `use $crate as name;` - `use $crate::{self as name};` For **`super`** (including chained `super::super`): - `use super as name;` - `use super::{self as name};` - `use super::super as name;` - `use super::super::{self as name};` For **`self`**: - `use self as name;` - `use self::{self as name};` ##### Removed error codes Two error codes are no longer emitted: - **E0430**: Previously emitted for duplicate `self` imports like `std::fmt::{self, self}`. The existing E0252 ("name defined multiple times") provides sufficient guidance. - **E0431**: Previously emitted for `use {self [as name]};` and `use ::{self [as name]};`. These patterns are now allowed or denied but with new clearer errors. - For `use {self as name};` and `use ::{self as name};` (in edition 2015), they are allowed now and equivalent to `use crate as name`; - For `use {self};` and `use ::{self};` (in edition 2015) without renaming, they are equivalent to `use crate;`, the new clearer error suggests adding an explicit rename. - For `use ::{self [as name]};` after edition 2015, it is equivalent to `use ${extern-prelude} [as name];`, it is denied with new errors. ##### Future We plan to remove error [E0429](https://doc.rust-lang.org/stable/error_codes/E0429.html#error-code-e0429) and support `self` at the end of paths (rust-lang#146972 (comment)). This language extension and lint for redundant `::self` instead of hard error `E0429` will be landed separately in the future. --- Fixes rust-lang#29036 Fixes rust-lang#35612 Fixes rust-lang#37156 Fixes rust-lang#146967 Fixes rust-lang#149811 r? petrochenkov
…ption, r=alexcrichton For panic=unwind on Wasm targets, define __cpp_exception tag Since llvm/llvm-project#159143, llvm no longer weak links the __cpp_exception tag into each object that uses it. They are now defined in compiler-rt. Rust doesn't seem to get them from compiler-rt so llvm decides they need to be imported. This adds them to libunwind. Same changes applied to compiler-builtins: rust-lang/compiler-builtins#1077 See wasm-bindgen/wasm-bindgen#4938 for a downstream workaround. cc @sbc100
…uviper Remove -Zemit-thin-lto flag As far as I can tell it was introduced in rust-lang#98162 to allow fat LTO with `-Clinker-plugin-lto`. In rust-lang#136840 a change was made to automatically disable ThinLTO summary generation when `-Clinker-plugin-lto -Clto=fat` is used, so we can safely remove it. Fixes rust-lang#152490
…coieni Do not cancel try builds after first job failure Suggested by @ZuseZ4, who was doing a bunch of parallel try builds recently. r? @marcoieni
…tests, r=petrochenkov Add tests for delegation generics This PR adds tests from rust-lang#151864 as discussed in this [comment](rust-lang#151864 (comment)). Part of rust-lang#118212. The majority of new tests are added in `mapping` folder, (`ast-hir-engine` folder in rust-lang#151864), those tests test mapping between generic params of delegee and our generated function for delegation (that is why the name of the folder was changed, I think it better reflects what those tests testing). In each mapping test comments were added to each test case and one comment describing the goal of mapping tests was added at the top of each file. Next, tests for defaults in generic params (`generic-params-defaults.rs`), params with the same name (`generic-params-same-names`), errors in providing user-specified generic args (`generics-gen-args-errors.rs`) and wrong signature of a generated function in impl trait case (`impl-trait-wrong-args-count.rs`, renamed from `wrong-args-count-ice.rs` in rust-lang#151864). `generic-aux-pass.rs` test was not added, as all reuses in this test produce known ICE `DefId::expect_local DefId(..) isn't local` rust-lang#143498 (which will be fixed in rust-lang#151864, however it will not close mentioned issue, as synthetic generic params are not yet supported in new generics implementation). r? @petrochenkov
…, r=jdonszelmann Remove the translation `-Z` options and the `Translator` type. This PR implements MCP rust-lang/compiler-team#967 It is split up into individually reviewable commits, each commit passes tests: * rust-lang@6782119 Removes the translation compiler options from the session * rust-lang@8f300d0 Removes the now empty `Translator` type * rust-lang@ab715c5 Renames `translate_message` to `format_diag_message`, as the function no longer does any translation * rust-lang@8bcbc3f Removes a section describing the removed compiler options from the rustc dev guide
Skip the `use_existential_projection_new_instead` field in the `Debug` impl Resolves: rust-lang#152807 . Simply slap a `#derive_where[skip(Debug)]` on that field.
…makai410 Expose Span for all DefIds in rustc_public Part of rust-lang/project-stable-mir#118 To be maximally useful, `VariantDef` and `FieldDef` should be changed to be a wrapper around `DefId` instead of holding their parent and index. I can do this change in this PR or a follow-up if it is desired. For now, I added the missing `impl Stable for DefId` in internals so you can convert from rustc internals.
|
@bors r+ rollup=never p=2 |
|
Trying commonly failed jobs because queue is large so we don't want rollups to fail |
This comment has been minimized.
This comment has been minimized.
Rollup of 9 pull requests try-job: x86_64-msvc-1 try-job: i686-msvc-1 try-job: x86_64-mingw-1 try-job: test-various try-job: armhf-gnu try-job: aarch64-apple try-job: x86_64-gnu-llvm-20-3 try-job: dist-various-2
|
@bors p=3 moving ahead of stuck PR |
This comment has been minimized.
This comment has been minimized.
|
📌 Perf builds for each rolled up PR:
previous master: 0376d43d44 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 0376d43 (parent) -> 1c00e98 (this PR) Test differencesShow 71 test diffsStage 1
Stage 2
Additionally, 29 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 1c00e989ca032d57e815e930fad00b61e65a1826 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (1c00e98): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary 4.9%, secondary -1.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 482.81s -> 480.967s (-0.38%) |
Successful merges:
-Zoptions and theTranslatortype. #152455 (Remove the translation-Zoptions and theTranslatortype. )use_existential_projection_new_insteadfield in theDebugimpl #152813 (Skip theuse_existential_projection_new_insteadfield in theDebugimpl)r? @ghost
Create a similar rollup