Commit Graph

259066 Commits

Author SHA1 Message Date
bors
f8453359bb Auto merge of #127119 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2024-06-29 11:44:01 +00:00
bors
9d920ed333 Auto merge of #3723 - RalfJung:win-tls-callback, r=RalfJung
iter_exported_symbols: also walk used statics in local crate

Since https://github.com/rust-lang/rust/pull/126938 got reverted, we need a different approach.

Fixes https://github.com/rust-lang/miri/issues/3722
2024-06-29 10:20:13 +00:00
Ralf Jung
66a885b25d iter_exported_symbols: also walk used statics in local crate 2024-06-29 12:17:10 +02:00
bors
be99243afc Auto merge of #127111 - matthiaskrgr:rollup-ybzkuuv, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #126822 (Bootstrap command refactoring: port more `Command` usages to `BootstrapCmd` (step 2))
 - #126835 (Simplifications in match lowering)
 - #126953 (std: separate TLS key creation from TLS access)
 - #127045 (Rename `super_predicates_of` and similar queries to `explicit_*` to note that they're not elaborated)
 - #127075 (rustc_data_structures: Explicitly check for 64-bit atomics support)
 - #127101 (remove redundant match statement from dataflow const prop)
 - #127102 (Rename fuchsia builder and bump Fuchsia)
 - #127103 (Move binder and polarity parsing into `parse_generic_ty_bound`)
 - #127108 (unify `dylib` and `bin_helpers` and create `shared_helpers::parse_value_from_args`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-29 09:29:41 +00:00
bors
abb5826e3d Auto merge of #3721 - rust-lang:rustup-2024-06-29, r=RalfJung
Automatic Rustup
2024-06-29 07:33:09 +00:00
Matthias Krüger
8fe770165f
Rollup merge of #127108 - onur-ozkan:bin-helper, r=Kobzol
unify `dylib` and `bin_helpers` and create `shared_helpers::parse_value_from_args`

`dylib` and `bin_helpers` were already used in similar logic. This PR unifies them under a `shared_helpers` module that is utilized by both the bootstrap library and shims. Additionally, created `parse_value_from_args` with a unit test.  This helps avoid code duplication in shims and can also be used in the bootstrap library if needed (which is the case in one of `@Kobzol's` tasks).

r? `@Kobzol`
2024-06-29 09:14:59 +02:00
Matthias Krüger
a4e92bfef0
Rollup merge of #127103 - compiler-errors:tighten-trait-bound-parsing, r=fmease
Move binder and polarity parsing into `parse_generic_ty_bound`

Let's pull out the parts of #127054 which just:
1. Make the parsing code less confusing
2. Fix `?use<>` (to correctly be denied)
3. Improve `T: for<'a> 'a` diagnostics

This should have no user-facing effects on stable parsing.

r? fmease
2024-06-29 09:14:59 +02:00
Matthias Krüger
367a80ce9e
Rollup merge of #127102 - tmandry:rename-fuchsia-builder, r=Kobzol
Rename fuchsia builder and bump Fuchsia

This PR renames the fuchsia builder as requested in https://github.com/rust-lang/rustc-dev-guide/pull/1989#pullrequestreview-2148682346 and bumps Fuchsia.

This includes the quality-of-life improvements for developers in https://fxrev.dev/1061894. It also removes the wasm target, which should speed up the build a little.

The new name of the builder is `x86_64-fuchsia` because I think `x86_64-gnu-fuchsia` would be confusing and put too much emphasis on the host target. (In terms of triples, we are targeting `x86_64-unknown-fuchsia` from `x86_64-unknown-linux-gnu`.) Someone on the infra team should weigh in here.

After this lands, we should update the docs in the rustc-dev-guide again.

cc `@lqd`
r? t-infra

try-job: x86_64-fuchsia
2024-06-29 09:14:58 +02:00
Matthias Krüger
c1d7ff55b5
Rollup merge of #127101 - matthiaskrgr:thonk, r=compiler-errors
remove redundant match statement from dataflow const prop
2024-06-29 09:14:58 +02:00
Matthias Krüger
3369e8364b
Rollup merge of #127075 - glaubitz:copy-and-paste-fix, r=SparrowLii
rustc_data_structures: Explicitly check for 64-bit atomics support

Instead of keeping a list of architectures which have native support
for 64-bit atomics, just use #[cfg(target_has_atomic = "64")] and its
inverted counterpart to determine whether we need to use portable
AtomicU64 on the target architecture.
2024-06-29 09:14:57 +02:00
Matthias Krüger
e9d5a2f45f
Rollup merge of #127045 - compiler-errors:explicit, r=oli-obk
Rename `super_predicates_of` and similar queries to `explicit_*` to note that they're not elaborated

Rename:
* `super_predicates_of` -> `explicit_super_predicates_of`
* `implied_predicates_of` -> `explicit_implied_predicates_of`
* `supertraits_containing_assoc_item` -> `explicit_supertraits_containing_assoc_item`

This makes it clearer that, unlike (for example) [`TyCtxt::super_traits_of`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.super_traits_of), we don't automatically elaborate this set of predicates.

r? ``@lcnr`` or ``@oli-obk`` or someone from t-types idc
2024-06-29 09:14:57 +02:00
Matthias Krüger
1e39eb7d53
Rollup merge of #126953 - joboet:lazy_key, r=jhpratt
std: separate TLS key creation from TLS access

Currently, `std` performs an atomic load to get the OS key on every access to `StaticKey` even when the key is already known. This PR thus replaces `StaticKey` with the platform-specific `get` and `set` function and a new `LazyKey` type that acts as a `LazyLock<Key>`, allowing the reuse of the retreived key for multiple accesses.

Related to #110897.
2024-06-29 09:14:56 +02:00
Matthias Krüger
806c5c1971
Rollup merge of #126835 - Nadrieril:reify-decision-tree, r=matthewjasper
Simplifications in match lowering

A series of small simplifications and deduplications in the MIR lowering of patterns.

r? ````@matthewjasper````
2024-06-29 09:14:56 +02:00
Matthias Krüger
dfa68f1d62
Rollup merge of #126822 - Kobzol:bootstrap-cmd-refactor-2, r=onur-ozkan
Bootstrap command refactoring: port more `Command` usages to `BootstrapCmd` (step 2)

This PR moves more of bootstrap to use `BooststrapCmd`, and also refactors the struct to allow it to serve as a proper command wrapper.

Tracking issue: https://github.com/rust-lang/rust/issues/126819

Best reviewed commit-by-commit, I have been adding some helper impls along the way to ease the migration, and then later I remove some of them since they were no longer needed.

r? `@onur-ozkan`
2024-06-29 09:14:55 +02:00
bors
38d0f87a49 Auto merge of #126698 - Oneirical:tessteract, r=Kobzol
Migrate `unknown-mod-stdin`, `issue-68794-textrel-on-minimal-lib`, `raw-dylib-cross-compilation` and `used-cdylib-macos` `run-make` tests to rmake

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Seriously needs OSX/Windows try-jobs. If it fails, restore `only-linux` in `textrel-on-minimal-lib` and try again.

try-job: x86_64-mingw
try-job: x86_64-msvc
2024-06-29 07:12:17 +00:00
onur-ozkan
9098474dad create shared_helpers::parse_value_from_args
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-29 09:43:58 +03:00
The Miri Cronjob Bot
ec7bcc0357 Merge from rustc 2024-06-29 05:20:59 +00:00
onur-ozkan
0afc774e9d unify bin_helpers and dylib utility modules
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-29 08:17:44 +03:00
The Miri Cronjob Bot
64c8366ca2 Preparing for merge from rustc 2024-06-29 05:13:25 +00:00
bors
d38cd229b7 Auto merge of #127096 - matthiaskrgr:rollup-kh7e0rh, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #123714 (Add test for fn pointer duplication.)
 - #124091 (Update AST validation module docs)
 - #127015 (Switch back `non_local_definitions` lint to allow-by-default)
 - #127016 (docs: check if the disambiguator matches its suffix)
 - #127029 (Fix Markdown tables in platform-support.md)
 - #127032 (Enable const casting for `f16` and `f128`)
 - #127055 (Mark Hasher::finish as #[must_use])
 - #127068 (Stall computing instance for drop shim until it has no unsubstituted const params)
 - #127070 (add () to the marker_impls macro for ConstParamTy)
 - #127071 (Remove (deprecated & unstable) {to,from}_bits pointer methods)
 - #127078 (Enable full tools and profiler for LoongArch Linux targets)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-29 05:00:11 +00:00
bors
9ed2ab3790 Auto merge of #127099 - lqd:revert-126938, r=compiler-errors
Revert "miri: make sure we can find link_section statics even for the local crate"

This PR reverts #126938 as [requested by its author](https://github.com/rust-lang/rust/issues/127052#issuecomment-2196793473), to fix the #127052 regression.

Fixes #127052

We should probably improve the [`used` rmake test(s)](57931e5040/tests/run-make/used/rmake.rs (L7)) in the future, but this should do for now.
2024-06-28 23:43:57 +00:00
Michael Goulet
3bc3247200 Move binder and polarity parsing into parse_generic_ty_bound 2024-06-28 19:40:31 -04:00
Tyler Mandry
078d9d8aa9 Rename x86_64-gnu-integration builder to x86_64-fuchsia
This better reflects what the builder actually does.
2024-06-28 16:08:57 -07:00
Tyler Mandry
a8382023b4 Clarify docs 2024-06-28 15:51:32 -07:00
Tyler Mandry
1727e59ad2 Remove wasm target
This should no longer be required to build Fuchsia.
2024-06-28 15:49:02 -07:00
Matthias Krüger
45efd9ca8b remove some amusing but redundant code 2024-06-29 00:48:05 +02:00
Tyler Mandry
1483815aa2 Bump Fuchsia
This includes the quality-of-life improvements for developers in
https://fxrev.dev/1061894.
2024-06-28 15:44:36 -07:00
Rémy Rakic
57931e5040 add non-regression test for issue 127052 2024-06-28 20:59:33 +00:00
Rémy Rakic
224cb3f638 Revert "Rollup merge of #126938 - RalfJung:link_section, r=compiler-errors"
This reverts commit 5c4ede88c6, reversing
changes made to 95332b8918.
2024-06-28 20:59:01 +00:00
Oneirical
4c9eeda36d rewrite used-cdylib-macos to rmake 2024-06-28 16:28:57 -04:00
Oneirical
ec1ed26263 rewrite raw-dylib-cross-compilation to rmake 2024-06-28 16:28:24 -04:00
Oneirical
a4f3e5f725 rewrite and slightly rename issue-68794-textrel-on-minimal-lib 2024-06-28 16:28:24 -04:00
Oneirical
55b581689d rewrite unknown-mod-stdin to rmake 2024-06-28 16:28:24 -04:00
Matthias Krüger
f37272d780
Rollup merge of #127078 - xen0n:more-feat-for-loong-dist, r=Kobzol
Enable full tools and profiler for LoongArch Linux targets

When the LoongArch targets were first introduced, the LLVM support was still immature and various tools were not supported on LoongArch. Nowadays most infra is in place, so it is time to enable them on LoongArch to provide a better experience for users of these targets. Plus, the profiler support is needed by Chromium, so better provide it in the official artifacts.

cc `@heiher`

try-job: dist-loongarch64-linux
try-job: dist-loongarch64-musl
2024-06-28 22:04:20 +02:00
Matthias Krüger
69996b5ac7
Rollup merge of #127071 - Sky9x:remove-ptr-to-from-bits, r=scottmcm
Remove (deprecated & unstable) {to,from}_bits pointer methods

These unstable methods have been deprecated for more than a year (since #95583). Remove them.

See https://github.com/rust-lang/rust/issues/91126#issuecomment-1835796457 and https://github.com/rust-lang/rust/pull/110441/files#r1169574509.

Closes #91126.

r? `@scottmcm`
2024-06-28 22:04:20 +02:00
Matthias Krüger
6499b9c340
Rollup merge of #127070 - Sky9x:unit-const-param-ty, r=BoxyUwU
add () to the marker_impls macro for ConstParamTy

Seems to have escaped bootstrap
2024-06-28 22:04:19 +02:00
Matthias Krüger
5afb4c2b21
Rollup merge of #127068 - compiler-errors:stall-drop, r=BoxyUwU
Stall computing instance for drop shim until it has no unsubstituted const params

Do not inline the drop shim for types that still have unsubstituted const params.

## Why?

#127030 ICEs because it tries to inline the drop shim for a type with an unsubstituted const param. In order to generate this shim, this requires calling the drop shim builder, which invokes the trait solver to compute whether constituent types need drop (since we compute if a type is copy to disqualify any `Drop` behavior):

9c3bc805dd/compiler/rustc_mir_dataflow/src/elaborate_drops.rs (L378)

However, since we don't keep the param-env of the instance we resolved the item for, we use the wrong param-env:
9c3bc805dd/compiler/rustc_mir_transform/src/shim.rs (L278)
(which is the param-env of `std::ptr::drop_in_place`)

This param-env is notably missing `ConstParamHasTy` predicates, and since we removed the type from consts in https://github.com/rust-lang/rust/pull/125958, we literally cannot prove these predicates in this (relatively) empty param-env. This currently happens in places like the MIR inliner, but may happen elsewhere such as in lints that resolve terminators.

## What?

We force the inliner to not consider calls for `drop_in_place` for types that have unsubstituted const params.

## So what?

This may negatively affect MIR inlining, but I doubt this matters in practice, and fixes a beta regression, so let's fix it. I will look into approaches for fixing this in a more maintainable way, perhaps delaying the creation of drop shim bodies until codegen (like how intrinsics work).
2024-06-28 22:04:18 +02:00
Matthias Krüger
afde8485df
Rollup merge of #127055 - shepmaster:hash-finish-must-use, r=dtolnay
Mark Hasher::finish as #[must_use]
2024-06-28 22:04:18 +02:00
Matthias Krüger
93ca5ff900
Rollup merge of #127032 - tgross35:f16-f128-const-eval-cast, r=oli-obk
Enable const casting for `f16` and `f128`

I have an open PR to the Miri repo adding tests for this behavior https://github.com/rust-lang/miri/pull/3688, but that unfortunately hits the ICE path here. The changes seem reasonably low risk that it might be okay to merge separately from the tests, and I tested the result locally against an older version of https://github.com/rust-lang/miri/pull/3688.

Cc ``````@RalfJung``````
2024-06-28 22:04:17 +02:00
Matthias Krüger
84577ad545
Rollup merge of #127029 - xen0n:fix-platform-support-table, r=lqd
Fix Markdown tables in platform-support.md

These table entries have wrong number of columns so the "notes" field is missing from the rendered page. Fix by removing excess empty columns.
2024-06-28 22:04:17 +02:00
Matthias Krüger
ba6fe58095
Rollup merge of #127016 - bvanjoi:fix-126986, r=GuillaumeGomez
docs: check if the disambiguator matches its suffix

Fixes #126986

This PR makes it will not continue resolving when its disambiguator doesn't match the suffix format.
2024-06-28 22:04:16 +02:00
Matthias Krüger
3f560afde5
Rollup merge of #127015 - Urgau:non_local_def-tmp-allow, r=lqd
Switch back `non_local_definitions` lint to allow-by-default

This PR switch back (again) the `non_local_definitions` lint to allow-by-default as T-lang is requesting some (major) changes in the lint inner workings in https://github.com/rust-lang/rust/issues/126768#issuecomment-2192634762.

This PR will need to be beta-backported, as the lint is currently warn-by-default in beta.
2024-06-28 22:04:16 +02:00
Matthias Krüger
26df3146ab
Rollup merge of #124091 - jieyouxu:ast-validation-top-level-docs, r=wesleywiser
Update AST validation module docs

Drive-by doc update for AST validation pass:

- Syntax extensions are replaced by proc macros.
- Add rationale for why AST validation pass need to be run
  post-expansion and why the pass is needed in the first place.

This was discussed during this week's [rustc-dev-guide reading club](https://rust-lang.zulipchat.com/#narrow/stream/196385-t-compiler.2Fwg-rustc-dev-guide), and the rationale was explained by cc ``````@bjorn3.``````
2024-06-28 22:04:15 +02:00
Matthias Krüger
c96c1bdd87
Rollup merge of #123714 - cjgillot:static-fnptr, r=wesleywiser
Add test for fn pointer duplication.

I managed to make it fail when removing provenance checks in GVN.

cc https://github.com/rust-lang/rust/issues/123670

r? ``````@oli-obk``````
2024-06-28 22:04:15 +02:00
bors
e9e6e2e444 Auto merge of #126701 - onur-ozkan:build-lld-if-enabled, r=Kobzol
ignore `llvm::Lld` if lld is not enabled

People are having trouble ([ref. zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/MSVC.20Runtime.20mismatch.20when.20building.20LLD)) when they don't want to build `lld` for their custom distribution tarballs even with `lld = false` in their config.toml. This is because it is not controlled by `lld_enabled` flag. This change ensures that `llvm:Lld` is controlled by lld configuration.

Additionally, `lld = true` is set by default for dist profile, because we have been building it all along and this maintains that behavior.

try-job: x86_64-mingw
2024-06-28 19:52:56 +00:00
bors
c4c0897a26 Auto merge of #127000 - Oneirical:no-test-for-the-wicked, r=Kobzol
Migrate `use-suggestions-rust-2018`, `overwrite-input`, `lto-dylib-dep` and `many-crates-but-no-match` `run-make` tests to rmake

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).
2024-06-28 17:42:05 +00:00
onur-ozkan
17b843bc2c update run-make/windows-safeseh compiletest header
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-28 20:32:31 +03:00
WANG Xuerui
c7ac9bb309
Enable full tools and profiler for dist-loongarch64-{linux,musl}
When the LoongArch targets were first introduced, the LLVM support was
still immature and various tools were not supported on LoongArch.
Nowadays most infra is in place, so it is time to enable them on
LoongArch to provide a better experience for users of these targets.
Plus, the profiler support is needed by Chromium, so better provide it
in the official artifacts.
2024-06-28 23:11:43 +08:00
Michael Goulet
f17b27b301 Don't inline drop shims with unsubstituted generic consts in MIR inliner 2024-06-28 10:18:20 -04:00
Michael Goulet
90c2b238e6 Failing test for computing drop shim that has const param 2024-06-28 10:18:20 -04:00