Commit graph

247945 commits

Author SHA1 Message Date
Chris Denton 2a09857729
Update debuginfo tests 2024-03-05 00:19:44 +00:00
Chris Denton f700641bd9
Windows: Implement mutex using futex
Well, the Windows equivalent: `WaitOnAddress`, `WakeByAddressSingle` and `WakeByAddressAll`.
2024-03-05 00:19:42 +00:00
bors 89b78304e8 Auto merge of #121955 - matthiaskrgr:rollup-1i3lo0j, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #121248 (Move some tests)
 - #121528 (Consider middle segments of paths in `unused_qualifications`)
 - #121749 (Don't lint on executable crates with `non_snake_case` names)
 - #121935 (library/ptr: mention that ptr::without_provenance is equivalent to deriving from the null ptr)
 - #121945 (Run some ui-fulldeps tests on stage 1 again)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-04 00:37:20 +00:00
bors 70aa0b86c0 Auto merge of #121665 - erikdesjardins:ptradd, r=nikic
Always generate GEP i8 / ptradd for struct offsets

This implements #98615, and goes a bit further to remove `struct_gep` entirely.

Upstream LLVM is in the beginning stages of [migrating to `ptradd`](https://discourse.llvm.org/t/rfc-replacing-getelementptr-with-ptradd/68699). LLVM 19 will [canonicalize](https://github.com/llvm/llvm-project/pull/68882) all constant-offset GEPs to i8, which has roughly the same effect as this change.

Fixes #121719.

Split out from #121577.

r? `@nikic`
2024-03-03 22:21:53 +00:00
Matthias Krüger e5a6d21729
Rollup merge of #121945 - Nilstrieb:ignore-stage1, r=compiler-errors
Run some ui-fulldeps tests on stage 1 again

This is the second time I'm doing this... I'm starting to feel like stage1 ui-fulldeps tests were a mistake. Maybe I should have just put `#[cfg(bootstrap)]` there to let the bootstrap bumper fix it.

`@George-lewis` :)

finishes https://github.com/rust-lang/rust/pull/119088#issuecomment-1890389583
2024-03-03 22:56:14 +01:00
Matthias Krüger dc8b71ae2b
Rollup merge of #121935 - RalfJung:ptr-without-prov, r=scottmcm
library/ptr: mention that ptr::without_provenance is equivalent to deriving from the null ptr

This might help clarify why you can't do memory accesses with it.
2024-03-03 22:56:14 +01:00
Matthias Krüger 10234fc246
Rollup merge of #121749 - jieyouxu:issue-45127-fix, r=petrochenkov
Don't lint on executable crates with `non_snake_case` names

Revives #111130, cc `@GilShoshan94.`
Closes #45127.
2024-03-03 22:56:13 +01:00
Matthias Krüger ed6d17523a
Rollup merge of #121528 - Alexendoo:unused_qualifications, r=petrochenkov
Consider middle segments of paths in `unused_qualifications`

Currently `unused_qualifications` looks at the last segment of a path to see if it can be trimmed, this PR extends the check to the middle segments also

```rust
// currently linted
use std::env::args();
std::env::args(); // Removes `std::env::`
```
```rust
// newly linted
use std::env;
std::env::args(); // Removes `std::`
```

Paths with generics in them are now linted as long as the part being trimmed is before any generic args, e.g. it will now suggest trimming `std::vec::` from `std::vec::Vec<usize>`

Paths with any segments that are from an expansion are no longer linted

Fixes #100979
Fixes #96698
2024-03-03 22:56:13 +01:00
Matthias Krüger d37ad03513
Rollup merge of #121248 - c410-f3r:testsssssss, r=petrochenkov
Move some tests

r? `@petrochenkov`
2024-03-03 22:56:12 +01:00
bors 516b6162a2 Auto merge of #121763 - clubby789:llvm-old-comment, r=cjgillot
Update outdated LLVM comment

The first path no longer exists, but the second does.
2024-03-03 19:59:03 +00:00
Caio 2aab000105 Move tests 2024-03-03 16:30:48 -03:00
Alex Macleod 4ea9f72c72 Consider middle segments of paths in unused_qualifications 2024-03-03 19:14:28 +00:00
Nilstrieb 93f595fb2b Run some ui-fulldeps tests on stage 1 again
This is the second time I'm doing this... I'm starting to feel like
stage1 ui-fulldeps tests were a mistake. Maybe I should have just put
`#[cfg(bootstrap)]` there to let the bootstrap bumper fix it.
2024-03-03 18:41:25 +01:00
bors 279c9ba260 Auto merge of #121936 - RalfJung:miri, r=RalfJung
Miri subtree update

r? `@ghost`
2024-03-03 16:34:15 +00:00
bors 26907374b9 Auto merge of #121937 - GuillaumeGomez:rollup-9684vg3, r=GuillaumeGomez
Rollup of 3 pull requests

Successful merges:

 - #121917 (Add new `pattern_complexity` attribute to add possibility to limit and check recursion in pattern matching)
 - #121933 (Add missing get_name for wasm::thread.)
 - #121934 (rustc_log: expose tracing-tree "wraparound" in an env var)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-03 14:01:47 +00:00
许杰友 Jieyou Xu (Joe) d0111cb57a
Only run lint tests on x86_64-unknown-linux-gnu
We're trying to test lint behavior, not per-target crate-type support.
2024-03-03 13:58:35 +00:00
Guillaume Gomez e634a0a51b
Rollup merge of #121934 - RalfJung:tree-wraparound, r=oli-obk
rustc_log: expose tracing-tree "wraparound" in an env var

This would be RUSTC_LOG_WRAPTREE, but I am open to other names.

r? `@oli-obk`
2024-03-03 14:07:44 +01:00
Guillaume Gomez d769aceab6
Rollup merge of #121933 - Iansa9:thread-name-wasm-fix, r=Nilstrieb
Add missing get_name for wasm::thread.

Fixing #121932 by implementing `get_name` in `wasm:🧵:Thread`.
2024-03-03 14:07:43 +01:00
Guillaume Gomez 7d8f74f8b2
Rollup merge of #121917 - GuillaumeGomez:pattern-complexity_limit.rs, r=Nadrieril
Add new `pattern_complexity` attribute to add possibility to limit and check recursion in pattern matching

Needed for https://github.com/rust-lang/rust-analyzer/issues/9528.

This PR adds a new attribute only available when running rust testsuite called `pattern_complexity` which allows to set the maximum recursion for the pattern matching. It is quite useful to ensure the complexity doesn't grow, like in `tests/ui/pattern/usefulness/issue-118437-exponential-time-on-diagonal-match.rs`.

r? `@Nadrieril`
2024-03-03 14:07:43 +01:00
许杰友 Jieyou Xu (Joe) 82ceec9d1d
Ignore cdylib test for i686-unknown-linux-musl 2024-03-03 13:05:15 +00:00
Guillaume Gomez f04c5c5112 Add feature gate test for pattern_complexity attribute 2024-03-03 13:10:15 +01:00
Guillaume Gomez f04b7ee130 Add and update tests to use pattern_complexity 2024-03-03 13:10:15 +01:00
Guillaume Gomez be31b6b6cd Add new pattern_complexity attribute to add possibility to limit and check recursion in pattern matching 2024-03-03 13:10:15 +01:00
Ralf Jung d579caf384 library/ptr: mention that ptr::without_provenance is equivalent to deriving from the null ptr 2024-03-03 12:34:38 +01:00
bors 9e73597e5a Auto merge of #121903 - Nilstrieb:rename-qnx-file, r=WaffleLapkin
Remove underscore from QNX target file name

For consistency with the other QNX targets and the actual target names.
2024-03-03 11:34:21 +00:00
Ralf Jung 90162ea7b1 rustc_log: expose tracing-tree "wraparound" in an env var 2024-03-03 12:33:26 +01:00
bors 639fab7f9a Auto merge of #3345 - RalfJung:win-get-thread-name, r=RalfJung
Windows: support getting the thread name

Also organize the thread name tests a bit.
2024-03-03 10:32:43 +00:00
bors cdf1071309 Auto merge of #3346 - RalfJung:alloc-accesses, r=RalfJung
Add -Zmiri-track-alloc-accesses to readme and fix its wording

I forgot that yesterday...
2024-03-03 09:45:04 +00:00
Ralf Jung c72b48778d Windows: support getting the thread name 2024-03-03 10:43:44 +01:00
Ralf Jung 931e45389a fix wording of alloc access tracking message 2024-03-03 10:27:24 +01:00
Ralf Jung 7f485fc923 readme 2024-03-03 10:12:19 +01:00
bors 10902058a9 Auto merge of #121931 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2024-03-03 09:07:22 +00:00
Ian Neumann eb5328b721 Add missing get_name for wasm::thread. 2024-03-03 00:25:51 -08:00
Ralf Jung 8deb651603 move thread-panic tests to their own file; test getting the thread name 2024-03-03 09:00:38 +01:00
Laurențiu Nicola 964e769ffd Merge commit '4ef6a49b44e8aa380da7522442234bfd7a52c55e' into sync-from-ra 2024-03-03 09:17:31 +02:00
bors a09d91b04a Auto merge of #121877 - estebank:fancy-svg, r=compiler-errors
On tests that specify `--color=always` emit SVG file with stderr output

Leverage `anstyle-svg`, as `cargo` does now, to emit `.svg` files instead of `.stderr` files for tests that explicitly enable color output. This will make reviewing changes to the graphical output of tests much more human friendly.

<img src="https://raw.githubusercontent.com/rust-lang/rust/b4bdb56f86e136ca63bf71dca3034200c6c25900/tests/ui/error-emitter/highlighting.svg">
2024-03-03 06:40:56 +00:00
bors 3793e5ba23 Auto merge of #121856 - ChrisDenton:abort, r=joboet
Cleanup windows `abort_internal`

As the comments on the functions say, we define abort in both in panic_abort and in libstd. This PR makes the two implementation (mostly) the same.

Additionally it:
* uses `options(noreturn)` on the asm instead of using `core::intrinsics::unreachable`.
* removed unnecessary allow lints
* added `FAST_FAIL_FATAL_APP_EXIT` to our generated Windows API bindings instead of defining it manually (std only)
2024-03-03 04:26:34 +00:00
bors da02fff3b6 Auto merge of #112865 - rust-lang:cargo_update, r=clubby789
Weekly `cargo update`

Automation to keep dependencies in `Cargo.lock` current.

The following is the output from `cargo update`:

```txt
    Updating ahash v0.8.8 -> v0.8.10
    Updating annotate-snippets v0.10.1 -> v0.10.2
    Updating anstream v0.6.11 -> v0.6.13
    Updating anyhow v1.0.79 -> v1.0.80
    Updating bumpalo v3.14.0 -> v3.15.3
    Updating clap v4.5.0 -> v4.5.1
    Updating clap_builder v4.5.0 -> v4.5.1
    Updating clap_complete v4.5.0 -> v4.5.1
    Updating crossbeam-channel v0.5.11 -> v0.5.12
    Updating darling v0.20.6 -> v0.20.8
    Updating darling_core v0.20.6 -> v0.20.8
    Updating darling_macro v0.20.6 -> v0.20.8
    Updating dlmalloc v0.2.5 -> v0.2.6
    Updating indexmap v2.2.3 -> v2.2.5
    Updating libloading v0.8.1 -> v0.8.2
    Updating log v0.4.20 -> v0.4.21
    Updating mio v0.8.10 -> v0.8.11
    Updating normpath v1.1.1 -> v1.2.0
    Updating openssl v0.10.63 -> v0.10.64
    Updating openssl-sys v0.9.99 -> v0.9.101
    Updating pest v2.7.7 -> v2.7.8
    Updating pest_derive v2.7.7 -> v2.7.8
    Updating pest_generator v2.7.7 -> v2.7.8
    Updating pest_meta v2.7.7 -> v2.7.8
    Updating pkg-config v0.3.29 -> v0.3.30
    Updating rayon v1.8.1 -> v1.9.0
 Downgrading regex v1.9.4 -> v1.8.4
    Updating regex-automata v0.3.7 -> v0.3.9
    Updating reqwest v0.11.23 -> v0.11.24
      Adding rustls-pemfile v1.0.4
    Updating ryu v1.0.16 -> v1.0.17
    Updating semver v1.0.21 -> v1.0.22
    Updating serde v1.0.196 -> v1.0.197
    Updating serde_derive v1.0.196 -> v1.0.197
    Updating serde_json v1.0.113 -> v1.0.114
    Updating socket2 v0.5.5 -> v0.5.6
    Updating syn v2.0.48 -> v2.0.52
      Adding sync_wrapper v0.1.2
    Updating sysinfo v0.30.5 -> v0.30.6
    Updating tempfile v3.10.0 -> v3.10.1
    Updating thread_local v1.1.7 -> v1.1.8
    Updating unicode-normalization v0.1.22 -> v0.1.23
    Updating unicode-script v0.5.5 -> v0.5.6
    Updating walkdir v2.4.0 -> v2.5.0
    Updating windows-targets v0.52.0 -> v0.52.4
    Updating windows_aarch64_gnullvm v0.52.0 -> v0.52.4
    Updating windows_aarch64_msvc v0.52.0 -> v0.52.4
    Updating windows_i686_gnu v0.52.0 -> v0.52.4
    Updating windows_i686_msvc v0.52.0 -> v0.52.4
    Updating windows_x86_64_gnu v0.52.0 -> v0.52.4
    Updating windows_x86_64_gnullvm v0.52.0 -> v0.52.4
    Updating windows_x86_64_msvc v0.52.0 -> v0.52.4
```
2024-03-03 01:28:07 +00:00
github-actions 8ef1981716 cargo update
Updating ahash v0.8.8 -> v0.8.10
    Updating annotate-snippets v0.10.1 -> v0.10.2
    Updating anstream v0.6.11 -> v0.6.13
    Updating anyhow v1.0.79 -> v1.0.80
    Updating bumpalo v3.14.0 -> v3.15.3
    Updating clap v4.5.0 -> v4.5.1
    Updating clap_builder v4.5.0 -> v4.5.1
    Updating clap_complete v4.5.0 -> v4.5.1
    Updating crossbeam-channel v0.5.11 -> v0.5.12
    Updating darling v0.20.6 -> v0.20.8
    Updating darling_core v0.20.6 -> v0.20.8
    Updating darling_macro v0.20.6 -> v0.20.8
    Updating dlmalloc v0.2.5 -> v0.2.6
    Updating indexmap v2.2.3 -> v2.2.5
    Updating libloading v0.8.1 -> v0.8.2
    Updating log v0.4.20 -> v0.4.21
    Updating mio v0.8.10 -> v0.8.11
    Updating normpath v1.1.1 -> v1.2.0
    Updating openssl v0.10.63 -> v0.10.64
    Updating openssl-sys v0.9.99 -> v0.9.101
    Updating pest v2.7.7 -> v2.7.8
    Updating pest_derive v2.7.7 -> v2.7.8
    Updating pest_generator v2.7.7 -> v2.7.8
    Updating pest_meta v2.7.7 -> v2.7.8
    Updating pkg-config v0.3.29 -> v0.3.30
    Updating rayon v1.8.1 -> v1.9.0
 Downgrading regex v1.9.4 -> v1.8.4
    Updating regex-automata v0.3.7 -> v0.3.9
    Updating reqwest v0.11.23 -> v0.11.24
      Adding rustls-pemfile v1.0.4
    Updating ryu v1.0.16 -> v1.0.17
    Updating semver v1.0.21 -> v1.0.22
    Updating serde v1.0.196 -> v1.0.197
    Updating serde_derive v1.0.196 -> v1.0.197
    Updating serde_json v1.0.113 -> v1.0.114
    Updating socket2 v0.5.5 -> v0.5.6
    Updating syn v2.0.48 -> v2.0.52
      Adding sync_wrapper v0.1.2
    Updating sysinfo v0.30.5 -> v0.30.6
    Updating tempfile v3.10.0 -> v3.10.1
    Updating thread_local v1.1.7 -> v1.1.8
    Updating unicode-normalization v0.1.22 -> v0.1.23
    Updating unicode-script v0.5.5 -> v0.5.6
    Updating walkdir v2.4.0 -> v2.5.0
    Updating windows-targets v0.52.0 -> v0.52.4
    Updating windows_aarch64_gnullvm v0.52.0 -> v0.52.4
    Updating windows_aarch64_msvc v0.52.0 -> v0.52.4
    Updating windows_i686_gnu v0.52.0 -> v0.52.4
    Updating windows_i686_msvc v0.52.0 -> v0.52.4
    Updating windows_x86_64_gnu v0.52.0 -> v0.52.4
    Updating windows_x86_64_gnullvm v0.52.0 -> v0.52.4
    Updating windows_x86_64_msvc v0.52.0 -> v0.52.4
2024-03-03 00:16:16 +00:00
bors 0decdac390 Auto merge of #121914 - Nadrieril:rollup-ol98ncg, r=Nadrieril
Rollup of 5 pull requests

Successful merges:

 - #120761 (Add initial support for DataFlowSanitizer)
 - #121622 (Preserve same vtable pointer when cloning raw waker, to fix Waker::will_wake)
 - #121716 (match lowering: Lower bindings in a predictable order)
 - #121731 (Now that inlining, mir validation and const eval all use reveal-all, we won't be constraining hidden types here anymore)
 - #121841 (`f16` and `f128` step 2: intrinsics)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-02 22:59:19 +00:00
Esteban Kuber b4bdb56f86 On tests that specify --color=always emit SVG file with stderr output
Leverage `anstyle-svg`, as `cargo` does now, to emit `.svg` files
instead of `.stderr` files for tests that explicitly enable color
output. This will make reviewing changes to the graphical output of
tests much more human friendly.
2024-03-02 22:47:17 +00:00
bors 5119208fd7 Auto merge of #121904 - matthiaskrgr:rollup-qcq0d3h, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #121666 (Use the OS thread name by default if `THREAD_INFO` has not been initialized)
 - #121758 (Move thread local implementation to `sys`)
 - #121759 (attempt to further clarify addr_of docs)
 - #121855 (Correctly generate item info of trait items)
 - #121888 (style library/core/src/error.rs)
 - #121892 (The ordinary lowering of `thir::ExprKind::Let` is unreachable)
 - #121895 (avoid collecting into vecs in some places)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-02 20:34:58 +00:00
bors 31957b6764 Auto merge of #3343 - RalfJung:tree-borrows-diag, r=RalfJung
Tree Borrows diagnostic improvements

print where the forbidden access happens; make tag tracking less verbose
2024-03-02 20:16:52 +00:00
Ralf Jung 21527d23d2 Tree Borrows: print where the forbidden access happens; make tag tracking less verbose 2024-03-02 21:14:58 +01:00
Guillaume Boisseau 4c65eef269
Rollup merge of #121841 - tgross35:f16-f128-step2-intrinsics, r=compiler-errors
`f16` and `f128` step 2: intrinsics

Continuation of https://github.com/rust-lang/rust/pull/121728, another portion of https://github.com/rust-lang/rust/pull/114607.

This PR adds `f16` and `f128` intrinsics, and hooks them up to both HIR and LLVM. This is all still unexposed to the frontend, which will probably be the next step. Also update itanium mangling per `@rcvalle's` in https://github.com/rust-lang/rust/pull/121728/files#r1506570300, and fix a typo from step 1.

Once these types are usable in code, I will add the codegen tests from #114607 (codegen is passing on that branch)

This does add more `unimplemented!`s to Clippy, but I still don't think we can do better until library support is added.

r? `@compiler-errors`
cc `@Nilstrieb`
`@rustbot` label +T-compiler +F-f16_and_f128
2024-03-02 20:13:24 +01:00
Guillaume Boisseau 200019c199
Rollup merge of #121731 - oli-obk:eager_opaque_checks, r=compiler-errors
Now that inlining, mir validation and const eval all use reveal-all, we won't be constraining hidden types here anymore

r? `@compiler-errors`

one bubble down, two more to go

the test is unrelated, just something I noticed would be good to test in both the old solver and the new.
2024-03-02 20:13:23 +01:00
Guillaume Boisseau 30976fbe2b
Rollup merge of #121716 - Nadrieril:simple-binding-order, r=matthewjasper
match lowering: Lower bindings in a predictable order

After the recent refactorings, we can now lower bindings in a truly predictable order. The order in https://github.com/rust-lang/rust/pull/120214 was an improvement but not very clear. With this PR, we lower bindings from left to right, with the special case that `x @ pat` is traversed as `pat @ x` (i.e. `x` is lowered after any bindings in `pat`).

This description only applies in the absence of or-patterns. Or-patterns make everything complicated, because the binding place depends on the subpattern. Until I have a better idea I leave them to be handled in whatever weird order arises from today's code.

r? `@matthewjasper`
2024-03-02 20:13:23 +01:00
Guillaume Boisseau b0ca9b5d44
Rollup merge of #121622 - dtolnay:wake, r=cuviper
Preserve same vtable pointer when cloning raw waker, to fix Waker::will_wake

Fixes #121600.

As `@jkarneges` identified in https://github.com/rust-lang/rust/issues/121600#issuecomment-1963041051, the issue is two different const promotions produce two statics at different addresses, which may or may not later be deduplicated by the linker (in this case not).

Prior to #119863, the content of the statics was compared, and they were equal. After, the address of the statics are compared and they are not equal.

It is documented that `will_wake` _"works on a best-effort basis, and may return false even when the Wakers would awaken the same task"_ so this PR fixes a quality-of-implementation issue, not a correctness issue.
2024-03-02 20:13:22 +01:00
Guillaume Boisseau 8653c09087
Rollup merge of #120761 - rcvalle:rust-dfsan, r=nikic
Add initial support for DataFlowSanitizer

Adds initial support for DataFlowSanitizer to the Rust compiler. It currently supports `-Zsanitizer-dataflow-abilist`. Additional options for it can be passed to LLVM command line argument processor via LLVM arguments using `llvm-args` codegen option (e.g., `-Cllvm-args=-dfsan-combine-pointer-labels-on-load=false`).
2024-03-02 20:13:22 +01:00
Chris Denton ce26c78820
Cleanup windows abort_internal 2024-03-02 18:22:15 +00:00