Commit Graph

267853 Commits

Author SHA1 Message Date
bors
f7c8928f03 Auto merge of #128711 - clarfonthey:default-iters-hash, r=dtolnay
impl `Default` for `HashMap`/`HashSet` iterators that don't already have it

This is a follow-up to #128261 that isn't included in that PR because it depends on:

* [x] rust-lang/hashbrown#542 (`Default`)
* [x] `hashbrown` release containing above

It also wasn't included in #128261 initially and should have its own FCP, since these are also insta-stable.

Changes added:

* `Default for hash_map::{Iter, IterMut, IntoIter, IntoKeys, IntoValues, Keys, Values, ValuesMut}`
* `Default for hash_set::{Iter, IntoIter}`

Changes that were added before FCP, but are being deferred to later:

* `Clone for hash_map::{IntoIter, IntoKeys, IntoValues} where K: Clone, V: Clone`
* `Clone for hash_set::IntoIter where K: Clone`
2024-10-03 08:44:51 +00:00
Jakub Beránek
2cf155924f
Do not include libstd.so in sysroot when we statically link to libstd 2024-10-03 09:43:55 +02:00
Ralf Jung
a8f9a32650 interpret: Immediate::offset: use shared sanity-check function to ensure invariant 2024-10-03 08:26:25 +02:00
bors
bf71d65980 Auto merge of #3935 - RalfJung:rustup, r=RalfJung
Rustup
2024-10-03 06:20:27 +00:00
Ralf Jung
9b35886adf make sure we also detect mixed-size races that begin at different addresses 2024-10-03 08:19:07 +02:00
bors
8885239786 Auto merge of #131185 - workingjubilee:rollup-wkcqe2j, r=workingjubilee
Rollup of 3 pull requests

Successful merges:

 - #126930 (Add unstable support for outputting file checksums for use in cargo)
 - #130725 (Parser: better error messages for ``@`` in struct patterns)
 - #131166 (Fix `target_vendor` for `aarch64-nintendo-switch-freestanding`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-03 06:02:19 +00:00
Ralf Jung
32d49680d6 fmt 2024-10-03 07:59:28 +02:00
Ralf Jung
6280e267f0 Merge from rustc 2024-10-03 07:58:48 +02:00
Ralf Jung
be819d4159 Preparing for merge from rustc 2024-10-03 07:47:41 +02:00
ismailarilik
3d8bd6bbc5 Handle rustc_metadata cases of rustc::potential_query_instability lint 2024-10-03 08:38:51 +03:00
Jubilee
cc61b81c6a
Rollup merge of #131166 - madsmtm:target-info-switch-vendor, r=jieyouxu
Fix `target_vendor` for `aarch64-nintendo-switch-freestanding`

Previously set to `target_vendor = "unknown"`, but Nintendo is clearly the vendor of the Switch, and is also reflected in the target name itself.

CC target maintainers `@leo60228` and `@jam1garner`
2024-10-02 21:26:59 -07:00
Jubilee
b7c33e2f20
Rollup merge of #130725 - GrigorenkoPV:@-in-struct-patterns, r=Nadrieril
Parser: better error messages for `@` in struct patterns
2024-10-02 21:26:58 -07:00
Jubilee
44f6275e14
Rollup merge of #126930 - Xaeroxe:file-checksum-hint, r=chenyukang
Add unstable support for outputting file checksums for use in cargo

Adds an unstable option that appends file checksums and expected lengths to the end of the dep-info file such that `cargo` can read and use these values as an alternative to file mtimes.

This PR powers the changes made in this cargo PR https://github.com/rust-lang/cargo/pull/14137

Here's the tracking issue for the cargo feature https://github.com/rust-lang/cargo/issues/14136.
2024-10-02 21:26:58 -07:00
Jaken Herman
4b48d72eaa Add get_line confusable to Stdin::read_line()
Add tests for addition of `#[rustc_confusables("get_line")]`
2024-10-02 23:19:26 -05:00
ltdk
11f738fcb2 impl Default for Hash{Map,Set} iterators that don't already have it 2024-10-02 23:43:48 -04:00
bors
fd1f8aa05d Auto merge of #127912 - joboet:tls_dtor_thread_current, r=cuviper
std: make `thread::current` available in all `thread_local!` destructors

... and thereby allow the panic runtime to always print the right thread name.

This works by modifying the TLS destructor system to schedule a runtime cleanup function after all other TLS destructors registered by `std` have run. Unfortunately, this doesn't affect foreign TLS destructors, `thread::current` will still panic there.

Additionally, the thread ID returned by `current_id` will now always be available, even inside the global allocator, and will not change during the lifetime of one thread (this was previously the case with key-based TLS).

The mechanisms I added for this (`local_pointer` and `thread_cleanup`) will also allow finally fixing #111272 by moving the signal stack to a similar runtime-cleanup TLS variable.
2024-10-03 03:31:47 +00:00
Michael Goulet
6e8573c520 Visit in embargo visitor if trait method has body 2024-10-02 23:00:08 -04:00
Michael Goulet
7cd466a036 Move in_trait into OpaqueTyOrigin 2024-10-02 22:48:26 -04:00
Michael Goulet
cb7e3695e8 Use named fields for OpaqueTyOrigin 2024-10-02 22:04:18 -04:00
Michael Goulet
f95bdf453e Remove redundant in_trait from hir::TyKind::OpaqueDef 2024-10-02 21:59:55 -04:00
bors
ad9c494835 Auto merge of #131148 - Urgau:hashbrown-0.15, r=Amanieu
Update hashbrown to 0.15 and adjust some methods

This PR updates `hashbrown` to 0.15 in the standard library and adjust some methods as well as removing some as they no longer exists in Hashbrown it-self.

 - `HashMap::get_many_mut` change API to return array-of-Option
 - `HashMap::{replace_entry, replace_key}` are removed, FCP close [already finished](https://github.com/rust-lang/rust/issues/44286#issuecomment-2293825619)
 - `HashSet::get_or_insert_owned` is removed as it no longer exists in hashbrown

Closes https://github.com/rust-lang/rust/issues/44286
r? `@Amanieu`
2024-10-03 00:44:26 +00:00
bors
9c7013c15c Auto merge of #131006 - RalfJung:immediate-sanity, r=saethlin
interpret: always enable write_immediate sanity checks

Writing a wrongly-sized scalar somewhere can have quite confusing effects. Let's see how expensive it is to catch this early.
2024-10-02 22:12:06 +00:00
Jubilee Young
ac53f1f242 library: Stabilize const_slice_first_last
Const-stabilizes:
- `slice::first_mut`
- `slice::split_first_mut`
- `slice::last_mut`
- `slice::split_last_mut`
2024-10-02 14:10:12 -07:00
Jubilee Young
75db6b29b5 library: Stabilize const_unsafecell_get_mut
Const-stabilizes:
- `UnsafeCell::get_mut`
2024-10-02 14:10:12 -07:00
Jubilee Young
966405d107 library: Stabilize const_ptr_as_ref
Const-stabilizes:
- `NonNull::as_mut`
2024-10-02 14:10:11 -07:00
Jubilee Young
bcc78bdc29 library: Stabilize const_str_as_mut
Const-stabilizes:
- `str::as_bytes_mut`
- `str::as_mut_ptr`
2024-10-02 14:09:19 -07:00
Jubilee Young
a0228686d1 library: Stabilize const_str_from_utf8_unchecked_mut
Const-stabilizes:
- `str::from_utf8_unchecked_mut`
2024-10-02 14:09:19 -07:00
bors
52aa98a994 Auto merge of #3932 - rust-lang:epoll-with-vector-clock, r=oli-obk
Add vector clock to epoll ready lists

Replaces #3928

Fixes #3911
2024-10-02 20:35:29 +00:00
bors
18b1161ec9 Auto merge of #130821 - lcnr:nalgebra-hang-2, r=compiler-errors
add caching to most type folders, rm region uniquification

Fixes the new minimization of the hang in nalgebra and nalgebra itself :3

this is a bit iffy, especially the cache in `TypeRelating`. I believe all the caches are correct, but it definitely adds some non-local complexity in places. The first commit removes region uniquification, reintroducing the ICE from https://github.com/rust-lang/trait-system-refactor-initiative/issues/27. This does not affect coherence and I would like to fix this by introducing OR-region constraints

r? `@compiler-errors`
2024-10-02 19:21:44 +00:00
Mads Marquart
0ae796440a Fix target_abi in SOLID targets
The `armv7a-kmc-solid_asp3-eabi` and `armv7a-kmc-solid_asp3-eabihf`
targets clearly have the ABI in their name, so it should also be exposed
in Rust's `target_abi` cfg variable.
2024-10-02 20:54:09 +02:00
Mads Marquart
033fdda46c Fix target_env in avr-unknown-gnu-atmega328
The target name itself contains GNU, we should set that in the
environment as well.
2024-10-02 20:30:51 +02:00
Frank Rehwinkel
81202c8b13 epoll: remove extraneous clone of ready_list
A simplification that doesn't impact the epoll implementation's logic.

It is not necessary to clone the ready_list before reading its
`is_empty` state.

This avoids the clone step but more importantly avoids the invisible
drop step of the clone.
2024-10-02 20:08:46 +02:00
Frank Rehwinkel
86bb1373aa epoll: add vector clock to the epoll ready_list
This adds a VClock to the epoll implementation's ready_list
and has this VClock synced from the thread that updates
an event in the ready_list and then has the VClocks of any
threads being made runnable again, out of the calls to
epoll_wait, synced from it.
2024-10-02 20:08:46 +02:00
Frank Rehwinkel
1b622f4672 epoll: remove unnecessary instructions
A couple of instructions were left over from an earlier rebase
it would seem. They don't impact the logic but the ready_list type
is about to change in the next commit.

Rather than modify one of these lines in the commit that changes
ready_list, only to have these lines removed later on, remove them now.
They don't impact the tests results.
2024-10-02 20:06:37 +02:00
Frank Rehwinkel
3e089b0e16 epoll: add data_race test
This test demonstrates the need to synchronize the clock
of the thread waking up from an epoll_wait from the thread
that issued the epoll awake event.
2024-10-02 20:06:37 +02:00
Mads Marquart
746c322592 Fix target_vendor for aarch64-nintendo-switch-freestanding
Previously set to `target_vendor = "unknown"`, but Nintendo is clearly
the vendor of the Switch, and is also reflected in the target name
itself.
2024-10-02 19:30:55 +02:00
bors
5384697e9e Auto merge of #131158 - matthiaskrgr:rollup-3x2vado, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #130863 (Relax a debug assertion for dyn principal *equality* in codegen)
 - #131016 (Apple: Do not specify an SDK version in `rlib` object files)
 - #131140 (Handle `rustc_hir_analysis` cases of `potential_query_instability` lint)
 - #131141 (mpmc doctest: make sure main thread waits for child threads)
 - #131150 (only query `params_in_repr` if def kind is adt)
 - #131151 (Replace zero-width whitespace with a visible `\` in the PR template)
 - #131152 (Improve const traits diagnostics for new desugaring)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-02 16:24:05 +00:00
joboet
a71ba0cf02
bless miri tests 2024-10-02 18:04:21 +02:00
joboet
d868fdce6b
std: make thread::current available in all thread_local! destructors 2024-10-02 18:04:21 +02:00
Matthias Krüger
b38f7ad9b1
Rollup merge of #131152 - fee1-dead-contrib:fxdiag, r=compiler-errors
Improve const traits diagnostics for new desugaring

r? project-const-traits
2024-10-02 17:10:47 +02:00
Matthias Krüger
06d5218b0f
Rollup merge of #131151 - jieyouxu:adjust-pr-template, r=fmease
Replace zero-width whitespace with a visible `\` in the PR template

People (incl. myself) tried to copy the `r?` which had an invisible zero-width whitespace (meaning it was actually more like `r⌴?`), causing rustbot to not recognize the instruction, and which makes it difficult to figure out why it didn't work.

This PR replaces the zero-width whitespace with a visible `\` alongside a comment to remove the `\`. It's a bit less "visual", but at least it's visible why the rustbot assignment doesn't work.
2024-10-02 17:10:46 +02:00
Matthias Krüger
2e0db79f0b
Rollup merge of #131150 - bvanjoi:issue-128327, r=chenyukang
only query `params_in_repr` if def kind is adt

Fixes #128327

`params_in_repr` was only stored in `encode_info_for_adt`, so we only query it when the def kind belongs to them.

9e3e517446/compiler/rustc_metadata/src/rmeta/encoder.rs (L1566-L1567)
2024-10-02 17:10:45 +02:00
Matthias Krüger
49f17ff74e
Rollup merge of #131141 - RalfJung:mpmc-test, r=Amanieu
mpmc doctest: make sure main thread waits for child threads

Currently, chances are half the test is not executed because the main thread exits while the other threads are still working.

Cc `@obeis` `@Amanieu`
2024-10-02 17:10:45 +02:00
Matthias Krüger
7e0797c13f
Rollup merge of #131140 - ismailarilik:handle-potential-query-instability-lint-for-rustc-hir-analysis, r=compiler-errors
Handle `rustc_hir_analysis` cases of `potential_query_instability` lint

This PR removes `#![allow(rustc::potential_query_instability)]` line from [`compiler/rustc_hir_analysis/src/lib.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_hir_analysis/src/lib.rs#L61) and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors.

A somewhat tracking issue: https://github.com/rust-lang/rust/issues/84447
2024-10-02 17:10:44 +02:00
Matthias Krüger
5fd6218d72
Rollup merge of #131016 - madsmtm:no-sdk-version-in-object, r=jieyouxu
Apple: Do not specify an SDK version in `rlib` object files

This was added in https://github.com/rust-lang/rust/pull/114114, but is unnecessary, since it ends up being overwritten when linking anyhow, and it feels wrong to embed some arbitrary SDK version in here. The object files produced by LLVM also do not set this, and the tooling shows `n/a` when it's `0`, so it seems to genuinely be optional in object files.

I've also added a test for the different places the SDK version shows up, and documented a bit more in the code how SDK versions work.

See https://github.com/rust-lang/rust/issues/129432 for the bigger picture.

Tested with (excludes the same few targets as in https://github.com/rust-lang/rust/pull/130435):
```console
./x test tests/run-make/apple-sdk-version --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,armv7k-apple-watchos,armv7s-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
IPHONEOS_DEPLOYMENT_TARGET=10.0 ./x test tests/run-make/apple-sdk-version --target=i386-apple-ios
```

CC `@BlackHoleFox,` you [originally commented on these values](https://github.com/rust-lang/rust/pull/114114#discussion_r1300599445).

`@rustbot` label O-apple
2024-10-02 17:10:43 +02:00
Matthias Krüger
f9ba5529eb
Rollup merge of #130863 - compiler-errors:relax-codegen-dyn-assert, r=lcnr
Relax a debug assertion for dyn principal *equality* in codegen

Maybe this sucks and I should just bite the bullet and use `infcx.sub` here. Thoughts?

r? lcnr

Fixes #130855
2024-10-02 17:10:43 +02:00
bors
44722bd9ba Auto merge of #125771 - Kobzol:ci-datadog-metrics, r=jdno
[CI] Upload average CPU utilization of CI jobs to DataDog

This PR adds a new CI step that uploads the average CPU utilization of the current GH job to Datadog. I want to add more metrics in follow-up PRs.

r? `@jdno`

try-job: dist-i686-msvc
try-job: aarch64-apple
try-job: x86_64-gnu-llvm-18
2024-10-02 13:56:55 +00:00
lcnr
1a04a317c4 review 2024-10-02 14:49:36 +02:00
Deadbeef
7f6150b577 Improve const traits diagnostics for new desugaring 2024-10-02 19:45:17 +08:00
许杰友 Jieyou Xu (Joe)
aa3251dd3b Replace zero-width whitespace with a visible \
People tried to copy the `r?` which had an invisible zero-width
whitespace, causing rustbot to not recognize the instruction, and which
makes it difficult to figure out why it didn't work.
2024-10-02 19:11:11 +08:00