Rollup of 12 pull requests#156617
Conversation
When an unconstrained type or lifetime parameter is detected in an `impl`, provide more specific help based on its usage: - If the parameter is entirely unused, suggest removing it. - If it is used in the `impl` body but not the `Self` type, suggest including it in the `Self` type and the struct definition. This also adds a comprehensive UI test for these cases.
This ensures that user arguments can override target arguments without being silently ignored.
The linker will complain about undefined symbols otherwise and on object file formats with two level namespaces (Mach-O and PE/COFF) it is required to know which dylib a symbol will be imported from when linking a dylib or executable.
…er-fix, r=davidtwco Unconstrained parameter fix This PR is an attempt to solve the issue described in the issue rust-lang#107295
…onszelmann Require EIIs to be defined when we compile a rust dylib The linker will complain about undefined symbols otherwise and on object file formats with two level namespaces (Mach-O and PE/COFF) it is required to know which dylib a symbol will be imported from when linking a dylib or executable. r? @jdonszelmann
…ream, r=petrochenkov Implement pinned drop sugar Implements `fn drop(&pin mut self)` as sugar for `Drop::pin_drop`. The resolver recognizes `fn drop(&pin mut self)` syntactically in trait impls and performs lookup using the effective `pin_drop` name. AST lowering independently rechecks the syntactic sugar, validates that the resolved item belongs to the actual `Drop` lang trait, and emits HIR with ident `pin_drop` for accepted sugar. Existing type checking, Drop validation, drop glue, and direct-call checks remain unchanged. Drop identity is checked during AST lowering through `tcx.lang_items().drop_trait()`, after resolver has performed the effective `pin_drop` lookup. The resolver does not need to know whether the trait is the actual `Drop` lang item, and it no longer passes marked impl item IDs to lowering. This intentionally preserves the base pinned-drop behavior where `#[pin_v2]` types must use `pin_drop`, while non-`#[pin_v2]` types may still implement `pin_drop`. r? @petrochenkov ## Related rust-lang#144537 rust-lang#130494
…lexcrichton Allow user-provided `llvm_args` to override target spec arguments This switches the order in which `-Cllvm-args` is applied between target-spec arguments and user-provided LLVM arguments. This came up in rust-lang#156061, where the target passing `-Cllvm-args=-wasm-use-legacy-eh=false` means that a user passing `-Cllvm-args=-wasm-use-legacy-eh=true` cannot override this value since the LLVM arguments support the last argument overriding the previous, and user arguments were chained first. With this change, it is possible for Wasm targets to opt into legacy EH for compatibility with runtimes that don't yet implement the modern exnref/try_table instructions, such as Node.js 20 on V8 11.3 and older browsers. While Node.js 20 is formally EOL, many libraries will still need to support this version for a few months yet, so this would ease the transition path to modern exception handling having an opt-out. Originally this PR added support for a dedicated `-Z` flag for switching to legacy exception handling, but fine-grained control over the arguments would be a preferable solution provided it does not conflict with other behaviours. //cc @alexcrichton
Disable `main_needs_argc_argv` for Wasm AFAIU this explains to the "Rust Runtime" that `main()` doesn't need `argc`/`argv`. Newer Wasm targets have explicitly disabled this, this PR changes it so that the base Wasm configuration affecting all Wasm targets disables this now. This affects the following targets: - `wasm32-unknown-unknown` - `wasm32v1-none` - `wasm64-unknown-unknown` The only Wasm target where `main_needs_argc_argv` is still enabled is `wasm32-unknown-emscripten`. @hoodmane let me know and I can remove it there as well. Credit goes to @Spxg for stumbling on this. r? @alexcrichton
…BoxyUwU Make const param default test reproduce original ICE As discussed in [comment](rust-lang#156325 (comment)). ICE using old logic: [old-logic-ice.txt](https://github.com/user-attachments/files/27797628/old-logic-ice.txt) r? BoxyUwU
actually run the temp_dir doctest No idea why this currently doesn't get run. That said, this might fail in Miri, so we may have to wait for rust-lang/miri#5029.
…utf8-pattern, r=ChrisDenton Require UTF-8 in `Utf8Pattern::StringPattern` Store `&str` instead, so the UTF-8 invariant is enforced at the API boundary. Fixes rust-lang#156491
…, r=petrochenkov delegation: emit error when self type is not specified and accessed This PR adds error reporting when we create error self type if it was not specified. In most of the tests there were other errors, so this delayed bug was not triggered, but there are cases like `reuse Default::default;` (rust-lang#156388) which does not emit other errors and those delayed bugs are triggered. Part of rust-lang#118212. Fixes rust-lang#156388. r? @petrochenkov
…i-obk Use DropCtxt::new_block and new_block_with_statements systematically. Misc cleanups I found while staring at that code.
…xpansion, r=Urgau Correctly handle associated items in rustdoc macro expansion Fixes rust-lang#156075. The bug was simply that it didn't cover associated items. r? @Urgau
coverage: Reduce and clarify the context-mismatch test case Most of the complexity in this test case isn't needed to reproduce the condition observed in rust-lang#147339. I have checked that this reduced test case still triggers the context-mismatch in `extract_refined_covspans`.
This comment has been minimized.
This comment has been minimized.
Rollup of 12 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-2
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 d7f14d3 (parent) -> 3514361 (this PR) Test differencesShow 153 test diffsStage 1
Stage 2
Additionally, 130 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 35143615544ede08a47947901cd4a6b7c5ecd450 --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 |
|
📌 Perf builds for each rolled up PR:
previous master: d7f14d3d89 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
|
Finished benchmarking commit (3514361): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary -0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis perf run didn't have relevant results for this metric. Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 511.252s -> 513.812s (0.50%) |
Successful merges:
llvm_argsto override target spec arguments #156554 (Allow user-providedllvm_argsto override target spec arguments)main_needs_argc_argvfor Wasm #156571 (Disablemain_needs_argc_argvfor Wasm)Utf8Pattern::StringPattern#156556 (Require UTF-8 inUtf8Pattern::StringPattern)r? @ghost
Create a similar rollup