Commit graph

258988 commits

Author SHA1 Message Date
Ralf Jung 66a885b25d iter_exported_symbols: also walk used statics in local crate 2024-06-29 12:17:10 +02: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
The Miri Cronjob Bot ec7bcc0357 Merge from rustc 2024-06-29 05:20:59 +00:00
The Miri Cronjob Bot 64c8366ca2 Preparing for merge from rustc 2024-06-29 05:13:25 +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
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
bors c4715893e5 Auto merge of #3718 - RalfJung:readme, r=oli-obk
readme: tweak wording around soundness

Miri *can* tell you whether your code is sound when it finds UB -- it's not sound in that case. It can give negative answers, just not positive ones.
2024-06-28 13:54:02 +00:00
Ralf Jung db243de8be readme: tweak wording around soundness 2024-06-28 14:44:25 +02:00
bors 1a7fce07f8 Auto merge of #3717 - rust-lang:rustup-2024-06-28, r=oli-obk
Automatic Rustup
2024-06-28 08:57:54 +00:00
Oli Scherer afec0abd59 Bless clippy 2024-06-28 08:56:30 +00: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 340b98a480 Auto merge of #3715 - cgettys-microsoft:dev/cgettys/process_id_fixup-01, r=RalfJung
Fix miri.bat to not exit unconditionally

#3703 has a small typo causing it to regress ./miri.bat to not working at all.

This PR fixes it. Tested on Windows 11, with stable toolchain missing as well as installed.
```test
./miri toolchain
error: toolchain 'stable-x86_64-pc-windows-msvc' is not installed
Failed to build miri-script. Is the 'stable' toolchain installed?
```

Closes #3714
2024-06-28 07:55:12 +00:00
bors 9c21872a40 Auto merge of #3716 - cgettys-microsoft:dev/cgettys/process_id_fixup-03, r=RalfJung
Remove GetCurrentProcessId's frame_in_std check

Most of the support required to close #1727 was actually added a while back, in #2215.

However, for some reason, even though the Unix/Linux syscall equivalent has no `frame_in_std()` check, the Windows `GetCurrentProcessId` check did. While the vast majority of use cases use `std::process::id`, there's no particular reason to penalize any Windows code that is no_std or for whatever other reason choses to call the function directly (e.g. via the generated [windows-sys](https://docs.rs/windows-sys/latest/windows_sys/Win32/System/Threading/fn.GetCurrentProcessId.html) method). The emulation should still work fine. Given there's no reason not to, we might as well simplify the code a tiny bit and save that branch / frame check during runtime too.

This PR removes the `frame_in_std` restriction for `GetCurrentProcessId`, and also moves it into the environment related shim section per discussion in https://github.com/rust-lang/miri/issues/1727#issuecomment-2184679952.

Still passes existing tests/pass/getpid.rs test.

Closes #1727 unless we wish to give a dummy value when isolated, which we don't seem to want to do at this time.
2024-06-28 07:31:21 +00: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
The Miri Cronjob Bot 92b837b89b Merge from rustc 2024-06-28 05:20:33 +00:00
The Miri Cronjob Bot b687053ee7 Preparing for merge from rustc 2024-06-28 05:13:00 +00: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
Charlie Gettys e7e35d7d78 Switch to the explicit parens version 2024-06-27 16:30:33 -07:00
Florian Schmiderer 8d246b0102 Updated diagnostic messages 2024-06-27 22:24:36 +02:00
Charlie Gettys 9d69154f56 Relocate GetCurrentProcessId to Environment Related shims, remove unnecessary std frame restriction 2024-06-27 13:23:34 -07:00
Charlie Gettys 5ae2b372b4 Fix miri.bat 2024-06-27 13:00:37 -07: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
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
Philipp Krones 585170ee60
Bump nightly version -> 2024-06-27 2024-06-27 18:50:02 +02:00
Philipp Krones e9e7a815a7
Merge remote-tracking branch 'upstream/master' into rustup 2024-06-27 18:49:59 +02:00
bors 4ddc8a2e4e Auto merge of #12992 - klensy:lintcheck-bump, r=Alexendoo
bump strip-ansi-escapes

This bumps `strip-ansi-escapes` to remove arrayvec from it's deps (https://github.com/luser/strip-ansi-escapes/pull/8)

Should Cargo.lock be commited too to track it's working state?

changelog: none
2024-06-27 16:19:59 +00:00
Oneirical b94eae5877 rewrite many-crates-but-no-match to rmake 2024-06-27 11:17:26 -04:00
bors 249595384b Auto merge of #126861 - GuillaumeGomez:migrate-run-make-invalid-library, r=Kobzol
Migrate `run-make/invalid-library` to `rmake.rs`

Part of #121876.

r? `@jieyouxu`

try-job: x86_64-msvc
2024-06-27 14:37:54 +00:00
bors 036b38ced3 Auto merge of #126993 - petrochenkov:atvisord3, r=BoxyUwU
ast: Standardize visiting order

Order: ID, attributes, inner nodes in source order if possible, tokens, span.

Also always use exhaustive matching in visiting infra, and visit some discovered missing nodes.

Unlike https://github.com/rust-lang/rust/pull/125741 this shouldn't affect anything serious like `macro_rules` scopes.
2024-06-27 12:25:46 +00:00
Guillaume Gomez 3394fe89d8 Add ar command in run-make-support 2024-06-27 14:04:46 +02:00
Guillaume Gomez 449cde32ad Migrate run-make/invalid-library to rmake.rs 2024-06-27 14:04:45 +02:00
Guillaume Gomez 84146b372a Add ar_command in run_make_support 2024-06-27 14:04:01 +02:00
onur-ozkan 3457ecc776 remove unnecessary packages from metadata::workspace_members
Currently bootstrap doesn't use any inner paths from rust-analyzer and
bootstrap with `ShouldRun::create_or_deps`.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-27 14:07:59 +03:00