Repository navigation
Rollup of 11 pull requests - #166162
Rollup of 11 pull requests#166162
Conversation
The previous implementation inserted each new statement in a block separately, which in the worst case moved all existing statements each time. Use a simple merging strategy to improve complexity from O(num existing statements × num new statements) to O(num existing statements + num new statements).
For reference patterns like `&(v @ S{a, b})` the compiler emits the
unused parens warning. Without the parenthesis the pattern becomes
`&v @ S{a, b}` which makes the expression look a little confusing and
it seems like `v` is being binded by reference.
Add an explicit pattern matcher to catch such a pattern that would
involve an identifier binding with a compound type and avoid emitting
the `unused_parens` diagnostics for this.
Signed-off-by: Hardik Kumar <hardikxk@gmail.com>
Signed-off-by: Hardik Kumar <hardikxk@gmail.com>
Signed-off-by: Hardik Kumar <hardikxk@gmail.com>
Signed-off-by: Hardik Kumar <hardikxk@gmail.com>
…teAttribute` Currently, `UnusedDuplicate` is used when a duplicate attribute is a warning, and `UnusedMultiple` is used when it is an error. This commit removes the redundancy in favor of a new lint, `DuplicateAttribute`. The error messages now look like "duplicate `X` attributes", instead of "multiple `X` attributes" or "duplicate attribute". Thanks to @JonathanBrouwer for the suggestion to work on this
MirPatch: reduce new statement insertion complexity The previous implementation inserted each new statement in a block separately, which in the worst case moved all existing statements each time. Use a simple merging strategy to improve complexity from O(num existing statements × num new statements) to O(num existing statements + num new statements). Helps with rust-lang#121354.
…tr, r=JonathanBrouwer test `feature(asm_const_ptr)` with a vtable This tests an interesting interaction between features, and a special code path for generating vtables. I'm especially interested in how/whether the GCC backend supports this correctly.
…etrochenkov Chain the spans of qualified paths instead of having a first-to-last scheme > [!CAUTION] > **Stacked** on top of rust-lang#165875. Do not merge before it. This patch changes how qualified paths build spans, from first-to-last to a chained scheme, contributing to rust-lang#126763. NB: only the last commit contains new changes. r? @petrochenkov
…-self-type, r=mu001999
Fix dead-code marking dead enum variants as live
This fixes a bug with the dead-code lint. Constructing an enum variant inside a match arm that matches on the same enum variant should not count to it being marked as live. This behavior was already implemented, but it only worked when the pattern matches on the enum type directly, not via the `Self` type alias. As an example, see:
```rust
enum Enum {
Variant1, // This is marked as dead
Variant2, // This isnt
}
impl Clone for Enum {
fn clone(&self) -> Self {
match self {
Enum::Variant1 => Enum::Variant1,
Self::Variant2 => Self::Variant2,
}
}
}
fn main() {
// keep enum itself live
let _: Enum = todo!();
}
```
This PR fixes this by resolving the `QPath` of the pattern properly.
As a result, the derived `Clone` impl for an enum like the above now doesn't result in the variants being kept alive at all. Previously, we'd get a note saying that a variant is constructed in the `Clone` impl but that this was being intentionally ignored (due to `#[rustc_trivial_field_reads]`), but now this note does not appear anymore.
Additionally, this PR also adds a test which actually uses the `ignore_variant_stack` (i.e. the mechanism responsible for preventing enum variants from being marked live in arms where we match on them). The original PR (rust-lang#25961) which added the `ignore_variant_stack` also added a test that uses `#[derive(Clone)]` to test the ignored variant stack.
However, after `rustc_trivial_field_reads` was added (in rust-lang#85200), this test didn't actually run into the dead variant stack anymore, since the derived `Clone` impl was ignored for dead-code analysis. So on current `main` it was possible to remove the `ignore_variant_stack` entirely without a single test failing.
r? @mu001999
…ta-layout, r=mati865 rustc_target: catch up with LLVM 24 movement on ppc64le bsd data layout Changed in LLVM today: llvm/llvm-project#232336 @rustbot label: +llvm-main
…, r=ChrisDenton windows seek_write: document interaction with append mode [MS docs](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-ntwritefile) say that the offset is ignored for files opened with FILE_APPEND_DATA. Our `append(true)` [maps to](https://github.com/rust-lang/rust/blob/0df97849e3a1abbaff8969ec3b9cd9334ab68790/library/std/src/sys/fs/windows.rs#L294-L295) `c::FILE_GENERIC_WRITE & !c::FILE_WRITE_DATA` for `CreateFileW`... which then presumably translates into `FILE_APPEND_DATA` for `NtCreateFile`? r? @ChrisDenton
…-diagnostic, r=JonathanBrouwer Duplicate attribute diagnostic cleanups Currently there are two different diagnostics for when you can't have a duplicate attribute on an item, `UnusedDuplicate` and `UnusedMultiple`. This PR deduplicates their behavior into `UnusedMultiple`. In a separate commit, it renames `UnusedMultiple` to `DuplicateAttribute`, a more sensible name. Separately, the third commit fixes a small issue where diagnostics about attributes would be printed with `..` as a path separator instead of `::` Thanks to Jonathan Brouwer for the suggestion to work on this! r? @JonathanBrouwer
…kertdev
lint: Avoid unused_parens warning for ref patterns binding an identifier
For reference patterns like `&(v @ S{a, b})` the compiler emits the unused parens warning. Without the parenthesis the pattern becomes `&v @ S{a, b}` which makes the expression look a little confusing and it seems like `v` is being binded by reference.
Add an explicit pattern matcher to catch all such patterns that would involve an identifier binding with any pattern and avoid emitting the `unused_parens` diagnostic for this.
closes rust-lang#165636
…dianne `rustc_mir_build`: de-duplicate `local_temp_lifetime()`
…ohnTitor Add `cd` alias to `std::env::set_current_dir` Addresses rust-lang#130058, let me know if there are any suggestions to add. Adds the `cd` alias to the [`std::env::set_current_dir`](https://doc.rust-lang.org/stable/std/env/fn.set_current_dir.html) function, which can make finding it easier.
…t, r=panstromek Don't recover invalid literals in attribute parsing The attempt at parser recovery creates duplicate diagnostics, where the non-recovered diagnostic is better, so we should remove it. This is also blocking for rust-lang#164898
This comment has been minimized.
This comment has been minimized.
Rollup of 11 pull requests try-job: dist-various-1 try-job: dist-various-2 try-job: test-various try-job: test-x86_64-gnu-aux try-job: test-x86_64-msvc-1 try-job: test-aarch64-apple-1 try-job: test-aarch64-apple-2 try-job: test-x86_64-mingw-1 try-job: test-i686-msvc try-job: test-armhf-gnu try-job: test-x86_64-gnu-llvm-22-3 try-job: test-aarch64-msvc-2
This comment has been minimized.
This comment has been minimized.
…uwer Rollup of 11 pull requests Successful merges: - #165913 (MirPatch: reduce new statement insertion complexity) - #166081 (test `feature(asm_const_ptr)` with a vtable) - #166094 (Chain the spans of qualified paths instead of having a first-to-last scheme ) - #166113 (Fix dead-code marking dead enum variants as live) - #166118 (rustc_target: catch up with LLVM 24 movement on ppc64le bsd data layout) - #166155 (windows seek_write: document interaction with append mode) - #165935 (Duplicate attribute diagnostic cleanups) - #165948 (lint: Avoid unused_parens warning for ref patterns binding an identifier) - #166018 (`rustc_mir_build`: de-duplicate `local_temp_lifetime()`) - #166111 (Add `cd` alias to `std::env::set_current_dir`) - #166157 (Don't recover invalid literals in attribute parsing)
|
💔 Test for 3905bab failed: CI. Failed job:
|
|
@bors retry |
This comment has been minimized.
This comment has been minimized.
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 e3b9a83 (parent) -> b0b6006 (this PR) Test differencesShow 130 test diffsStage 1
Stage 2
Additionally, 116 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 b0b600668bb9b4a897e2299b0a44289d42276545 --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 (b0b6006): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.9%, secondary -0.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -1.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 459.437s -> 459.328s (-0.02%) |
|
📌 Perf builds for each rolled up PR:
parent commit: e3b9a8345a In the case of a perf regression, run the following command with the SHAs of each PR you suspect might be the cause: |
Successful merges:
feature(asm_const_ptr)with a vtable #166081 (testfeature(asm_const_ptr)with a vtable)rustc_mir_build: de-duplicatelocal_temp_lifetime()#166018 (rustc_mir_build: de-duplicatelocal_temp_lifetime())cdalias tostd::env::set_current_dir#166111 (Addcdalias tostd::env::set_current_dir)r? @ghost
Create a similar rollup