Commit Graph

266574 Commits

Author SHA1 Message Date
Jubilee
9025fe9e64
Rollup merge of #130336 - onur-ozkan:simple-improvement, r=albertlarsan68
simplify `Build::update_existing_submodule`

`Build::update_existing_submodule` is already doing the same thing..
2024-09-15 23:51:25 -07:00
Jubilee
68758c0560
Rollup merge of #130325 - workingjubilee:plus-minus-zero-redux, r=RalfJung,jieyouxu
Use -0.0 in `intrinsics::simd::reduce_add_unordered`

-0.0 is the actual neutral additive float, not +0.0, and this matters to codegen.

try-job: aarch64-gnu
2024-09-15 23:51:25 -07:00
Jubilee
0151cbe6e8
Rollup merge of #127879 - kornelski:bad-pointer-printf, r=workingjubilee
Document futility of printing temporary pointers

In the user forum I've seen a few people trying to understand how borrowing and moves are implemented by peppering their code with printing of `{:p}` of references to variables and expressions. This is a bad idea. It gives misleading and confusing results, because of autoderef magic, printing pointers of temporaries on the stack, and/or causes LLVM to optimize code differently when values had their address exposed.
2024-09-15 23:51:24 -07:00
bors
a0f57d87aa Auto merge of #3892 - rust-lang:rustup-2024-09-16, r=RalfJung
Automatic Rustup
2024-09-16 06:33:50 +00:00
Ralf Jung
5b8a18f959 fix clippy lints 2024-09-16 08:32:19 +02:00
The Miri Cronjob Bot
1692d12c1c fmt 2024-09-16 05:07:31 +00:00
The Miri Cronjob Bot
4d824fd5b7 Merge from rustc 2024-09-16 05:06:25 +00:00
The Miri Cronjob Bot
ffcaa7fdde Preparing for merge from rustc 2024-09-16 04:58:35 +00:00
bors
39b7669347 Auto merge of #130220 - RalfJung:float-classify, r=workingjubilee
simplify float::classify logic

I played around with the float-classify test in the hope of triggering x87 bugs by strategically adding `black_box`, and still the exact expression `@beetrees` suggested [here](https://github.com/rust-lang/rust/pull/129835#issuecomment-2325661597) remains the only case I found where we get the wrong result on x87. Curiously, this bug only occurs when MIR optimizations are enabled -- probably the extra inlining that does is required for LLVM to hit the right "bad" case in the backend. But even for that case, it makes no difference whether `classify` is implemented in the simple bit-pattern-based version or the more complicated version we had before.

Without even a single testcase that can distinguish our `classify` from the naive version, I suggest we switch to the naive version.
2024-09-16 03:36:03 +00:00
bors
c16ff44537 Auto merge of #130377 - weihanglo:update-cargo, r=weihanglo
Update cargo

25 commits in c1fa840a85eca53818895901a53fae34247448b2..a9a418d1a22f29e7dfd034e3b93f15657e608a29
2024-08-29 21:03:53 +0000 to 2024-09-15 19:13:12 +0000
- chore: revert change to Cargo.lock in f25806c (rust-lang/cargo#14547)
- Disable the shell_completions tests (rust-lang/cargo#14546)
- fix(vendor): trust crate version only when coming from registries (rust-lang/cargo#14530)
- docs: Feature resolver version 2: clarify use of 'target' (rust-lang/cargo#14540)
- Update docs for how cargo is published (rust-lang/cargo#14539)
- feat: Add native comlpetion with CompleteEnv under the nightly (rust-lang/cargo#14493)
- fix(new): Add to workspace relative to manifest, not current-dir (rust-lang/cargo#14505)
- Fix parsing of comma separated values in --crate-type flag (rust-lang/cargo#14499)
- Include public/private dependency status in `cargo metadata` (rust-lang/cargo#14504)
- Remove unnecessary symbols (rust-lang/cargo#14519)
- docs: bin source can be `src/main.rs` and/or in `src/bin/` (rust-lang/cargo#14515)
- fix(toml): Don't require MSRV bump for pub/priv (rust-lang/cargo#14507)
- bail before packaging on same version (rust-lang/cargo#14448)
- Implement path-bases (RFC 3529) 2/n: `cargo [add|remove|update]` support (rust-lang/cargo#14427)
- Publish workspace (rust-lang/cargo#14433)
- Bump ci's version of cargo-semver-version (rust-lang/cargo#14503)
- Document -Zpackage-workspace (rust-lang/cargo#14496)
- uplift windows gnullvm import libraries (rust-lang/cargo#14451)
- Bump to 0.84.0; update changelog (rust-lang/cargo#14495)
- Fix cargo add behaving different when translating package name (rust-lang/cargo#13765)
- chore(deps): update rust crate core-foundation to 0.10.0 (rust-lang/cargo#14475)
- feat(resolve): Report MSRV compatible version instead of incomptible (rust-lang/cargo#14471)
- Don't automatically include the current crate when packaging (rust-lang/cargo#14488)
- Fix elided lifetime (rust-lang/cargo#14487)
- chore(deps): update rust crate pasetors to 0.7.0 (rust-lang/cargo#14478)
2024-09-16 01:00:19 +00:00
许杰友 Jieyou Xu (Joe)
1f48a67a25 bootstrap: register tool docs for src/tools/build_helper 2024-09-16 00:33:33 +00:00
Jubilee Young
ab8c202527 Use -0.0 in intrinsics::simd::reduce_add_unordered
-0.0 is the actual neutral additive float, not +0.0, and this matters to codegen.
2024-09-15 16:40:23 -07:00
bors
d696a27c13 Auto merge of #130415 - matthiaskrgr:rollup-xhsu9oq, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #130151 (Use a small runner for msvc-ext2 job)
 - #130394 (const: don't ICE when encountering a mutable ref to immutable memory)
 - #130409 (tests: more ice tests)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-15 22:37:06 +00:00
Matthias Krüger
0406f12af9
Rollup merge of #130409 - matthiaskrgr:ccccrashes, r=compiler-errors
tests: more ice tests

r? `@jieyouxu`
2024-09-15 23:56:35 +02:00
Matthias Krüger
62445f1ec8
Rollup merge of #130394 - RalfJung:mut-ref-to-immut, r=saethlin
const: don't ICE when encountering a mutable ref to immutable memory

Turns out that this can actually happen -- thanks to `@matthiaskrgr` for producing a testcase. :)

Fixes https://github.com/rust-lang/rust/issues/130392
2024-09-15 23:56:35 +02:00
Matthias Krüger
21df3ff19e
Rollup merge of #130151 - ChrisDenton:slow-ci, r=Mark-Simulacrum
Use a small runner for msvc-ext2 job

Hopefully this should eliminate the errors from this job. The only question is how long it takes.

try-job: x86_64-msvc-ext2
2024-09-15 23:56:34 +02:00
Ralf Jung
7dfffe7e70 const: don't ICE when encountering a mutable ref to immutable memory 2024-09-15 22:53:04 +02:00
Weihang Lo
db19d43e42
Update cargo 2024-09-15 15:50:49 -04:00
bors
04a318787b Auto merge of #130407 - matthiaskrgr:rollup-vo2gmf4, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #129897 (deprecate -Csoft-float because it is unsound (and not fixable))
 - #130339 (Add `core::panic::abort_unwind`)
 - #130384 (compiler: Document AbiAndPrefAlign)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-15 19:35:19 +00:00
Matthias Krüger
9d761eac40 tests: more ice tests 2024-09-15 21:18:41 +02:00
Matthias Krüger
b3686b56c2
Rollup merge of #130384 - workingjubilee:document-what-abi-and-pref-align-is, r=compiler-errors
compiler: Document AbiAndPrefAlign

The mere existence of this struct is confusing, and the second field doubly so. It's easy to mistake the "preferred" alignment as semantically relevant somehow. Insofar as I am aware, it is not, and certainly not for Rust code.
2024-09-15 20:55:13 +02:00
Matthias Krüger
f0fb411969
Rollup merge of #130339 - CAD97:unwind-choice, r=dtolnay
Add `core::panic::abort_unwind`

`abort_unwind` is like `catch_unwind` except that it aborts the process if it unwinds, using the `#[rustc_nounwind]` mechanism also used by `extern "C" fn` to abort unwinding. The docs attempt to make it clear when to (rarely) and when not to (usually) use the function.

Although usage of the function is discouraged, having it available will help to normalize the experience when abort_unwind shims are hit, as opposed to the current ecosystem where there exist multiple common patterns for converting unwinding into a process abort.

For further information and justification, see the linked ACP.

- Tracking issue: https://github.com/rust-lang/rust/issues/130338
- ACP: https://github.com/rust-lang/libs-team/issues/441
2024-09-15 20:55:13 +02:00
Matthias Krüger
0daa636b93
Rollup merge of #129897 - RalfJung:soft-float-ignored, r=Urgau
deprecate -Csoft-float because it is unsound (and not fixable)

See  https://github.com/rust-lang/rust/issues/129893 for details. The general sentiment there seems to be that this flag has no use and sound alternatives exist, so let's add this warning and see if anyone out there disagrees.

Also show a different warning on targets where it does nothing (as documented since https://github.com/rust-lang/rust/pull/36261): it seems to correspond to `-mfloat-abi` in GCC/clang, which is an ARM-specific option. To be really sure it does nothing, only forward the flag to LLVM for eabihf targets. This should not change behavior but makes me sleep better ;)
2024-09-15 20:55:12 +02:00
Christopher Durham
42a44a04ee
simplify abort_unwind
Co-authored-by: David Tolnay <dtolnay@gmail.com>
2024-09-15 14:27:24 -04:00
bjorn3
5349365566 Use unconditional download-ci-llvm in setup_rust_fork.sh
For whatever reason someone decided to make the default if-changed
always checkout the llvm-project submodule, which takes a while.
2024-09-15 17:40:12 +00:00
bjorn3
eee42f2679 Fix rustc test suite 2024-09-15 17:34:45 +00:00
bjorn3
16cee899d1 Avoid mir_operand_get_const_val hack for simd_insert and simd_extract 2024-09-15 17:27:12 +00:00
bjorn3
1e960213e8 Add test for _mm_cmpestri 2024-09-15 17:24:43 +00:00
bjorn3
cebdfe40ad Slightly simplify the simd_shuffle impl 2024-09-15 17:07:29 +00:00
bjorn3
c7b49987a6 Fix rustc test suite 2024-09-15 16:59:35 +00:00
bjorn3
61d3b59f58 Rustup to rustc 1.83.0-nightly (9b72238eb 2024-09-14) 2024-09-15 16:49:17 +00:00
bjorn3
ab989ac7cb Sync from rust 9b72238eb8 2024-09-15 16:43:21 +00:00
bors
8c2c9a9ef5 Auto merge of #130401 - matthiaskrgr:rollup-fri2j58, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #129439 (Implement feature `string_from_utf8_lossy_owned` for lossy conversion from `Vec<u8>` to `String` methods)
 - #129828 (miri: treat non-memory local variables properly for data race detection)
 - #130110 (make dist vendoring configurable)
 - #130293 (Fix lint levels not getting overridden by attrs on `Stmt` nodes)
 - #130342 (interpret, miri: fix dealing with overflow during slice indexing and allocation)

Failed merges:

 - #130394 (const: don't ICE when encountering a mutable ref to immutable memory)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-15 15:05:29 +00:00
Matthias Krüger
96195a5e24
Rollup merge of #130342 - RalfJung:slice-idx-overflow, r=saethlin
interpret, miri: fix dealing with overflow during slice indexing and allocation

This is mostly to fix https://github.com/rust-lang/rust/issues/130284.

I then realized we're using somewhat sketchy arguments for a similar multiplication in `copy`/`copy_nonoverlapping`/`write_bytes`,  so I made them all share the same function that checks exactly the right thing. (The intrinsics would previously fail on allocations larger than `1 << 47` bytes... which are theoretically possible maybe? Anyway it seems conceptually wrong to use any other bound than `isize::MAX` here.)
2024-09-15 16:01:38 +02:00
Matthias Krüger
18a93ca65e
Rollup merge of #130293 - gurry:130142-lint-level-issue, r=cjgillot
Fix lint levels not getting overridden by attrs on `Stmt` nodes

Fixes #130142. See comments on the issue for context.

r? `@cjgillot`
2024-09-15 16:01:37 +02:00
Matthias Krüger
8ad52ddf9e
Rollup merge of #130110 - onur-ozkan:configurable-dist-vendor, r=Kobzol,Mark-Simulacrum
make dist vendoring configurable

Adds a new option `dist.vendor` which allows people to decide whether to vendor dependencies for their custom distribution tarball builds. Note that our builds will not be affected, as the default for this option is the same as the previous vendoring condition from bootstrap.
2024-09-15 16:01:37 +02:00
Matthias Krüger
6ac598a472
Rollup merge of #129828 - RalfJung:miri-data-race, r=saethlin
miri: treat non-memory local variables properly for data race detection

Fixes https://github.com/rust-lang/miri/issues/3242

Miri has an optimization where some local variables are not represented in memory until something forces them to be stored in memory (most notably, creating a pointer/reference to the local will do that). However, for a subsystem triggering on memory accesses -- such as the data race detector -- this means that the memory access seems to happen only when the local is moved to memory, instead of at the time that it actually happens. This can lead to UB reports in programs that do not actually have UB.

This PR fixes that by adding machine hooks for reads and writes to such efficiently represented local variables. The data race system tracks those very similar to how it would track reads and writes to addressable memory, and when a local is moved to memory, the clocks get overwritten with the information stored for the local.
2024-09-15 16:01:36 +02:00
Matthias Krüger
df3cf91b63
Rollup merge of #129439 - okaneco:vec_string_lossy, r=Noratrieb
Implement feature `string_from_utf8_lossy_owned` for lossy conversion from `Vec<u8>` to `String` methods

Accepted ACP: https://github.com/rust-lang/libs-team/issues/116
Tracking issue: #129436

Implement feature for lossily converting from `Vec<u8>` to `String`
- Add `String::from_utf8_lossy_owned`
- Add `FromUtf8Error::into_utf8_lossy`

---
Related to #64727, but unsure whether to mark it "fixed" by this PR.
That issue partly asks for in-place replacement of the original allocation. We fulfill the other half of that request with these functions.

closes #64727
2024-09-15 16:01:36 +02:00
Chris Denton
7223fd8085
Add system libs when cross compiling for Windows 2024-09-15 12:38:55 +00:00
Ralf Jung
339f68bd6c use early return for race_detecting() logic 2024-09-15 13:25:26 +02:00
bors
dde7d6649e Auto merge of #130390 - matthiaskrgr:rollup-evbfwe2, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #129195 (Stabilize `&mut` (and `*mut`) as well as `&Cell` (and `*const Cell`) in const)
 - #130118 (move Option::unwrap_unchecked into const_option feature gate)
 - #130295 (Fix target-cpu fpu features on Armv8-R.)
 - #130371 (Correctly account for niche-optimized tags in rustc_transmute)
 - #130381 (library: Compute Rust exception class from its string repr)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-15 11:19:28 +00:00
bors
7d8ee71274 Auto merge of #3889 - RalfJung:android-pthread, r=RalfJung
add Android pthread support

Also extend what we test on Solarish / FreeBSD, turns out a few more things are working.
2024-09-15 10:48:17 +00:00
Ralf Jung
5f3bec427c we can test more things on Solarish, and update its status in the README 2024-09-15 12:45:30 +02:00
Ralf Jung
f394c6ce8c test std::time APIs on FreeBSD and Solarish 2024-09-15 12:45:30 +02:00
Ralf Jung
8ee38bf230 add Android pthread support 2024-09-15 12:45:29 +02:00
Ralf Jung
cb445d0188 make pthread-threadname nicer with cfg-if 2024-09-15 12:45:29 +02:00
bors
75921d2ca4 Auto merge of #3886 - RalfJung:freebsd-pthread, r=RalfJung
support pthread primitives on FreeBSD

Fixes https://github.com/rust-lang/miri/issues/3571: makes out pthread implementation support FreeBSD.

FreeBSD sets PHTREAD_MUTEX_DEFAULT == PHTREAD_MUTEX_ERRORCK, so the logic for handling "default vs explicitly set mutex kind" had to be adjusted.

The rest is just some general cleanup of the pthread logic, and I realized that we can enable the std::sync tests on Solarish.
2024-09-15 10:10:14 +00:00
Ralf Jung
2ed91881ef enable std::sync tests on Solarish 2024-09-15 12:05:23 +02:00
Ralf Jung
2cdf5f7e69 move two tests to a better location 2024-09-15 12:03:20 +02:00
Ralf Jung
4000027084 pthread: add FreeBSD, remove PTHREAD_MUTEX_NORMAL_FLAG hack
On FreeBSD, DEFAULT maps to ERRORCK. This clashes with the existing PTHREAD_MUTEX_NORMAL_FLAG:
hack so we replace it by a different hack that works better cross-platform.

Also fix a case of "accidental early UB" in a UB test -- pthread_mutexattr_t must be initialized.
2024-09-15 11:58:51 +02:00