about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-11-11Check for null in the `alloc_zeroed` exampleJosh Stone-1/+4
We should demonstrate good behavior, just like #99198 did for `alloc`.
2024-11-11Auto merge of #132902 - matthiaskrgr:rollup-43qgg3t, r=matthiaskrgrbors-57/+674
Rollup of 4 pull requests Successful merges: - #129627 (Ensure that tail expr receive lifetime extension) - #130999 (Implement file_lock feature) - #132873 (handle separate prefixes in clippy rules) - #132891 (Remove `rustc_session::config::rustc_short_optgroups`) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-11Auto merge of #132720 - jieyouxu:do-not-strip, r=davidtwcobors-3/+7
Only copy, rename and link `llvm-objcopy` if llvm tools are enabled Fixes #132719. cc `@bjorn3` who reported the bootstrapping problem for cg_clif. cc `@davidtwco` in case this might be problematic for linux -> macOS cross-compile builds, but seems very unlikely. cc `@albertlarsan68` (co-reviewed #131405) r? bootstrap
2024-11-11Rollup merge of #132891 - Zalathar:short-opt-groups, r=jieyouxuMatthias Krüger-50/+60
Remove `rustc_session::config::rustc_short_optgroups` Follow-up to https://github.com/rust-lang/rust/pull/132754#discussion_r1835427349. The name `rustc_short_optgroups` has always been confusing, because it is unrelated to the distinction between short and long options (i.e. `-s` vs `--long`), and instead means something like “the subset of command-line options that are printed by `rustc --help` without `-v`”. So let's merge that function into the main `rustc_optgroups`, and store the relevant bit of information in a boolean field in `RustcOptGroup` instead. --- This PR also modifies `RustcOptGroup` to store its various strings directly, instead of inside a boxed `apply` closure. That turned out to not be necessary for the main change, but is a worthwhile cleanup in its own right.
2024-11-11Rollup merge of #132873 - onur-ozkan:132867, r=jieyouxuMatthias Krüger-1/+18
handle separate prefixes in clippy rules Fixes https://github.com/rust-lang/rust/issues/132867
2024-11-11Rollup merge of #130999 - cberner:flock_pr, r=joboetMatthias Krüger-0/+575
Implement file_lock feature This adds lock(), lock_shared(), try_lock(), try_lock_shared(), and unlock() to File gated behind the file_lock feature flag This is the initial implementation of https://github.com/rust-lang/rust/issues/130994 for Unix and Windows platforms. I will follow it up with an implementation for WASI preview 2
2024-11-11Rollup merge of #129627 - ↵Matthias Krüger-6/+21
dingxiangfei2009:ensure-tail-expr-in-let-block-works, r=jieyouxu Ensure that tail expr receive lifetime extension cc `@jieyouxu` `@traviscross` It just came to me that we should add a test to make sure that we honor the contract from the temporary lifetime rule #121346. We should continue to implement this rule in Edition 2021 onward and shorter tail expression lifetime should not override it. This is a small PR to improve our assurance and establish a stronger contract. Tracked by rust-lang/rust#123739
2024-11-11ensure that tail expr receive lifetime extensionDing Xiang Fei-6/+21
2024-11-11Auto merge of #127589 - notriddle:notriddle/search-sem-3, r=GuillaumeGomezbors-851/+1980
rustdoc-search: simplify rules for generics and type params **Heads up!**: This PR is a follow-up that depends on #124544. It adds 12dc24f46007f82b93ed85614347a42d47580afa, a change to the filtering behavior, and 9900ea48b566656fb12b5fcbd0a1b20aaa96e5ca, a minor ranking tweak. Part of https://github.com/rust-lang/rust-project-goals/issues/112 This PR overturns https://github.com/rust-lang/rust/pull/109802 ## Preview * no results: [`Box<[A]> -> Vec<B>`](http://notriddle.com/rustdoc-html-demo-12/search-sem-3/std/index.html?search=Box%3C%5BA%5D%3E%20-%3E%20Vec%3CB%3E) * results: [`Box<[A]> -> Vec<A>`](http://notriddle.com/rustdoc-html-demo-12/search-sem-3/std/index.html?search=Box%3C%5BA%5D%3E%20-%3E%20Vec%3CA%3E) * [`T -> U`](http://notriddle.com/rustdoc-html-demo-12/search-sem-3/std/index.html?search=T%20-%3E%20U) * [`Cx -> TyCtxt`](http://notriddle.com/rustdoc-html-demo-12/search-sem-3-compiler/rustdoc/index.html?search=Cx%20-%3E%20TyCtxt) ![image](https://github.com/user-attachments/assets/015ae28c-7469-4f7f-be03-157d28d7ec97) ## Description This commit is a response to feedback on the displayed type signatures results, by making generics act stricter. - Order within generics is significant. This means `Vec<Allocator>` now matches only with a true vector of allocators, instead of matching the second type param. It also makes unboxing within generics stricter, so `Result<A, B>` only matches if `B` is in the error type and `A` is in the success type. The top level of the function search is unaffected. - Generics are only "unboxed" if a type is explicitly opted into it. References and tuples are hardcoded to allow unboxing, and Box, Rc, Arc, Option, Result, and Future are opted in with an unstable attribute. Search result unboxing is the process that allows you to search for `i32 -> str` and get back a function with the type signature `&Future<i32> -> Box<str>`. - Instead of ranking by set overlap, it ranks by the number of items in the type signature. This makes it easier to find single type signatures like transmute. ## Find the discussion on * <https://rust-lang.zulipchat.com/#narrow/stream/393423-t-rustdoc.2Fmeetings/topic/meeting.202024-07-08/near/449965149> * <https://github.com/rust-lang/rust/pull/124544#issuecomment-2204272265> * <https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/deciding.20on.20semantics.20of.20generics.20in.20rustdoc.20search>
2024-11-11Remove `rustc_session::config::rustc_short_optgroups`Zalathar-27/+29
2024-11-11Store option strings directly, not in a boxed `apply` closureZalathar-23/+31
2024-11-11Auto merge of #132880 - RalfJung:implied-features, r=workingjubileebors-3/+16
target_features: explain what exacty 'implied' means here
2024-11-11target_features: explain what exacty 'implied' means hereRalf Jung-3/+16
2024-11-11Auto merge of #132854 - RalfJung:query-key-limit, r=compiler-errorsbors-1/+1
query/plumbing: adjust comment to reality The limit for the query key size got changed recently in https://github.com/rust-lang/rust/commit/f51ec110a714fea09105586b26c7f8e6a2a57018 but the comment was not updated. Though maybe it is time to intern `CanonicalTypeOpAscribeUserTypeGoal` rather than copying it everywhere? r? `@lcnr`
2024-11-11Auto merge of #132885 - jhpratt:rollup-4ddd31p, r=jhprattbors-4/+71
Rollup of 3 pull requests Successful merges: - #131080 (Stabilize WebAssembly `multivalue`, `reference-types`, and `tail-call` target features) - #132871 (add regression test for #85763) - #132878 (triagebot: Assign rustdoc tests to T-rustdoc.) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-10Rollup merge of #132878 - aDotInTheVoid:less-pings-for-mark, r=GuillaumeGomezJacob Pratt-0/+6
triagebot: Assign rustdoc tests to T-rustdoc. Should avoid situations like #132871, which got assigned to mark (via fallback) despite being a rustdoc change. For now, I've assigned all our testsuites to the rustdoc group (whoever from T-Rustdoc is on review rotation), except the json one which is assigned to me. CC `@rust-lang/rustdoc` r? `@GuillaumeGomez`
2024-11-10Rollup merge of #132871 - ↵Jacob Pratt-0/+11
lolbinarycat:rustdoc-heterogeneous-first-paragraph-85763, r=aDotInTheVoid add regression test for #85763 closes #85763
2024-11-10Rollup merge of #131080 - alexcrichton:stabilize-more-wasm-target-features, ↵Jacob Pratt-4/+54
r=petrochenkov Stabilize WebAssembly `multivalue`, `reference-types`, and `tail-call` target features For the `multivalue` and `reference-types` features this commit is similar to https://github.com/rust-lang/rust/pull/117457 in that it's stabilizing target features specific to WebAssembly targets. The previous PR left out these two features because they weren't expected to change much about compiled code so it was unclear what the rationale was. It has [since been discovered][blog] that `reference-types` can be useful as it changes the binary format of the `call_indirect` instruction. Additionally [on Zulip][zulip] there's a use case of detecting these features at compile time and generating a compile error to better warn users about features not supported on engines. This PR then additionally adds the `tail-call` feature which corresponds to the [tail-call] proposal to WebAssembly. This feature advanced to "phase 4" in the WebAssembly CG awhile back and has been supported in LLVM for quite some time now. Engines are finishing up implementations or have already shipped implementations, so while this is a bit of a late addition to Rust itself it reflects the current status of WebAssembly's state of the feature. A test has been added here not only for these features but other WebAssembly features as well to showcase that they're usable without feature gates in stable Rust. [blog]: https://blog.rust-lang.org/2024/09/24/webassembly-targets-change-in-default-target-features.html [zulip]: https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/wasm32.20reference-types.20.2F.20multivalue.20in.201.2E82-beta.20not.20enabled/near/473893987 [tail-call]: https://github.com/webassembly/tail-call
2024-11-11Auto merge of #126597 - estebank:unicode-output, r=fmeasebors-230/+2277
Add Unicode block-drawing compiler output support Add nightly-only theming support to rustc output using Unicode box drawing characters instead of ASCII-art to draw the terminal UI. In order to enable, the flags `-Zunstable-options=yes --error-format=human-unicode` must be passed in. After: ``` error: foo ╭▸ test.rs:3:3 │ 3 │ X0 Y0 Z0 │ ┌───╿──│──┘ │ ┌│───│──┘ │ ┏││━━━┙ │ ┃││ 4 │ ┃││ X1 Y1 Z1 5 │ ┃││ X2 Y2 Z2 │ ┃│└────╿──│──┘ `Z` label │ ┃└─────│──┤ │ ┗━━━━━━┥ `Y` is a good letter too │ `X` is a good letter ╰╴ note: bar ╭▸ test.rs:4:3 │ 4 │ ┏ X1 Y1 Z1 5 │ ┃ X2 Y2 Z2 6 │ ┃ X3 Y3 Z3 │ ┗━━━━━━━━━━┛ ├ note: bar ╰ note: baz note: qux ╭▸ test.rs:4:3 │ 4 │ X1 Y1 Z1 ╰╴ ━━━━━━━━ ``` Before: ``` error: foo --> test.rs:3:3 | 3 | X0 Y0 Z0 | ___^__-__- | |___|__| | ||___| | ||| 4 | ||| X1 Y1 Z1 5 | ||| X2 Y2 Z2 | |||____^__-__- `Z` label | ||_____|__| | |______| `Y` is a good letter too | `X` is a good letter | note: bar --> test.rs:4:3 | 4 | / X1 Y1 Z1 5 | | X2 Y2 Z2 6 | | X3 Y3 Z3 | |__________^ = note: bar = note: baz note: qux --> test.rs:4:3 | 4 | X1 Y1 Z1 | ^^^^^^^^ ``` After: ![rustc output with unicode box drawing characters](https://github.com/rust-lang/rust/assets/1606434/d210b79a-6579-4407-9706-ba8edc6e9f25) Before: ![current rustc output with ASCII art](https://github.com/rust-lang/rust/assets/1606434/5aecccf8-a6ee-4469-8b39-72fb0d979a9f)
2024-11-10Address review commentsLeón Orell Valerian Liehr-42/+45
2024-11-10Add Unicode block-drawing compiler output supportEsteban Küber-210/+2254
Add nightly-only theming support to rustc output using Unicode box drawing characters instead of ASCII-art to draw the terminal UI: After: ``` error: foo ╭▸ test.rs:3:3 │ 3 │ X0 Y0 Z0 │ ┌───╿──│──┘ │ ┌│───│──┘ │ ┏││━━━┙ │ ┃││ 4 │ ┃││ X1 Y1 Z1 5 │ ┃││ X2 Y2 Z2 │ ┃│└────╿──│──┘ `Z` label │ ┃└─────│──┤ │ ┗━━━━━━┥ `Y` is a good letter too │ `X` is a good letter ╰╴ note: bar ╭▸ test.rs:4:3 │ 4 │ ┏ X1 Y1 Z1 5 │ ┃ X2 Y2 Z2 6 │ ┃ X3 Y3 Z3 │ ┗━━━━━━━━━━┛ ├ note: bar ╰ note: baz note: qux ╭▸ test.rs:4:3 │ 4 │ X1 Y1 Z1 ╰╴ ━━━━━━━━ ``` Before: ``` error: foo --> test.rs:3:3 | 3 | X0 Y0 Z0 | ___^__-__- | |___|__| | ||___| | ||| 4 | ||| X1 Y1 Z1 5 | ||| X2 Y2 Z2 | |||____^__-__- `Z` label | ||_____|__| | |______| `Y` is a good letter too | `X` is a good letter | note: bar --> test.rs:4:3 | 4 | / X1 Y1 Z1 5 | | X2 Y2 Z2 6 | | X3 Y3 Z3 | |__________^ = note: bar = note: baz note: qux --> test.rs:4:3 | 4 | X1 Y1 Z1 | ^^^^^^^^ ```
2024-11-10triagebot: Assign rustdoc tests to T-rustdoc.Alona Enraght-Moony-0/+6
2024-11-10Auto merge of #132877 - matthiaskrgr:rollup-hbxg7p0, r=matthiaskrgrbors-49/+314
Rollup of 3 pull requests Successful merges: - #131781 (Stabilize Arm64EC inline assembly) - #132426 (Prefer `pub(super)` in `unreachable_pub` lint suggestion) - #132866 (Break from review rotation) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-10Rollup merge of #132866 - jieyouxu:review-rotation-break, r=jieyouxuMatthias Krüger-0/+1
Break from review rotation Spending ~a week to focus on: - Digesting remaining `Makefile`s (so close yet so far). - 2024 Q3 T-compiler P-high issues review pre-triage. - Some docs for rustc-dev-guide. r? `@ghost`
2024-11-10Rollup merge of #132426 - Urgau:unreach_pub-super, r=petrochenkovMatthias Krüger-16/+307
Prefer `pub(super)` in `unreachable_pub` lint suggestion This PR updates the `unreachable_pub` lint suggestion to prefer `pub(super)` instead of `pub(crate)` when possible. cc `@petrochenkov` r? `@nnethercote`
2024-11-10Rollup merge of #131781 - taiki-e:arm64ec-stabilize-asm, r=Amanieu,traviscrossMatthias Krüger-33/+6
Stabilize Arm64EC inline assembly This stabilizes inline assembly for Arm64EC ("Emulation Compatible"). Corresponding reference PR: https://github.com/rust-lang/reference/pull/1653 --- From the requirements of stabilization mentioned in https://github.com/rust-lang/rust/issues/93335 > Each architecture needs to be reviewed before stabilization: > - It must have clobber_abi. Done in https://github.com/rust-lang/rust/pull/131332. > - It must be possible to clobber every register that is normally clobbered by a function call. This is possible from the time of the initial implementation. > - Generally review that the exposed register classes make sense. The registers available in this target are a subset of those available in the AArch64 inline assembly which is already stable. The following registers cannot be used in Arm64EC compared to AArch64: - `x13`, `x14`, `x23`, `x24`, `x28` (register class: `reg`) - `v[16-31]` (register class: `vreg`) - `p[0-15]`, `ffr` (clobber-only register class `preg`) These are disallowed by the ABI (see also [abi docs](https://learn.microsoft.com/en-us/cpp/build/arm64ec-windows-abi-conventions?view=msvc-170#register-mapping) for `reg`/`vreg` and https://github.com/rust-lang/rust/pull/131332#issuecomment-2401189142 for `preg`). Although not listed in the above requirements, preserves_flags is also implemented and the same as AArch64. --- cc `@dpaoliello` r? `@Amanieu` `@rustbot` label O-windows O-AArch64 +A-inline-assembly +T-lang -T-compiler +needs-fcp
2024-11-10add test coverage for separate clippy prefixesonur-ozkan-0/+17
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-11-10handle separate prefixes in clippy argsonur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-11-10add regression test for #85763binarycat-0/+11
2024-11-11Break from review rotationJieyou Xu-0/+1
2024-11-10Auto merge of #132863 - matthiaskrgr:rollup-1zbjz5f, r=matthiaskrgrbors-689/+1286
Rollup of 3 pull requests Successful merges: - #132675 (coverage: Restrict empty-span expansion to only cover `{` and `}`) - #132849 (Miri subtree update) - #132858 (Update minifer version to `0.3.2`) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-10Rollup merge of #132858 - GuillaumeGomez:update-minifier, r=aDotInTheVoidMatthias Krüger-6/+3
Update minifer version to `0.3.2` This version fixes a few lints but the main change is that it makes `clap` dependency optional since it's only used for the binary. r? `@notriddle`
2024-11-10Rollup merge of #132849 - RalfJung:miri-sync, r=RalfJungMatthias Krüger-378/+963
Miri subtree update r? `@ghost`
2024-11-10Rollup merge of #132675 - Zalathar:empty-spans, r=jieyouxuMatthias Krüger-305/+320
coverage: Restrict empty-span expansion to only cover `{` and `}` Coverage instrumentation has some tricky code for converting a coverage-relevant `Span` into a set of start/end line/byte-column coordinates that will be embedded in the CGU's coverage metadata. A big part of this complexity is special code for handling empty spans, which are expanded into non-empty spans (if possible) because LLVM's coverage reporter does not handle empty spans well. This PR simplifies that code by restricting it to only apply in two specific situations: when the character after the empty span is `{`, or the character before the empty span is `}`. (As an added benefit, this means that the expanded spans no longer extend awkwardly beyond the end of a physical line, which was common under the previous implementation.) Along the way, this PR also removes some unhelpful code for dealing with function source code spread across multiple files. Functions currently can't have coverage spans in multiple files, and if that ever changes (e.g. to properly support expansion regions) then this code will need to be completely overhauled anyway.
2024-11-10Stabilize WebAssembly `multivalue`, `reference-types`, and `tail-call` ↵Alex Crichton-4/+54
target features For the `multivalue` and `reference-types` features this commit is similar to #117457 in that it's stabilizing target features specific to WebAssembly targets. The previous PR left out these two features because they weren't expected to change much about compiled code so it was unclear what the rationale was. It has [since been discovered][blog] that `reference-types` can be useful as it changes the binary format of the `call_indirect` instruction. Additionally [on Zulip][zulip] there's a use case of detecting these features at compile time and generating a compile error to better warn users about features not supported on engines. This PR then additionally adds the `tail-call` feature which corresponds to the [tail-call] proposal to WebAssembly. This feature advanced to "phase 4" in the WebAssembly CG awhile back and has been supported in LLVM for quite some time now. Engines are finishing up implementations or have already shipped implementations, so while this is a bit of a late addition to Rust itself it reflects the current status of WebAssembly's state of the feature. A test has been added here not only for these features but other WebAssembly features as well to showcase that they're usable without feature gates in stable Rust. [blog]: https://blog.rust-lang.org/2024/09/24/webassembly-targets-change-in-default-target-features.html [zulip]: https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/wasm32.20reference-types.20.2F.20multivalue.20in.201.2E82-beta.20not.20enabled/near/473893987 [tail-call]: https://github.com/webassembly/tail-call
2024-11-10Update minifer version to `0.3.2`Guillaume Gomez-6/+3
2024-11-10Auto merge of #132852 - RalfJung:rustc-if-unchanged, r=onur-ozkanbors-4/+3
do not trust download-rustc=if-unchanged on CI for now See https://github.com/rust-lang/rust/issues/131658. Once https://github.com/rust-lang/rust/pull/131831 lands this will be unnecessary, for until then, better safe than sorry. r? `@onur-ozkan` Cc `@rust-lang/bootstrap`
2024-11-10Re-enable `version-verbose-commit-hash` run-make testJieyou Xu-3/+0
2024-11-10do not trust download-rustc=if-unchanged on CI for nowRalf Jung-1/+3
2024-11-10query/plumbing: adjust comment to realityRalf Jung-1/+1
2024-11-10Auto merge of #132846 - jieyouxu:revert-132772, r=jieyouxubors-35/+35
Revert #132772 to fix unknown git commit hash Reverts #132772 to address #132845, we seem to have unintentionally omitted commit hash. r? `@onur-ozkan`
2024-11-10Temporarily disable `version-verbose-commit-hash` to force revert throughJieyou Xu-0/+3
2024-11-10Revert "Rollup merge of #132772 - onur-ozkan:download-rustc-default, r=jieyouxu"Jieyou Xu-35/+32
This reverts commit c435fa8c4b55f0f8ef8e2e839ce7de960613267e, reversing changes made to 88acd493f9dbbc8228db2b123c9b4132a995de92. Seems to have unintentionally omitted commit hash leading to <https://github.com/rust-lang/rust/pull/132772>.
2024-11-10Merge pull request #4022 from RalfJung/linux-futexRalf Jung-3/+2
fix linux-futex test being accidentally disabled
2024-11-10fix linux-futex test being accidentally disabledRalf Jung-3/+2
2024-11-10Merge pull request #3971 from RalfJung/futex-virtualRalf Jung-55/+122
store futexes in per-allocation data rather than globally
2024-11-10store futexes in per-allocation data rather than globallyRalf Jung-55/+122
2024-11-10Auto merge of #132840 - matthiaskrgr:rollup-ibarl2r, r=matthiaskrgrbors-105/+323
Rollup of 2 pull requests Successful merges: - #132136 (ABI compatibility: remove section on target features) - #132816 (Dont suggest `use<impl Trait>` when we have an edition-2024-related borrowck issue) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-10Merge pull request #4021 from RalfJung/rustupRalf Jung-2604/+5528
Rustup
2024-11-10Rollup merge of #132816 - compiler-errors:2024-apit, r=jieyouxuMatthias Krüger-79/+317
Dont suggest `use<impl Trait>` when we have an edition-2024-related borrowck issue #131186 implements some machinery to detect in borrowck when we may have RPIT overcaptures due to edition 2024, and suggests adding `+ use<'a, T>` to go back to the edition 2021 capture rules. However, we weren't filtering out cases when there are APITs in scope. This PR implements a more sophisticated diagnostic where we will suggest turning any APITs in scope into type parameters, and applies this to both the borrowck error note, and to the `impl_trait_overcaptures` migration lint. cc #132809