Commit Graph

256534 Commits

Author SHA1 Message Date
Michael Goulet 1af490de42 Better ICE message for unresolved upvars 2024-05-24 15:47:50 -04:00
Boxy ed8e436916 move generics_of call outside of iter 2024-05-24 20:15:54 +01:00
bors 697ac29a80 Auto merge of #125499 - matthiaskrgr:rollup-84i5z5w, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #125455 (Make `clamp` inline)
 - #125477 (Run rustfmt on files that need it.)
 - #125481 (Fix the dead link in the bootstrap README)
 - #125482 (Notify kobzol after changes to `opt-dist`)
 - #125489 (Revert problematic opaque type change)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-24 18:53:03 +00:00
lcnr ebd9f355e2 remove proof tree formatter, make em shallow 2024-05-24 18:41:31 +00:00
Hans Wennborg 3fe3157858 Stop using the avx512er and avx512pf x86 target features
They are no longer supported by LLVM 19.

Fixes #125492
2024-05-24 20:12:42 +02:00
bors 56d77b9048 Auto merge of #17275 - roife:fix-issue-17012, r=Veykril
Fix inconsistent cwd of `run` and `debug` command in client

Fix #17012. Also related to #13022 and #15993.

When the `kind` of runnable is `bin`, Cargo would use the workspace root as the cwd for the `run` command; otherwise, Cargo defaults to the package root as the cwd for `run`.

Initially, r-a assumed the workspace root as the cwd for all runnables in `debug` command, which led to issue #13022. In this case, during unit testing, the `run` command would use the package root while `debug` would use the workspace root, causing inconsistency.

PR #15993 addressed this problem by using the package root as the cwd for `debug` command. However, it also resulted in an inconsistency: when executing the `run` command within the main fn of a package (whose target is `bin`), Cargo would use the workspace root, whereas `debug` would use the package root, leading to issue #17012.

The preferable approach is to determine the cwd based on the runnable's type. To resolve this, this PR introduces a new `cwd` field within `CargoRunnable`, allowing r-a to decide the appropriate cwd depending on the specific kind of the runnable.
2024-05-24 17:43:35 +00:00
Michael Goulet de517b79bc Actually just remove the special case altogether 2024-05-24 13:16:06 -04:00
Mahmoud Al-Qudsi 65dffc1990 Change pedantically incorrect OnceCell/OnceLock wording
While the semantic intent of a OnceCell/OnceLock is that it can only be written
to once (upon init), the fact of the matter is that both these types offer a
`take(&mut self) -> Option<T>` mechanism that, when successful, resets the cell
to its initial state, thereby technically allowing it to be written to again.

Despite the fact that this can only happen with a mutable reference (generally
only used during the construction of the OnceCell/OnceLock), it would be
incorrect to say that the type itself as a whole categorically prevents being
initialized or written to more than once (since it is possible to imagine an
identical type only without the `take()` method that actually fulfills that
contract).

To clarify, change "that cannot be.." to "that nominally cannot.." and add a
note to OnceCell about what can be done with an `&mut Self` reference.
2024-05-24 12:15:06 -05:00
Boxy 714e172ef2 Remove DefId from EarlyParamRegion (clippy/smir) 2024-05-24 18:06:57 +01:00
Boxy 796cb8031d Remove failing tests 2024-05-24 18:06:57 +01:00
Boxy f856ee357c Remove DefId from EarlyParamRegion (clippy/smir) 2024-05-24 18:06:57 +01:00
Boxy fe2d7794ca Remove DefId from EarlyParamRegion (tedium/diagnostics) 2024-05-24 18:06:53 +01:00
Jubilee Young 14fc3fdb2c miri: receive the blessings of validate.rs 2024-05-24 09:56:56 -07:00
Jubilee Young 584975d606 clippy: unnest check_consts 2024-05-24 09:56:56 -07:00
Jubilee Young 87048a46fc compiler: unnest rustc_const_eval::check_consts 2024-05-24 09:56:56 -07:00
Jubilee Young db6ec2618a compiler: const_eval/transform/validate.rs -> mir_transform/validate.rs 2024-05-24 09:56:56 -07:00
Alona Enraght-Moony 3ee84983f1 rustdoc-json: Add test for keywords with --document-private-items 2024-05-24 16:40:20 +00:00
Boxy bd6344d829 Remove DefId from EarlyParamRegion (type system) 2024-05-24 17:33:48 +01:00
Boxy b7b350cff7 docs 2024-05-24 17:33:48 +01:00
Matthias Krüger 1a165ecb9b Rollup merge of #125489 - oli-obk:revert_stuff_2, r=compiler-errors
Revert problematic opaque type change

fixes https://github.com/rust-lang/rust/issues/124891
fixes https://github.com/rust-lang/rust/issues/125192

reverts https://github.com/rust-lang/rust/pull/123979
2024-05-24 17:48:04 +02:00
Matthias Krüger 54a2bd8e74 Rollup merge of #125482 - Kobzol:triagebot-opt-dist, r=lqd
Notify kobzol after changes to `opt-dist`

r? ``@Mark-Simulacrum``
2024-05-24 17:48:04 +02:00
Matthias Krüger a2a68f2d3d Rollup merge of #125481 - iawia002:fix-dead-link, r=lqd
Fix the dead link in the bootstrap README

This link has been changed since https://github.com/rust-lang/rustc-dev-guide/pull/1939
2024-05-24 17:48:03 +02:00
Matthias Krüger eb6297eb6f Rollup merge of #125477 - nnethercote:missed-rustfmt, r=compiler-errors
Run rustfmt on files that need it.

Somehow these files aren't properly formatted. By default `x fmt` and `x tidy` only check files that have changed against master, so if an ill-formatted file somehow slips in it can stay that way as long as it doesn't get modified(?)

I found these when I ran `x fmt` explicitly on every `.rs` file in the repo, while working on
https://github.com/rust-lang/compiler-team/issues/750.
2024-05-24 17:48:03 +02:00
Matthias Krüger 268657b40b Rollup merge of #125455 - blyxyas:opt-clamp, r=joboet
Make `clamp` inline

Context: rust-lang/rust-clippy#12826
This results in slightly more optimized assembly. (And most important, it's now less than lines than just manually clamping a value)
2024-05-24 17:48:02 +02:00
Mees Frensel a85f6a6640 Fix some SIMD intrinsics documentation 2024-05-24 17:34:12 +02:00
bors 9e297bf54d Auto merge of #122494 - joboet:simplify_key_tls, r=m-ou-se
Simplify key-based thread locals

This PR simplifies key-based thread-locals by:
* unifying the macro expansion of `const` and non-`const` initializers
* reducing the amount of code in the expansion
* simply reallocating on recursive initialization instead of going through `LazyKeyInner`
* replacing `catch_unwind` with the shared `abort_on_dtor_unwind`

It does not change the initialization behaviour described in #110897.
2024-05-24 15:34:07 +00:00
Weihang Lo 99c9b0775f Update rustc-perf 2024-05-24 11:25:46 -04:00
bors f16317e9cc Auto merge of #12841 - B14CK313:fix-expect-derive, r=y21
fulfill expectations in `check_partial_eq_without_eq`

This is a followup to #12804, fixing a similar issue for `derive_partial_eq_without_eq` by using `span_lint_hir_and_then` instead of `span_lint_and_sugg`.

Additionally tests for both `#[allow(clippy::derive_partial_eq_without_eq)]` and `#[expect(clippy::derive_partial_eq_without_eq)]` are added.

changelog:[`derive_partial_eq_without_eq`]: fulfill expectations
2024-05-24 14:10:53 +00:00
Oli Scherer 526090b901 Add regression tests 2024-05-24 14:01:49 +00:00
Oli Scherer 56c135c925 Revert "Rollup merge of #123979 - oli-obk:define_opaque_types7, r=compiler-errors"
This reverts commit f939d1ff48, reversing
changes made to 183c706305.
2024-05-24 13:21:59 +00:00
bors 67b7b6a607 Auto merge of #12838 - kpreid:restriction-doc, r=llogiq
For restriction lints, replace “Why is this bad?” with “Why restrict this?”

The `restriction` group contains many lints which are not about necessarily “bad” things, but style choices — perhaps even style choices which contradict conventional Rust style — or are otherwise very situational. This results in silly wording like “Why is this bad? It isn't, but ...”, which I’ve seen confuse and distress a newcomer at least once.

To improve this situation, this PR replaces the “Why is this bad?” section heading with “Why restrict this?”, for most, but not all, restriction lints. I left alone the ones whose placement in the restriction group is more incidental.

In order to make this make sense, I had to remove the “It isn't, but” texts from the contents of the sections. Sometimes further changes were needed, or there were obvious fixes to make, and I went ahead and made those changes without attempting to split them into another commit, even though many of them are not strictly necessary for the “Why restrict this?” project; it seemed to me that it was more valuable to grab the low-hanging fruit than to be careful about it.

changelog: rephrased the documentation of `restriction` lints for clarity about their nature
2024-05-24 12:58:25 +00:00
bors 213ad10c8f Auto merge of #121150 - Swatinem:debug-ascii-str, r=joboet
Add a fast-path to `Debug` ASCII `&str`

Instead of going through the `EscapeDebug` machinery, we can just skip over ASCII chars that don’t need any escaping.

---

This is an alternative / a companion to https://github.com/rust-lang/rust/pull/121138.

The other PR is adding the fast path deep within `EscapeDebug`, whereas this skips as early as possible.
2024-05-24 12:23:00 +00:00
surechen 09c8e39adb A small diagnostic improvement for dropping_copy_types
fixes #125189
2024-05-24 19:31:57 +08:00
joboet 0e7e75ebca std: clean up the TLS implementation 2024-05-24 12:28:05 +02:00
joboet 5f0531da05 std: simplify key-based thread locals 2024-05-24 11:36:50 +02:00
Guillaume Gomez daff84372d Migrate run-make/rustdoc-with-output-dir-option to rmake.rs 2024-05-24 11:19:30 +02:00
Oli Scherer d5eb7a71b3 Use regular type equating instead of a custom query 2024-05-24 09:15:43 +00:00
Oli Scherer 9dc76207ff Fail relating constants of different types 2024-05-24 09:15:43 +00:00
bors 008f6b3a3f Auto merge of #3626 - devnexen:pthread_name_illumos, r=oli-obk
solaris add support for threadname.

from std::unix::thread::set_name, pthread_setname_np is a weak symbol (not always had been available). Other than that, similar to linux only having twice of its buffer limit.
2024-05-24 09:09:43 +00:00
bors 464987730a Auto merge of #125479 - scottmcm:validate-vtable-projections, r=Nilstrieb
Validate the special layout restriction on `DynMetadata`

If you look at <https://stdrs.dev/nightly/x86_64-unknown-linux-gnu/std/ptr/struct.DynMetadata.html>, you'd think that `DynMetadata` is a struct with fields.

But it's actually not, because the lang item is special-cased in rustc_middle layout:

https://github.com/rust-lang/rust/blob/7601adcc764d42c9f2984082b49948af652df986/compiler/rustc_middle/src/ty/layout.rs#L861-L864

That explains the very confusing codegen ICEs I was getting in https://github.com/rust-lang/rust/pull/124251#issuecomment-2128543265

> Tried to extract_field 0 from primitive OperandRef(Immediate((ptr:  %5 = load ptr, ptr %4, align 8, !nonnull !3, !align !5, !noundef !3)) @ TyAndLayout { ty: DynMetadata<dyn Callsite>, layout: Layout { size: Size(8 bytes), align: AbiAndPrefAlign { abi: Align(8 bytes), pref: Align(8 bytes) }, abi: Scalar(Initialized { value: Pointer(AddressSpace(0)), valid_range: 1..=18446744073709551615 }), fields: Primitive, largest_niche: Some(Niche { offset: Size(0 bytes), value: Pointer(AddressSpace(0)), valid_range: 1..=18446744073709551615 }), variants: Single { index: 0 }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes) } })

because there was a `Field` projection despite the layout clearly saying it's [`Primitive`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_target/abi/enum.FieldsShape.html#variant.Primitive).

Thus this PR updates the MIR validator to check for such a projection, and changes `libcore` to not ever emit any projections into `DynMetadata`, just to transmute the whole thing when it wants a pointer.
2024-05-24 08:53:27 +00:00
Jakub Beránek e2ef4e1b0d Notify kobzol after changes to opt-dist 2024-05-24 10:36:44 +02:00
bors 7fc41d1bdf Auto merge of #3625 - Strophox:miri-allocation-fix, r=RalfJung
Bugfix `MiriAllocBytes` to guarantee different addresses

Fix in `alloc_bytes.rs` following https://github.com/rust-lang/miri/pull/3526

Currently when an allocation of `size == 0` is requested we return a `std::ptr::without_provenance_mut(align)`, but this means returned `ptr`s may overlap, which breaks things.
2024-05-24 08:11:36 +00:00
Ralf Jung b84620ff17 extend comments 2024-05-24 10:10:07 +02:00
Xinzhao Xu e78671e61f Fix the dead link in the bootstrap README 2024-05-24 15:44:12 +08:00
bors 7c547894c7 Auto merge of #125457 - fmease:gacs-diag-infer-plac-missing-ty, r=compiler-errors
Properly deal with missing/placeholder types inside GACs

Fixes #124833.

r? oli-obk (#123130)
2024-05-24 06:45:40 +00:00
Jakob Schwarz 7f30b20b28 fulfill expectations in check_partial_eq_without_eq
changelog: fulfill expectations in [derive_partial_eq_without_eq]
2024-05-24 08:44:41 +02:00
Scott McMurray d83f3ca8ca Validate the special layout restriction on DynMetadata 2024-05-23 23:38:44 -07:00
bors 88d519f718 Auto merge of #3628 - RalfJung:tokio, r=RalfJung
add back some tokio features

Turns out I went a bit too fer when I removed features, so `socketpair` was no longer used.
2024-05-24 06:37:35 +00:00
Ralf Jung 561bd9a5ec add back some tokio features 2024-05-24 08:19:17 +02:00
bors 10d414091b Auto merge of #3627 - rust-lang:rustup-2024-05-24, r=RalfJung
Automatic Rustup
2024-05-24 06:12:29 +00:00