-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 14 pull requests #126962
Rollup of 14 pull requests #126962
Commits on Jun 18, 2024
-
Configuration menu - View commit details
-
Copy full SHA for a264bff - Browse repository at this point
Copy the full SHA a264bffView commit details
Commits on Jun 20, 2024
-
Configuration menu - View commit details
-
Copy full SHA for dd557d8 - Browse repository at this point
Copy the full SHA dd557d8View commit details
Commits on Jun 23, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 594fa01 - Browse repository at this point
Copy the full SHA 594fa01View commit details
Commits on Jun 24, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 8cfd4b1 - Browse repository at this point
Copy the full SHA 8cfd4b1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 273447c - Browse repository at this point
Copy the full SHA 273447cView commit details -
Do not ICE when suggesting dereferencing closure arg
Account for `for` lifetimes when constructing closure to see if dereferencing the return value would be valid. Fix rust-lang#125634, fix rust-lang#124563.
Configuration menu - View commit details
-
Copy full SHA for a2298a6 - Browse repository at this point
Copy the full SHA a2298a6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6521c39 - Browse repository at this point
Copy the full SHA 6521c39View commit details -
Configuration menu - View commit details
-
Copy full SHA for 553a690 - Browse repository at this point
Copy the full SHA 553a690View commit details -
Configuration menu - View commit details
-
Copy full SHA for 26677eb - Browse repository at this point
Copy the full SHA 26677ebView commit details
Commits on Jun 25, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 8016940 - Browse repository at this point
Copy the full SHA 8016940View commit details -
core: VaArgSafe is an unsafe trait
`T: VaArgSafe` is relied on for soundness. Safe impls promise nothing. Therefore this must be an unsafe trait. Slightly pedantic, as only core can impl this, but we could choose to unseal the trait. That would allow soundly (but unsafely) implementing this for e.g. a `#[repr(C)] struct` that should be passable by varargs.
Configuration menu - View commit details
-
Copy full SHA for 050595a - Browse repository at this point
Copy the full SHA 050595aView commit details -
Tweak
FlatPat::new
to avoid a temporarily-invalid stateIt was somewhat confusing that the old constructor would create a `FlatPat` in a (possibly) non-simplified state, and then simplify its contents in-place. So instead we now create its fields as local variables, perform simplification, and then create the struct afterwards. This doesn't affect correctness, but is less confusing.
Configuration menu - View commit details
-
Copy full SHA for c2f1072 - Browse repository at this point
Copy the full SHA c2f1072View commit details -
Configuration menu - View commit details
-
Copy full SHA for f2ade37 - Browse repository at this point
Copy the full SHA f2ade37View commit details -
Configuration menu - View commit details
-
Copy full SHA for 221dd30 - Browse repository at this point
Copy the full SHA 221dd30View commit details -
Configuration menu - View commit details
-
Copy full SHA for c7b579a - Browse repository at this point
Copy the full SHA c7b579aView commit details -
rust-lang#126333 remove
PathBuf::as_mut_vec
reference at top of `Pa……thBuf::_push`
Configuration menu - View commit details
-
Copy full SHA for 2155c6c - Browse repository at this point
Copy the full SHA 2155c6cView commit details -
Configuration menu - View commit details
-
Copy full SHA for b08cd69 - Browse repository at this point
Copy the full SHA b08cd69View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7e187e8 - Browse repository at this point
Copy the full SHA 7e187e8View commit details -
6
Configuration menu - View commit details
-
Copy full SHA for aa46a33 - Browse repository at this point
Copy the full SHA aa46a33View commit details -
Configuration menu - View commit details
-
Copy full SHA for d30d85f - Browse repository at this point
Copy the full SHA d30d85fView commit details -
Rollup merge of rust-lang#126618 - mu001999-contrib:dead/enhance, r=p…
…nkfelix Mark assoc tys live only if the corresponding trait is live r? `````@pnkfelix`````
Configuration menu - View commit details
-
Copy full SHA for 77f60a9 - Browse repository at this point
Copy the full SHA 77f60a9View commit details -
Rollup merge of rust-lang#126746 - compiler-errors:no-rpitit, r=oli-obk
Deny `use<>` for RPITITs Precise capturing `use<>` syntax is currently a no-op on RPITITs, since GATs have no variance, so all captured lifetimes are captured invariantly. We don't currently *need* to support `use<>` on RPITITs, since `use<>` is initially intended for migrating RPIT *overcaptures* from edition 2021->2024, but since RPITITs currently capture all in-scope lifetimes, we'll never need to write `use<>` on an RPITIT. Eventually, though, it would be desirable to support precise capturing on RPITITs, since RPITITs overcapturing by default can be annoying to some folks. But let's separate that (which will likely require some delicate types team work for adding variances to GATs and adjusting the refinement rules) from the stabilization of the feature for edition 2024. r? oli-obk cc ```@traviscross``` Tracking: - rust-lang#123432
Configuration menu - View commit details
-
Copy full SHA for e1a6e3b - Browse repository at this point
Copy the full SHA e1a6e3bView commit details -
Rollup merge of rust-lang#126868 - bvanjoi:fix-126764, r=davidtwco
not use offset when there is not ends with brace Fixes rust-lang#126764
Configuration menu - View commit details
-
Copy full SHA for 5f03101 - Browse repository at this point
Copy the full SHA 5f03101View commit details -
Rollup merge of rust-lang#126884 - estebank:issue-125634, r=Nadrieril
Do not ICE when suggesting dereferencing closure arg Account for `for` lifetimes when constructing closure to see if dereferencing the return value would be valid. Fix rust-lang#125634, fix rust-lang#124563.
Configuration menu - View commit details
-
Copy full SHA for c7dc441 - Browse repository at this point
Copy the full SHA c7dc441View commit details -
Rollup merge of rust-lang#126885 - Borgerr:rm_internal_pathbuf_asmutv…
…ec, r=workingjubilee Remove internal `PathBuf::as_mut_vec` closes rust-lang#126333
Configuration menu - View commit details
-
Copy full SHA for 457cc4e - Browse repository at this point
Copy the full SHA 457cc4eView commit details -
Rollup merge of rust-lang#126893 - dtolnay:prec, r=compiler-errors
Eliminate the distinction between PREC_POSTFIX and PREC_PAREN precedence level I have been tangling with precedence as part of porting some pretty-printer improvements from syn back to rustc (related to parenthesization of closures, returns, and breaks by the AST pretty-printer). As far as I have been able to tell, there is no difference between the 2 different precedence levels that rustc identifies as `PREC_POSTFIX` (field access, square bracket index, question mark, method call) and `PREC_PAREN` (loops, if, paths, literals). There are a bunch of places that look at either `prec < PREC_POSTFIX` or `prec >= PREC_POSTFIX`. But there is nothing that needs to distinguish PREC_POSTFIX and PREC_PAREN from one another. https://github.com/rust-lang/rust/blob/d49994b060684af423339b55769439b2f444a7b9/compiler/rustc_ast/src/util/parser.rs#L236-L237 https://github.com/rust-lang/rust/blob/d49994b060684af423339b55769439b2f444a7b9/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs#L2829 https://github.com/rust-lang/rust/blob/d49994b060684af423339b55769439b2f444a7b9/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs#L1290 In the interest of eliminating a distinction without a difference, this PR collapses these 2 levels down to 1. There is exactly 1 case where an expression with PREC_POSTFIX precedence needs to be parenthesized in a location that an expression with PREC_PAREN would not, and that's when the receiver of ExprKind::MethodCall is ExprKind::Field. `x.f()` means a different thing than `(x.f)()`. But this does not justify having separate precedence levels because this special case in the grammar is not governed by precedence. Field access does not have "lower precedence than" method call syntax — you can tell because if it did, then `x.f[0].f()` wouldn't be able to have its unparenthesized field access in the receiver of a method call. Because this Field/MethodCall special case is not governed by precedence, it already requires special handling and is not affected by eliminating the PREC_POSTFIX precedence level. https://github.com/rust-lang/rust/blob/d49994b060684af423339b55769439b2f444a7b9/compiler/rustc_ast_pretty/src/pprust/state/expr.rs#L217-L221
Configuration menu - View commit details
-
Copy full SHA for ad2eba4 - Browse repository at this point
Copy the full SHA ad2eba4View commit details -
Rollup merge of rust-lang#126915 - SparkyPotato:fix-126903, r=compile…
…r-errors Don't suggest awaiting in closure patterns Fixes rust-lang#126903. For ```rust async fn do_async() {} fn main() { Some(do_async()).map(|()| {}); } ``` the error is now ```rust error[E0308]: mismatched types --> src/main.rs:4:27 | 4 | Some(do_async()).map(|()| {}); | ^^ | | | expected future, found `()` | expected due to this | = note: expected opaque type `impl Future<Output = ()>` found unit type `()` ``` Ideally, if `main` were to be `async`, it should be ```rs error[E0308]: mismatched types --> src/main.rs:4:27 | 4 | Some(do_async()).map(|()| {}); | ^^ | | | expected future, found `()` | expected due to this | = note: expected opaque type `impl Future<Output = ()>` found unit type `()` help: consider `await`ing on the `Future` | 4 | Some(do_async().await).map(|()| {}); | ++++++ ``` However, this would mean `FnCtx::check_pat_top` would have to be called with an `origin_expr` in `rustc_hir_typeck::check::check_fn`, and that expr would have to be somehow plumbed through `FnCtxt::check_expr_closure` and closure signature deduction. I'm willing to work on the plumbing but unsure how to start.
Configuration menu - View commit details
-
Copy full SHA for a946c76 - Browse repository at this point
Copy the full SHA a946c76View commit details -
Rollup merge of rust-lang#126916 - ferrocene:hoverbear/riscv64gc-gnu-…
…specify-linker, r=Kobzol Specify target specific linker for `riscv64gc-gnu` job In rust-lang#125669 I updated the `riscv64gc-gnu` job to be more in line with other jobs, like the `armhf-gnu` one. I missed something important, though! Since the `riscv64gc-unknown-linux-gnu` builds go through a cross compiler, invoking `cc` is not correct! That would invoke the `x86_64-unknown-linux-gnu` linker, instead of the `riscv64gc-unknown-linux-gnu` linker. While developing rust-lang#125669 I assumed this line would have been sufficient, however it was not: https://github.com/rust-lang/rust/blob/553a69030e5a086eb3841d020db8c9c463948c72/src/ci/docker/host-x86_64/disabled/riscv64gc-gnu/Dockerfile#L27-L28 Unfortunately, without the linker set, `cc` is invoked, and the following linker error occurs: <details> <summary>Long output</summary> ``` 2024-06-21T14:37:54.4786899Z === HAYSTACK === 2024-06-21T14:37:54.4787240Z error: linking with `cc` failed: exit status: 1 2024-06-21T14:37:54.4787589Z | 2024-06-21T14:37:54.4806781Z = note: LC_ALL="C" PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "cc" "/tmp/rustc7Ju6va/symbols.o" "inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o" "inaccessible/tmp/program.dv9uftjrq86w5xa7l2eo7g9l7.rcgu.o" "-Wl,--as-needed" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/inaccessible-temp-dir/inaccessible-temp-dir/rmake_out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libstd-bb9ed017b7d70437.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libpanic_unwind-5b34ef68c22a7b9b.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libobject-4b9224407e296f51.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libmemchr-1eaaa8d74bbe0b36.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libaddr2line-b34292f7086867e9.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libgimli-1927540c5dff6690.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/librustc_demangle-ab493befe3742702.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libstd_detect-41195694489636c4.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libhashbrown-6905da49c8a1542a.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/librustc_std_workspace_alloc-bbc6290f03f92349.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libminiz_oxide-7a4683d4a82cf47c.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libadler-071583516cdbce90.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libunwind-d84b176d2f4c1334.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libcfg_if-92b7de0160f87442.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/liblibc-cff1533ea7c26263.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/liballoc-49e374c13f9e6132.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/librustc_std_workspace_core-9389dcc15b2f7f7b.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libcore-46f0fa14905fdc5c.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libcompiler_builtins-20e1af401f90cd1c.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib" "-o" "program" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" 2024-06-21T14:37:54.4823900Z = note: /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243) 2024-06-21T14:37:54.4825032Z /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243) 2024-06-21T14:37:54.4826130Z /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243) 2024-06-21T14:37:54.4827200Z /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243) 2024-06-21T14:37:54.4828279Z /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243) 2024-06-21T14:37:54.4829365Z /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243) 2024-06-21T14:37:54.4830474Z /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243) 2024-06-21T14:37:54.4831554Z /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243) 2024-06-21T14:37:54.4833002Z /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243) 2024-06-21T14:37:54.4834116Z /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243) 2024-06-21T14:37:54.4835237Z /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: error adding symbols: file in wrong format 2024-06-21T14:37:54.4835971Z collect2: error: ld returned 1 exit status 2024-06-21T14:37:54.4836449Z 2024-06-21T14:37:54.4836584Z 2024-06-21T14:37:54.4836744Z error: aborting due to 1 previous error 2024-06-21T14:37:54.4836983Z 2024-06-21T14:37:54.4836990Z 2024-06-21T14:37:54.4837083Z === NEEDLE === 2024-06-21T14:37:54.4837518Z failed to find or create the directory specified by `--temps-dir` 2024-06-21T14:37:54.4838250Z thread 'main' panicked at /checkout/tests/run-make/inaccessible-temp-dir/rmake.rs:35:14: 2024-06-21T14:37:54.4838801Z needle was not found in haystack 2024-06-21T14:37:54.4839270Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace 2024-06-21T14:37:54.4840125Z thread 'main' panicked at /checkout/tests/run-make/inaccessible-temp-dir/rmake.rs:27:5: 2024-06-21T14:37:54.4840759Z called `Result::unwrap()` on an `Err` value: Any { .. } 2024-06-21T14:37:54.4841194Z ------------------------------------------ ``` </details> By setting `--set target.riscv64gc-unknown-linux-gnu.linker=riscv64-linux-gnu-gcc` the correct linker is invoked. ## Testing > [!NOTE] > `riscv64gc-unknown-linux-gnu` is a [**Tier 2 with Host Tools** platform](https://doc.rust-lang.org/beta/rustc/platform-support.html), all tests may not necessarily pass! This change should only make fix existing broken tests (like `inaccessible-temp-dir`) while introducing no new breakage. You can test out the job locally: ```sh mv src/ci/docker/host-x86_64/disabled/riscv64gc-gnu src/ci/docker/host-x86_64/riscv64gc-gnu DEPLOY=1 ./src/ci/docker/run.sh riscv64gc-gnu ```
Configuration menu - View commit details
-
Copy full SHA for fd17aaa - Browse repository at this point
Copy the full SHA fd17aaaView commit details -
Rollup merge of rust-lang#126926 - Zalathar:candidate-per-arm, r=Nadr…
…ieril Tweak a confusing comment in `create_match_candidates` This comment was accurate at the time it was written, but various later changes reshuffled things in ways that caused the existing comment to become confusing. I've therefore tried to clarify that *these* candidates are 1:1 with match arms, while also warning that that isn't the case in general.
Configuration menu - View commit details
-
Copy full SHA for ddc7d5b - Browse repository at this point
Copy the full SHA ddc7d5bView commit details -
Rollup merge of rust-lang#126927 - workingjubilee:vaargsafe-is-unsafe…
…, r=joboet core: VaArgSafe is an unsafe trait `T: VaArgSafe` is relied on for soundness. Safe impls promise nothing. Therefore this must be an unsafe trait. Slightly pedantic, as only core can impl this, but we *could* choose to unseal the trait. That would allow soundly (but unsafely) implementing this for e.g. a `#[repr(C)] struct` that should be passable by varargs. Relates to rust-lang#44930
Configuration menu - View commit details
-
Copy full SHA for 2af6c9b - Browse repository at this point
Copy the full SHA 2af6c9bView commit details -
Rollup merge of rust-lang#126932 - Zalathar:flat-pat, r=Nadrieril
Tweak `FlatPat::new` to avoid a temporarily-invalid state It was somewhat confusing that the old constructor would create a `FlatPat` in a (possibly) non-simplified state, and then simplify its contents in-place. So instead we now create its fields as local variables, perform simplification, and then create the struct afterwards. This doesn't affect correctness, but is less confusing. --- I've also included some semi-related comments that I made while trying to navigate this code.
Configuration menu - View commit details
-
Copy full SHA for 8e2d069 - Browse repository at this point
Copy the full SHA 8e2d069View commit details -
Rollup merge of rust-lang#126941 - GuillaumeGomez:migrate-run-make-ll…
…vm-ident, r=Kobzol Migrate `run-make/llvm-ident` to `rmake.rs` Part of rust-lang#121876. r? `@Kobzol`
Configuration menu - View commit details
-
Copy full SHA for 1626e24 - Browse repository at this point
Copy the full SHA 1626e24View commit details -
Rollup merge of rust-lang#126946 - cyrgani:patch-1, r=compiler-errors
Add missing slash in `const_eval_select` doc comment In the middle of the doc comment, one line has only two slashes instead of three and isn't included in the [rendered documentation](https://doc.rust-lang.org/std/intrinsics/fn.const_eval_select.html#stability-concerns). This PR adds the missing slash.
Configuration menu - View commit details
-
Copy full SHA for fdc973b - Browse repository at this point
Copy the full SHA fdc973bView commit details -
Rollup merge of rust-lang#126947 - Bryanskiy:delegation-lowering-refa…
…ctoring, r=petrochenkov Delegation: ast lowering refactor refactoring changes for rust-lang#126699 r? ``@petrochenkov``
Configuration menu - View commit details
-
Copy full SHA for c49f753 - Browse repository at this point
Copy the full SHA c49f753View commit details