1
Fork 0
Commit graph

259340 commits

Author SHA1 Message Date
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
Kornel
4061fd9e4e Reduce merge conflicts from rustfmt's wrapping 2024-06-28 18:15:12 +01:00
Deadbeef
65a0bee0b7 address review comments 2024-06-28 15:44:20 +00:00
Oneirical
133b47ab38 rewrite emit-stack-sizes to rmake 2024-06-28 11:18:46 -04:00
Oneirical
cb1281b76d rewrite debug-assertions to rmake 2024-06-28 11:18:46 -04:00
Oneirical
acb6078d91 rewrite remap-path-prefix to rmake 2024-06-28 11:18:46 -04: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
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
bjorn3
e97cebb2b1 Use dyn Module instead of impl Module where possible 2024-06-28 11:51:17 +00:00
bjorn3
cc05efe29e Introduce UnwindModule wrapper around a Module and UnwindContext
This way all UnwindContext::add_function calls can be done automatically
in a single place.
2024-06-28 11:51:00 +00:00
Deadbeef
8b2fac9612 finishing touches, move fixed ICEs to ui tests 2024-06-28 10:57:35 +00:00
Deadbeef
0a2330630d general fixups and turn TODOs into FIXMEs 2024-06-28 10:57:35 +00:00
Deadbeef
373e906296 bless UI tests 2024-06-28 10:57:35 +00:00
Deadbeef
f852a2c173 Implement Self::Effects: Compat<HOST> desugaring 2024-06-28 10:57:35 +00:00
Deadbeef
b9886c6872 bless tests part 1 2024-06-28 10:57:35 +00:00
Deadbeef
74e7b5bd76 temporarily disable effects on specialization tests 2024-06-28 10:57:35 +00:00
Deadbeef
3637b153f7 move desugaring to item bounds 2024-06-28 10:57:35 +00:00
Deadbeef
c7d27a15d0 Implement Min trait in new solver 2024-06-28 10:57:35 +00:00
Deadbeef
72e8244e64 implement new effects desugaring 2024-06-28 10:57:35 +00:00
Jakub Beránek
2ebfccecd0
Migrate more Command usages to BootstrapCmd 2024-06-28 12:44:17 +02:00
Jakub Beránek
bed2cbd2ce
Get rid of Deref/DerefMut impl for BootstrapCmd 2024-06-28 12:43:31 +02:00
Jakub Beránek
83d33c2cf5
Migrate a few command usages to BootstrapCommand 2024-06-28 12:43:13 +02:00
Jakub Beránek
8a890cb6cb
Migrate a few command usages to BootstrapCommand 2024-06-28 12:43:12 +02:00
Jakub Beránek
f7d9543338
Migrate cargo_clippy_cmd and cargo_miri_cmd to BootstrapCommand 2024-06-28 12:42:52 +02:00
Jakub Beránek
86b2191460
Migrate some usage of Command to BootstrapCmd 2024-06-28 12:42:52 +02:00
Jakub Beránek
2a9d5ab849
Make it easier to migrate Command to BootstrapCmd
By allowing `run` to receive all of `BootstrapCmd`, `&mut BootstrapCmd`, `Command` and `&mut Command`.
2024-06-28 12:42:52 +02:00
Jakub Beránek
3722fb5d9f
Store Command directly inside BootstrapCommand
This will make it easier to migrate existing commands to bootstrap command.
2024-06-28 12:42:52 +02:00
Jakub Beránek
31911e5ccf
Improve documentation of BootstrapCommand 2024-06-28 12:42:52 +02:00
Jakub Beránek
cf5bbb3a08
Remove run and rename run_tracked to run 2024-06-28 12:42:52 +02:00
Jakub Beránek
903d6a9d89
Remove run_cmd 2024-06-28 12:42:52 +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
joboet
65aea99daf
std: add safety comments 2024-06-28 10:44:26 +02: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
John Paul Adrian Glaubitz
ab1b48ef2a 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-28 10:26:45 +02: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