about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-09-09update `rust.verbose-tests` doc in `config.example.toml`onur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-09use verbose flag as a default value for `rust.verbose-tests`onur-ozkan-0/+12
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-09Auto merge of #129788 - onur-ozkan:incompatibility-check-for-llvm, r=Kobzolbors-34/+147
detect incompatible CI LLVM options more precisely Previously, the logic here was simply checking whether the option was set in `config.toml`. This approach was not manageable in our CI runners as we set so many options in config.toml. In reality, those values are not incompatible since they are usually the same value used to generate the CI llvm. Now, the new logic compares the configuration values with the values used to generate the CI llvm, so we get more precise results and make the process more manageable. Fixes #129153
2024-09-08Auto merge of #130036 - weiznich:diagnostic_unstable_tracking, r=compiler-errorsbors-9/+51
Correctly handle stability of `#[diagnostic]` attributes This commit changes the way we treat the stability of attributes in the `#[diagnostic]` namespace. Instead of relaying on ad-hoc checks to ensure at call side that a certain attribute is really usable at that location it centralises the logic to one place. For diagnostic attributes comming from other crates it just skips serializing attributes that are not stable and that do not have the corresponding feature enabled. For attributes from the current crate we can just use the feature information provided by `TyCtx`. r​? `@compiler-errors`
2024-09-08handle dry-run mode in `Config::get_builder_toml`onur-ozkan-0/+4
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-08use `Config::get_builder_toml` for ci-rustc config parsingonur-ozkan-5/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-08fix llvm ThinLTO behaviouronur-ozkan-2/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-08print incompatible options even if we don't downloadonur-ozkan-21/+20
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-08remove `check_ci_llvm` usageonur-ozkan-24/+0
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-08detect incompatible CI LLVM options more preciselyonur-ozkan-3/+140
Previously, the logic here was simply checking whether the option was set in `config.toml`. This approach was not manageable in our CI runners as we set so many options in config.toml. In reality, those values are not incompatible since they are usually the same value used to generate the CI llvm. Now, the new logic compares the configuration values with the values used to generate the CI llvm, so we get more precise results and make the process more manageable. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-08Auto merge of #130002 - orlp:better-div-floor-ceil, r=thomccbors-4/+16
better implementation of signed div_floor/ceil Tracking issue for signed `div_floor`/`div_ceil`: https://github.com/rust-lang/rust/issues/88581. This PR improves the implementation of those two functions by adding a better branchless algorithm. Side-by-side comparison of `i32::div_floor` on x86-64: ```asm div_floor_new: div_floor_old: push rax push rax test esi, esi test esi, esi je .LBB0_3 je .LBB1_6 mov eax, esi mov eax, esi not eax not eax lea ecx, [rdi - 2147483648] lea ecx, [rdi - 2147483648] or ecx, eax or ecx, eax je .LBB0_2 je .LBB1_7 mov eax, edi mov eax, edi cdq cdq idiv esi idiv esi xor esi, edi test edx, edx sar esi, 31 setg cl test edx, edx test esi, esi cmove esi, edx sets dil add eax, esi test dil, cl pop rcx jne .LBB1_4 ret test edx, edx .LBB0_3: setns cl lea rdi, [rip + .L__unnamed_1] test esi, esi call qword ptr [rip + panic...] setle dl .LBB0_2: or dl, cl lea rdi, [rip + .L__unnamed_1] jne .LBB1_5 call qword ptr [rip + panic...] .LBB1_4: dec eax .LBB1_5: pop rcx ret .LBB1_6: lea rdi, [rip + .L__unnamed_2] call qword ptr [rip + panic...] .LBB1_7: lea rdi, [rip + .L__unnamed_2] call qword ptr [rip + panic...] ``` And on Aarch64: ```asm _div_floor_new: _div_floor_old: stp x29, x30, [sp, #-16]! stp x29, x30, [sp, #-16]! mov x29, sp mov x29, sp cbz w1, LBB0_4 cbz w1, LBB1_9 mov w8, #-2147483648 mov x8, x0 cmp w0, w8 mov w9, #-2147483648 b.ne LBB0_3 cmp w0, w9 cmn w1, #1 b.ne LBB1_3 b.eq LBB0_5 cmn w1, #1 LBB0_3: b.eq LBB1_10 sdiv w8, w0, w1 LBB1_3: msub w9, w8, w1, w0 sdiv w0, w8, w1 eor w10, w1, w0 msub w8, w0, w1, w8 asr w10, w10, #31 tbz w1, #31, LBB1_5 cmp w9, #0 cmp w8, #0 csel w9, wzr, w10, eq b.gt LBB1_7 add w0, w9, w8 LBB1_5: ldp x29, x30, [sp], #16 cmp w1, #1 ret b.lt LBB1_8 LBB0_4: tbz w8, #31, LBB1_8 adrp x0, l___unnamed_1@PAGE LBB1_7: add x0, x0, l___unnamed_1@PAGEOFF sub w0, w0, #1 bl panic... LBB1_8: LBB0_5: ldp x29, x30, [sp], #16 adrp x0, l___unnamed_1@PAGE ret add x0, x0, l___unnamed_1@PAGEOFF LBB1_9: bl panic... adrp x0, l___unnamed_2@PAGE add x0, x0, l___unnamed_2@PAGEOFF bl panic... LBB1_10: adrp x0, l___unnamed_2@PAGE add x0, x0, l___unnamed_2@PAGEOFF bl panic... ```
2024-09-08Auto merge of #129019 - kromych:master, r=workingjubileebors-1/+247
Break into the debugger (if attached) on panics (Windows, Linux, macOS, FreeBSD) The developer experience for panics is to provide the backtrace and exit the program. When running under debugger, that might be improved by breaking into the debugger once the code panics thus enabling the developer to examine the program state at the exact time when the code panicked. Let the developer catch the panic in the debugger if it is attached. If the debugger is not attached, nothing changes. Providing this feature inside the standard library facilitates better debugging experience. Validated under Windows, Linux, macOS 14.6, and FreeBSD 13.3..14.1.
2024-09-08Auto merge of #130072 - ChrisDenton:split-ci, r=Kobzolbors-5/+22
Split x86_64-msvc-ext into two jobs This is an attempt to mitigate (but not resolve) the high failure rate of the x86_64-msvc-ext builder. The theory being that doing less makes it less likely to fail. But this may not work as having an extra job that may fail might be worse. try-job: x86_64-msvc-ext try-job: x86_64-msvc-ext2
2024-09-08Auto merge of #129346 - nnethercote:fix-double-handling-in-collect_tokens, ↵bors-174/+196
r=petrochenkov Fix double handling in `collect_tokens` Double handling of AST nodes can occur in `collect_tokens`. This is when an inner call to `collect_tokens` produces an AST node, and then an outer call to `collect_tokens` produces the same AST node. This can happen in a few places, e.g. expression statements where the statement delegates `HasTokens` and `HasAttrs` to the expression. It will also happen more after #124141. This PR fixes some double handling cases that cause problems, including #129166. r? `@petrochenkov`
2024-09-08Auto merge of #129313 - RalfJung:coroutine-niches, r=compiler-errorsbors-27/+102
Supress niches in coroutines to avoid aliasing violations As mentioned [here](https://github.com/rust-lang/rust/issues/63818#issuecomment-2264915918), using niches in fields of coroutines that are referenced by other fields is unsound: the discriminant accesses violate the aliasing requirements of the reference pointing to the relevant field. This issue causes [Miri errors in practice](https://github.com/rust-lang/miri/issues/3780). The "obvious" fix for this is to suppress niches in coroutines. That's what this PR does. However, we have several tests explicitly ensuring that we *do* use niches in coroutines. So I see two options: - We guard this behavior behind a `-Z` flag (that Miri will set by default). There is no known case of these aliasing violations causing miscompilations. But absence of evidence is not evidence of absence... - (What this PR does right now.) We temporarily adjust the coroutine layout logic and the associated tests until the proper fix lands. The "proper fix" here is to wrap fields that other fields can point to in [`UnsafePinned`](https://github.com/rust-lang/rust/issues/125735) and make `UnsafePinned` suppress niches; that would then still permit using niches of *other* fields (those that never get borrowed). However, I know that coroutine sizes are already a problem, so I am not sure if this temporary size regression is acceptable. `@compiler-errors` any opinion? Also who else should be Cc'd here?
2024-09-07Auto merge of #130091 - matthiaskrgr:rollup-kalu1cs, r=matthiaskrgrbors-350/+886
Rollup of 10 pull requests Successful merges: - #126452 (Implement raw lifetimes and labels (`'r#ident`)) - #129555 (stabilize const_float_bits_conv) - #129594 (explain the options bootstrap passes to curl) - #129677 (Don't build by-move body when async closure is tainted) - #129847 (Do not call query to compute coroutine layout for synthetic body of async closure) - #129869 (add a few more crashtests) - #130009 (rustdoc-search: allow trailing `Foo ->` arg search) - #130046 (str: make as_mut_ptr and as_bytes_mut unstably const) - #130047 (Win: Add dbghelp to the list of import libraries) - #130059 (Remove the unused `llvm-skip-rebuild` option from x.py) r? `@ghost` `@rustbot` modify labels: rollup
2024-09-07Rollup merge of #130059 - gurry:130039-remove-skip-rebuild, r=KobzolMatthias Krüger-148/+19
Remove the unused `llvm-skip-rebuild` option from x.py Fixes #130039
2024-09-07Rollup merge of #130047 - ChrisDenton:win-dbghelp, r=wesleywiserMatthias Krüger-0/+1
Win: Add dbghelp to the list of import libraries This is used by the backtrace crate. But we use a submodule to include backtrace in std (rather than being a real crate) so we need to add the dependency here.
2024-09-07Rollup merge of #130046 - RalfJung:const_str_as_mut, r=dtolnayMatthias Krüger-2/+4
str: make as_mut_ptr and as_bytes_mut unstably const `@rust-lang/libs-api` the corresponding non-mutable methods are already const fn, so this seems pretty trivial. I hope this is small enough that it does not need an ACP? :) I would like to get these stabilized ASAP because I want to avoid people doing `s.as_ptr().cast_mut()`, which is UB if they ever write to it, but is already const-stable. TODO: create a tracking issue.
2024-09-07Rollup merge of #130009 - notriddle:notriddle/trailing-arrow, ↵Matthias Krüger-14/+81
r=lolbinarycat,GuillaumeGomez rustdoc-search: allow trailing `Foo ->` arg search Fixes #129710
2024-09-07Rollup merge of #129869 - cyrgani:master, r=Mark-SimulacrumMatthias Krüger-0/+80
add a few more crashtests Added them for #123629, #127033 and #129372.
2024-09-07Rollup merge of #129847 - compiler-errors:async-cycle, r=davidtwcoMatthias Krüger-1/+31
Do not call query to compute coroutine layout for synthetic body of async closure There is code in the MIR validator that attempts to prevent query cycles when inlining a coroutine into itself, and will use the coroutine layout directly from the body when it detects that's the same coroutine as the one that's being validated. After #128506, this logic didn't take into account the fact that the coroutine def id will differ if it's the "by-move body" of an async closure. This PR implements that. Fixes #129811
2024-09-07Rollup merge of #129677 - compiler-errors:by-move-body-err, r=cjgillotMatthias Krüger-2/+36
Don't build by-move body when async closure is tainted Fixes #129676 See explanation in the ui test.
2024-09-07Rollup merge of #129594 - lolbinarycat:explain-curl-options, r=albertlarsan68Matthias Krüger-14/+38
explain the options bootstrap passes to curl also fixes a discrepancy where the rust side doesn't use -L docs are only on the rust side, since duplicated prose has a tendancy to get out-of-sync, and also because there are talks of removing the python script all together eventually.
2024-09-07Rollup merge of #129555 - RalfJung:const_float_bits_conv, r=dtolnayMatthias Krüger-84/+223
stabilize const_float_bits_conv This stabilizes `const_float_bits_conv`, and thus fixes https://github.com/rust-lang/rust/issues/72447. With https://github.com/rust-lang/rust/pull/128596 having landed, this is entirely a libs-only question now. ```rust impl f32 { pub const fn to_bits(self) -> u32; pub const fn from_bits(v: u32) -> Self; pub const fn to_be_bytes(self) -> [u8; 4]; pub const fn to_le_bytes(self) -> [u8; 4] pub const fn to_ne_bytes(self) -> [u8; 4]; pub const fn from_be_bytes(bytes: [u8; 4]) -> Self; pub const fn from_le_bytes(bytes: [u8; 4]) -> Self; pub const fn from_ne_bytes(bytes: [u8; 4]) -> Self; } impl f64 { pub const fn to_bits(self) -> u64; pub const fn from_bits(v: u64) -> Self; pub const fn to_be_bytes(self) -> [u8; 8]; pub const fn to_le_bytes(self) -> [u8; 8] pub const fn to_ne_bytes(self) -> [u8; 8]; pub const fn from_be_bytes(bytes: [u8; 8]) -> Self; pub const fn from_le_bytes(bytes: [u8; 8]) -> Self; pub const fn from_ne_bytes(bytes: [u8; 8]) -> Self; } ```` Cc `@rust-lang/wg-const-eval` `@rust-lang/libs-api`
2024-09-07Rollup merge of #126452 - compiler-errors:raw-lifetimes, r=spastorinoMatthias Krüger-85/+373
Implement raw lifetimes and labels (`'r#ident`) This PR does two things: 1. Reserve lifetime prefixes, e.g. `'prefix#lt` in edition 2021. 2. Implements raw lifetimes, e.g. `'r#async` in edition 2021. This PR additionally extends the `keyword_idents_2024` lint to also check lifetimes. cc `@traviscross` r? parser
2024-09-07Auto merge of #129941 - BoxyUwU:bump-boostrap, r=albertlarsan68bors-616/+543
Bump boostrap compiler to new beta Accidentally left some comments on the update cfgs commit directly xd
2024-09-07str: make as_mut_ptr and as_bytes_mut unstably constRalf Jung-2/+4
2024-09-07Auto merge of #126161 - Bryanskiy:delegation-generics-4, r=petrochenkovbors-445/+777
Delegation: support generics in associated delegation items This is a continuation of https://github.com/rust-lang/rust/pull/125929. [design](https://github.com/Bryanskiy/posts/blob/master/delegation%20in%20generic%20contexts.md) Generic parameters inheritance was implemented in all contexts. Generic arguments are not yet supported. r? `@petrochenkov`
2024-09-07Fix bash syntaxChris Denton-1/+1
2024-09-07Auto merge of #130066 - compiler-errors:rollup-sq6l0va, r=compiler-errorsbors-237/+945
Rollup of 9 pull requests Successful merges: - #128871 (bypass linker configuration and cross target check for specific commands) - #129468 ([testsuite][cleanup] Remove all usages of `dont_merge` hack to avoid function merging) - #129614 (Adjust doc comment of Condvar::wait_while) - #129840 (Implement suggestions for `elided_named_lifetimes`) - #129891 (Do not request sanitizers for naked functions) - #129899 (Add Suggestions for Misspelled Keywords) - #129940 (s390x: Fix a regression related to backchain feature) - #129987 (Don't store region in `CapturedPlace`) - #130054 (Add missing quotation marks) r? `@ghost` `@rustbot` modify labels: rollup
2024-09-07Fix checktools.sh non-msvc buildsChris Denton-6/+7
2024-09-07Split x86_64-msvc-ext into two jobsChris Denton-5/+21
2024-09-07Auto merge of #128871 - onur-ozkan:128180, r=Kobzolbors-10/+32
bypass linker configuration and cross target check for specific commands Avoids configuring the linker and checking cross-target-specific tools unless necessary. Resolves #128180 cc `@ChrisDenton`
2024-09-07Don't build by-move body when async closure is taintedMichael Goulet-2/+36
2024-09-07Rollup merge of #130054 - cuishuang:master, r=chenyukangMichael Goulet-1/+1
Add missing quotation marks
2024-09-07Rollup merge of #129987 - compiler-errors:capture-place-region, r=davidtwcoMichael Goulet-43/+19
Don't store region in `CapturedPlace` It's not necessary anymore, since we erase all regions in writeback anyways.
2024-09-07Rollup merge of #129940 - liushuyu:s390x-target-features, r=RalfJungMichael Goulet-3/+47
s390x: Fix a regression related to backchain feature In #127506, we introduced a new IBM Z-specific target feature, `backchain`. This particular `target-feature` was available as a function-level attribute in LLVM 17 and below, so some hacks were used to avoid blowing up LLVM when querying the supported LLVM features. This led to an unfortunate regression where `cfg!(target-feature = "backchain")` will always return true. This pull request aims to fix this issue, and a test has been introduced to ensure it will never happen again. Fixes #129927. r? `@RalfJung`
2024-09-07Rollup merge of #129899 - veera-sivarajan:fix-97793-pr-final, r=chenyukangMichael Goulet-12/+702
Add Suggestions for Misspelled Keywords Fixes #97793 This PR detects misspelled keywords using two heuristics: 1. Lowercasing the unexpected identifier. 2. Using edit distance to find a keyword similar to the unexpected identifier. However, it does not detect each and every misspelled keyword to minimize false positives and ambiguities. More details about the implementation can be found in the comments.
2024-09-07Rollup merge of #129891 - nikic:naked-no-san, r=jackh726Michael Goulet-21/+47
Do not request sanitizers for naked functions Naked functions can only contain inline asm, so any instrumentation inserted by sanitizers is illegal. Don't request it. Fixes https://github.com/rust-lang/rust/issues/129224.
2024-09-07Rollup merge of #129840 - GrigorenkoPV:elided-named-lifetimes-suggestion, ↵Michael Goulet-29/+111
r=cjgillot Implement suggestions for `elided_named_lifetimes` A follow-up to #129207, as per https://github.com/rust-lang/rust/pull/129207#issuecomment-2308992849. r? cjgillot I will probably squash this a bit, but later. `@rustbot` label +A-lint
2024-09-07Rollup merge of #129614 - rawler:patch-1, r=tgross35Michael Goulet-2/+6
Adjust doc comment of Condvar::wait_while The existing phrasing implies that a notification must be received for `wait_while` to return. The phrasing is changed to make no such implication.
2024-09-07Rollup merge of #129468 - Rajveer100:hack-to-avoid-function-merging, ↵Michael Goulet-126/+12
r=Mark-Simulacrum [testsuite][cleanup] Remove all usages of `dont_merge` hack to avoid function merging Resolves #129438 The `-Zmerge-functions=disabled` compile flag exists for this purpose.
2024-09-07Rollup merge of #128871 - onur-ozkan:128180, r=KobzolMichael Goulet-10/+32
bypass linker configuration and cross target check for specific commands Avoids configuring the linker and checking cross-target-specific tools unless necessary. Resolves #128180 cc `@ChrisDenton`
2024-09-07Remove unused option from x.pyGurinder Singh-148/+19
2024-09-06Add Suggestions for Misspelled KeywordsVeera-17/+298
This PR detects misspelled keywords using two heuristics: 1. Lowercasing the unexpected identifier. 2. Using edit distance to find a keyword similar to the unexpected identifier. However, it does not detect each and every misspelled keyword to minimize false positives and ambiguities. More details about the implementation can be found in the comments.
2024-09-07Auto merge of #129341 - madsmtm:refactor-deployment-target, r=petrochenkovbors-374/+381
Apple: Refactor deployment target version parsing Refactor deployment target parsing to make it easier to do https://github.com/rust-lang/rust/pull/129342 (I wanted to make sure of all the places that `std::env::var` is called). Specifically, my goal was to minimize the amount of target-specific configuration, so to that end I renamed the `opts` function that generates the `TargetOptions` to `base`, and made it return the LLVM target and `target_arch` too. In the future, I would like to move even more out of the target files and into `spec::apple`, as it makes it easier for me to maintain. For example, this fixed a bug in `aarch64-apple-watchos`, which wasn't passing the deployment target as part of the LLVM triple. This (probably) fixes https://github.com/rust-lang/rust/issues/123582 and fixes https://github.com/rust-lang/rust/issues/107630. We also now parse the patch version of deployment targets, allowing the user to specify e.g. `MACOSX_DEPLOYMENT_TARGET=10.12.6`. Finally, this fixes the LLVM target name for visionOS, it should be `*-apple-xros` and not `*-apple-visionos`. Since I have changed all the Apple targets here, I smoke-tested my changes by running the following: ```console # Build each target ./x build library --target="aarch64-apple-darwin,aarch64-apple-ios,aarch64-apple-ios-macabi,aarch64-apple-ios-sim,aarch64-apple-tvos,aarch64-apple-tvos-sim,aarch64-apple-visionos,aarch64-apple-visionos-sim,aarch64-apple-watchos,aarch64-apple-watchos-sim,arm64_32-apple-watchos,arm64e-apple-ios,armv7k-apple-watchos,armv7s-apple-ios,i386-apple-ios,x86_64-apple-darwin,x86_64-apple-ios,x86_64-apple-ios-macabi,x86_64-apple-tvos,x86_64-apple-watchos-sim,x86_64h-apple-darwin" # Test that we can still at least link basic projects cargo new foobar && cd foobar && cargo +stage1 build --target=aarch64-apple-darwin --target=aarch64-apple-ios --target=aarch64-apple-ios-macabi --target=aarch64-apple-ios-sim --target=aarch64-apple-tvos --target=aarch64-apple-tvos-sim --target=aarch64-apple-visionos --target=aarch64-apple-visionos-sim --target=aarch64-apple-watchos --target=aarch64-apple-watchos-sim --target=arm64_32-apple-watchos --target=armv7s-apple-ios --target=i386-apple-ios --target=x86_64-apple-darwin --target=x86_64-apple-ios --target=x86_64-apple-ios-macabi --target=x86_64-apple-tvos --target=x86_64-apple-watchos-sim --target=x86_64h-apple-darwin ``` I couldn't build for the `arm64e-apple-darwin` target, the `armv7k-apple-watchos` and `arm64e-apple-ios` targets failed to link, and I know that the `i686-apple-darwin` target requires a bit of setup, but all of this is as it was before this PR. r? thomcc CC `@BlackHoleFox` I would recommend using `rollup=never` when merging this, in case we need to bisect this later.
2024-09-07Add missing quotation markscuishuang-1/+1
Signed-off-by: cuishuang <imcusg@gmail.com>
2024-09-06Win: Add dbghelp to the list of import librariesChris Denton-0/+1
2024-09-06Auto merge of #128776 - Bryanskiy:deep-reject-ctxt, r=lcnrbors-152/+272
Use `DeepRejectCtxt` to quickly reject `ParamEnv` candidates The description is on the [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/144729-t-types/topic/.5Basking.20for.20help.5D.20.60DeepRejectCtxt.60.20for.20param.20env.20candidates) r? `@lcnr`