Commit Graph

258950 Commits

Author SHA1 Message Date
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
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
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
onur-ozkan
56c7eb6135 disable lld if external llvm is used
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-28 11:33:50 +03:00
onur-ozkan
ff9b8c1362 ignore beta/stable channels on rust-lld-by-default test
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-28 11:33:42 +03:00
onur-ozkan
ee76d70db0 add change-tracker entry
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-28 11:33:38 +03:00
onur-ozkan
98854f7d3b add lld = true to default dist profile
Make sure lld is enabled for dist profile unless it is explicitly disabled.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-28 11:33:35 +03:00
bors
99f77a2eda Auto merge of #127076 - matthiaskrgr:rollup-l01gm36, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #124741 (patchable-function-entry: Add unstable compiler flag and attribute)
 - #126470 (make cargo submodule optional)
 - #126956 (core: avoid `extern type`s in formatting infrastructure)
 - #126970 (Simplify `str::clone_into`)
 - #127022 (Support fetching `Attribute` of items.)
 - #127058 (Tighten `fn_decl_span` for async blocks)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-28 07:25:28 +00:00
Matthias Krüger
89a0cfe72a
Rollup merge of #127058 - compiler-errors:tighten-async-spans, r=oli-obk
Tighten `fn_decl_span` for async blocks

Tightens the span of `async {}` blocks in diagnostics, and subsequently async closures and async fns, by actually setting the `fn_decl_span` correctly. This is kinda a follow-up on #125078, but it fixes the problem in a more general way.

I think the diagnostics are significantly improved, since we no longer have a bunch of overlapping spans. I'll point out one caveat where I think the diagnostic may get a bit more confusing, but where I don't think it matters.

r? ````@estebank```` or ````@oli-obk```` or someone else on wg-diag or compiler i dont really care lol
2024-06-28 08:34:10 +02:00
Matthias Krüger
d730f27fc8
Rollup merge of #127022 - adwinwhite:attrs, r=celinval
Support fetching `Attribute` of items.

Fixes [https://github.com/rust-lang/project-stable-mir/issues/83](https://github.com/rust-lang/project-stable-mir/issues/83)

`rustc_ast::ast::Attribute` doesn't impl `Hash` and `Eq`. Thus it cannot be directly used as key of `IndexMap` in `rustc_smir::rustc_smir::Tables` and we cannot define stable `Attribute` as index to `rustc_ast::ast::Attribute` like `Span` and many other stable definitions.

Since an string (or tokens) and its span contain all info about an attribute, I defined a simple `Attribute` struct on stable side.

I choose to fetch attributes via `tcx::get_attrs_by_path()` due to `get_attrs()` is marked as deprecated and `get_attrs_by_name()` cannot handle name of multiple segments like `rustfmt::skip`.

r? `@celinval`
2024-06-28 08:34:09 +02:00
Matthias Krüger
2c228260dc
Rollup merge of #126970 - DaniPopes:simplify-str-clone_into, r=cuviper
Simplify `str::clone_into`

Removes an `unsafe` in favor of just using `String` methods.
2024-06-28 08:34:09 +02:00
Matthias Krüger
c4d0c08925
Rollup merge of #126956 - joboet:fmt_no_extern_ty, r=RalfJung
core: avoid `extern type`s in formatting infrastructure

```@RalfJung``` [said](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Use.20of.20.60extern.20type.60.20in.20formatting.20machinery/near/446552837):

>How attached are y'all to using `extern type` in the formatting machinery?
Seems like this was introduced a [long time ago](34ef8f5441). However, it's also [not really compatible with Stacked Borrows](https://github.com/rust-lang/unsafe-code-guidelines/issues/256), and only works currently because we effectively treat references-to-extern-type almost like raw pointers in Stacked Borrows -- which of course is unsound, it's not how LLVM works. I was planning to make Miri emit a warning when this happens to avoid cases like [this](https://github.com/rust-lang/rust/issues/126814#issuecomment-2183816373) where people use extern type specifically to silence Miri without realizing what happens. but with the formatting machinery using  extern type, this warning would just show up everywhere...
>
> The "proper" way to do this in Stacked Borrows is to use raw pointers (or `NonNull`).

This PR does just that.

r? ```@RalfJung```
2024-06-28 08:34:08 +02:00
Matthias Krüger
d5ab931749
Rollup merge of #126470 - onur-ozkan:optional-cargo-submodule, r=Kobzol
make cargo submodule optional

Right now, we fetch the cargo submodule no matter what, even if the command we are running doesn't need it (e.g., `x build compiler library`). This PR changes that to only fetch the cargo submodule when it's necessary.

For more context, see the zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Why.20is.20cargo.20always.20checked.20out.3F
2024-06-28 08:34:07 +02:00
Matthias Krüger
02629325f6
Rollup merge of #124741 - nebulark:patchable-function-entries-pr, r=estebank,workingjubilee
patchable-function-entry: Add unstable compiler flag and attribute

Tracking issue: #123115

Add the -Z patchable-function-entry compiler flag and the #[patchable_function_entry(prefix_nops = m, entry_nops = n)] attribute.
Rebased and adjusted the canditate implementation to match changes in the RFC.
2024-06-28 08:34:07 +02:00
Adwin White
9387b0bad9 Add method to get all attributes on a definition 2024-06-28 13:24:41 +08:00
Adwin White
84071e2662 Support fetching Attribute of items. 2024-06-28 13:24:41 +08:00
bors
42add88d22 Auto merge of #127010 - GuillaumeGomez:update-puppeteer, r=notriddle
Update browser-ui-test version to `0.18.0`

Should help with #126436.

r? `@notriddle`
2024-06-28 04:15:16 +00:00
Sky
264e8093aa
Remove (deprecated & unstable) {to,from}_bits pointer methods 2024-06-27 23:32:20 -04:00
Sky
8bcd1dede6
add () to the marker_impls macro for ConstParamTy
seems to have escaped bootstrap
2024-06-27 22:37:29 -04:00
bohan
91d3ac7450 add test for #126986 2024-06-28 08:01:07 +08:00
bohan
8d27980325 docs: check if the disambiguator matches its suffix 2024-06-28 07:55:40 +08:00
Florian Schmiderer
8d246b0102 Updated diagnostic messages 2024-06-27 22:24:36 +02:00
Michael Goulet
789ee88bd0 Tighten spans for async blocks 2024-06-27 15:19:08 -04:00
bors
9c3bc805dd Auto merge of #127049 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`
2024-06-27 18:49:32 +00:00
Jake Goulding
448dd30ed4 Mark Hasher::finish as #[must_use] 2024-06-27 14:16:27 -04:00
Philipp Krones
3ce7f9eb0c
Merge commit '68a799aea9b65e2444fbecfe32217ce7d5a3604f' into clippy-subtree-update 2024-06-27 18:56:04 +02:00
bors
68a799aea9 Auto merge of #12999 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2024-06-27 16:51:27 +00:00