-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Rollup of 10 pull requests #135465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 10 pull requests #135465
Conversation
This is a mistake I've seen newcomers make where they want to express an "out" argument.
``` error[E0308]: mismatched types --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:6:14 | LL | fn change_object(mut object: &Object) { | ------- expected due to this parameter type LL | let object2 = Object; LL | object = object2; | ^^^^^^^ expected `&Object`, found `Object` | help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding | LL ~ fn change_object(object: &mut Object) { LL | let object2 = Object; LL ~ *object = object2; | ``` This might be the first thing someone tries to write to mutate the value *behind* an argument. We avoid suggesting `object = &object2;`, as that is less likely to be what was intended.
``` error: value assigned to `object` is never read --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:11:5 | LL | object = &object2; | ^^^^^^ | note: the lint level is defined here --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:1:9 | LL | #![deny(unused_assignments, unused_variables)] | ^^^^^^^^^^^^^^^^^^ help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding | LL ~ fn change_object2(object: &mut Object) { LL | let object2 = Object; LL ~ *object = object2; | ``` This might be the first thing someone tries to write to mutate the value *behind* an argument, trying to avoid an E0308.
It has been a bit of a pain trying to keep the lints in sync across the submodule repositories, so the just turns it off.
This PR is split off from rust-lang#135368 to reduce noise. Rename DevicePath to OwnedDevicePath. This is to allow a non-owning version of DevicePath in the future to work with UEFI shell APIs which provide const pointers to device paths for UEFI shell fs mapping. Also implement Debug for OwnedDevicePath for some quality of life improvements. Signed-off-by: Ayush Singh <[email protected]>
llvm/llvm-project#122530 changes LLVM to use sized-word rather than ymmword for scatter gather pointers. While this will not always be qword, it is for these two tests.
If we build the standard library with wasm-eh then we need to link with `-fwasm-exceptions` even if we compile with `panic=abort` Without this change, linking a `panic=abort` crate fails with: `undefined symbol: __cpp_exception`. Followup to rust-lang#131830.
…ler-errors Fix cycle error only occurring with -Zdump-mir fixes rust-lang#134205 During mir dumping, we evaluate static items to render their allocations. If a static item refers to itself, its own MIR will have a reference to itself, so during mir dumping we end up evaluating the static again, causing us to try to build MIR again (mir dumping happens during MIR building). Thus I disabled evaluation of statics during MIR dumps in case the MIR body isn't far enough along yet to be able to be guaranteed cycle free.
Detect `mut arg: &Ty` meant to be `arg: &mut Ty` and provide structured suggestion When a newcomer attempts to use an "out parameter" using borrows, they sometimes get confused and instead of mutating the borrow they try to mutate the function-local binding instead. This leads to either type errors (due to assigning an owned value to a mutable binding of reference type) or a multitude of lifetime errors and unused binding warnings. This change adds a suggestion to the type error ``` error[E0308]: mismatched types --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:6:14 | LL | fn change_object(mut object: &Object) { | ------- expected due to this parameter type LL | let object2 = Object; LL | object = object2; | ^^^^^^^ expected `&Object`, found `Object` | help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding | LL ~ fn change_object(object: &mut Object) { LL | let object2 = Object; LL ~ *object = object2; | ``` and to the unused assignment lint ``` error: value assigned to `object` is never read --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:11:5 | LL | object = &object2; | ^^^^^^ | note: the lint level is defined here --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:1:9 | LL | #![deny(unused_assignments, unused_variables)] | ^^^^^^^^^^^^^^^^^^ help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding | LL ~ fn change_object2(object: &mut Object) { LL | let object2 = Object; LL ~ *object = object2; | ``` Fix rust-lang#112357.
…oxyUwU Re-added regression test for rust-lang#122638 Re-adds the test for rust-lang#122638 😄 fixes rust-lang#122638 r? `@BoxyUwU` (please let me know if this can be improved. I am still fairly new to using compiletest)
uefi: helpers: Introduce OwnedDevicePath This PR is split off from rust-lang#135368 to reduce noise. No real functionality changes, just some quality of life improvements. Also implement Debug for OwnedDevicePath for some quality of life improvements.
…compiler-errors rm unnecessary `OpaqueTypeDecl` wrapper
…-lint, r=lqd Make sure to mark `IMPL_TRAIT_REDUNDANT_CAPTURES` as `Allow` in edition 2024 I never got sign-off on rust-lang#127672 for this lint being warn by default in edition 2024, so let's turn downgrade this lint to allow for now. Should be backported so it ships with the edition. ```@rustbot``` label: +beta-nominated
Update books ## rust-lang/book 10 commits in 04d06dfe541607e6419f3d028c3f9b245f3be4d9..5a65e2af063ff701ae858f1f7536ee347b3cfe63 2025-01-09 17:59:43 UTC to 2025-01-06 13:47:07 UTC - Appendix E: Update for 2024 Edition (rust-lang/book#4196) - Implement and integrate an mdBook plugin to strip markup from headings (rust-lang/book#4195) - Update appendix-06-translation.md - new persian translation added (rust-lang/book#4192) - Remove extraneous `use` statement (rust-lang/book#4193) - Take measurement inaccuracy intervals into account (rust-lang/book#4078) - Ch. 21.3: remove error ferris from working code (rust-lang/book#4183) - infra: match mdbook version in CI to rust-lang/rust (rust-lang/book#4191) - Ch. 17: Set correct heading level for the chapter (rust-lang/book#4190) - Switch back from `eprintln!` to `println!` in listing 17-12 (rust-lang/book#4178) - fix typo in Listing invocation for listing 20-14 (rust-lang/book#4184) ## rust-lang/nomicon 1 commits in 7ef05b9777c94836bc92f50f23e6e00981521a89..625b200e5b33a5af35589db0bc454203a3d46d20 2025-01-06 17:17:38 UTC to 2025-01-06 17:17:38 UTC - Fix accidental inline HTML in Markdown (rust-lang/nomicon#474) ## rust-lang/reference 3 commits in acd6794e712d5e2ef6f5c84fb95688d32a69b816..293af991003772bdccf2d6b980182d84dd055942 2025-01-07 16:31:22 UTC to 2025-01-06 17:17:15 UTC - Add spec identifiers to dynamically-sized-types.md (rust-lang/reference#1582) - fix typo in a "rule" name in type-coercions.md (rust-lang/reference#1708) - Fix unclosed `<sup>` elements (rust-lang/reference#1709) ## rust-lang/rust-by-example 2 commits in 093397535b48ae13ec76bc526b7e6eb8c096a85c..054259ed1bf01cdee4309ee764c7e103f6df3de5 2025-01-13 10:44:04 UTC to 2025-01-03 18:59:26 UTC - Fix function name in new_types.md in Japanese (rust-lang/rust-by-example#1907) - Fix typo in static_lifetime.md (rust-lang/rust-by-example#1905)
…ingjubilee Fix emscripten-wasm-eh with unwind=abort If we build the standard library with wasm-eh then we need to link with `-fwasm-exceptions` even if we compile with `panic=abort`. Without this change, linking a `panic=abort` crate fails with: `undefined symbol: __cpp_exception`. Followup to rust-lang#131830. r? workingjubilee
…rrors bootstrap: fix outdated feature name in comment Follow-up to rust-lang#135391 (comment). I guess I updated everything else **except** the comment right next to the actual dependencies 💀 r? bootstrap
llvm: Allow sized-word rather than ymmword in tests llvm/llvm-project#122530 changes LLVM to use sized-word rather than ymmword for scatter gather pointers. While this will not always be qword, it is for these two tests. `@rustbot` label: +llvm-main
@bors r+ rollup=never p=5 |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: 1ab85fbd74 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (35c2908): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (secondary 2.8%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 765.313s -> 764.65s (-0.09%) |
Successful merges:
mut arg: &Ty
meant to bearg: &mut Ty
and provide structured suggestion #134977 (Detectmut arg: &Ty
meant to bearg: &mut Ty
and provide structured suggestion)assertion failed: !ty.has_non_region_infer()
#122638)OpaqueTypeDecl
wrapper #135440 (rm unnecessaryOpaqueTypeDecl
wrapper)IMPL_TRAIT_REDUNDANT_CAPTURES
asAllow
in edition 2024 #135441 (Make sure to markIMPL_TRAIT_REDUNDANT_CAPTURES
asAllow
in edition 2024)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup