Commit Graph

251917 Commits

Author SHA1 Message Date
bohan
889e5719c6 explaining DefKind::Field 2024-04-05 23:12:43 +08:00
bjorn3
fbda869b4e Add a couple more sync impls to mini_core 2024-04-05 15:05:53 +00:00
bjorn3
454c87bdd4 Merge branch 'build_system_changes' 2024-04-05 15:01:30 +00:00
Guillaume Gomez
9cb517aede
Rollup merge of #123496 - lcnr:wf-ping, r=compiler-errors
ping on wf changes, remove fixme

extend core type system pings to `wf.rs`

r? `@compiler-errors`
2024-04-05 16:38:52 +02:00
Guillaume Gomez
b0ca3cd9d4
Rollup merge of #123489 - onur-ozkan:handle-rustc-args-properly, r=clubby789
handle rustc args properly in bootstrap

Because `RUSTFLAGS` gets overwritten during the conversion from `Cargo` to `Command`, the passed rustc args were being lost. This change combines the rustc args with the values that override `RUSTFLAGS`.

Fixes #123228
2024-04-05 16:38:52 +02:00
Guillaume Gomez
0d5ee650f8
Rollup merge of #123474 - jieyouxu:issue-7349-port, r=Mark-Simulacrum
Port `run-make/issue-7349` to a codegen test

The test does not need to be a run-make test, it can use the codegen test infrastructure.

Also took the opportunity to rename the test to `no-redundant-item-monomorphization` so it's not just some opaque issue number.

Part of #121876.
2024-04-05 16:38:51 +02:00
Guillaume Gomez
02ee8a8cee
Rollup merge of #123350 - compiler-errors:async-closure-by-move, r=oli-obk
Actually use the inferred `ClosureKind` from signature inference in coroutine-closures

A follow-up to https://github.com/rust-lang/rust/pull/123349, which fixes another subtle bug: We were not taking into account the async closure kind we infer during closure signature inference.

When I pass a closure directly to an arg like `fn(x: impl async FnOnce())`, that should have the side-effect of artificially restricting the kind of the async closure to `ClosureKind::FnOnce`. We weren't doing this -- that's a quick fix; however, it uncovers a second, more subtle bug with the way that `move`, async closures, and `FnOnce` interact.

Specifically, when we have an async closure like:
```
let x = Struct;
let c = infer_as_fnonce(async move || {
  println!("{x:?}");
}
```

The outer closure captures `x` by move, but the inner coroutine still immutably borrows `x` from the outer closure. Since we've forced the closure to by `async FnOnce()`, we can't actually *do* a self borrow, since the signature of `AsyncFnOnce::call_once` doesn't have a borrowed lifetime. This means that all `async move` closures that are constrained to `FnOnce` will fail borrowck.

We can fix that by detecting this case specifically, and making the *inner* async closure `move` as well. This is always beneficial to closure analysis, since if we have an `async FnOnce()` that's `move`, there's no reason to ever borrow anything, so `move` isn't artificially restrictive.
2024-04-05 16:38:51 +02:00
Guillaume Gomez
f2f8d8b722
Rollup merge of #123311 - Jules-Bertholet:andpat-everywhere, r=Nadrieril
Match ergonomics: implement "`&`pat everywhere"

Implements the eat-two-layers (feature gate `and_pat_everywhere`, all editions) ~and the eat-one-layer (feature gate `and_eat_one_layer_2024`, edition 2024 only, takes priority on that edition when both feature gates are active)~ (EDIT: will be done in later PR) semantics.

cc #123076

r? ``@Nadrieril``

``@rustbot`` label A-patterns A-edition-2024
2024-04-05 16:38:50 +02:00
Guillaume Gomez
c36c009577
Rollup merge of #123149 - jieyouxu:rmake-arguments-non-c-like-enum, r=Mark-Simulacrum
Port argument-non-c-like-enum to Rust

Part of #121876.
2024-04-05 16:38:50 +02:00
Guillaume Gomez
cb6a1c8d45
Rollup merge of #122894 - compiler-errors:downgrade, r=lcnr
Move check for error in impl header outside of reporting

Fixes #121006

r? lcnr

test location kinda sucks, can move it if needed
2024-04-05 16:38:49 +02:00
Guillaume Gomez
8873ca57f8
Rollup merge of #122334 - GuillaumeGomez:vendor-cg_gcc, r=Mark-Simulacrum
Vendor rustc_codegen_gcc

I used https://github.com/rust-lang/rust/pull/115274 as base for this update.

r? `@bjorn3`
2024-04-05 16:38:49 +02:00
bjorn3
1bab6df32b Remove all checks for CI in the build system
And introduce the CG_CLIF_EXPENSIVE_CHECKS env var in the place.
2024-04-05 14:31:12 +00:00
bjorn3
f269cdd805 Move disabling incr comp and denying warnings to the CI config 2024-04-05 13:59:28 +00:00
bjorn3
603b2800f7 Revoke all permissions from GHA workflows where possible 2024-04-05 13:50:21 +00:00
bjorn3
65342df8cd Dedup default shell specification for GHA 2024-04-05 13:49:29 +00:00
bjorn3
91ffd74de4 Simplify GHA CI workflow 2024-04-05 13:49:29 +00:00
bors
5958f5e08f Auto merge of #123317 - RalfJung:test-in-miri, r=m-ou-se,saethlin,onur-ozkan
Support running library tests in Miri

This adds a new bootstrap subcommand `./x.py miri` which can test libraries in Miri. This is in preparation for eventually doing that as part of bors CI, but this PR only adds the infrastructure, and doesn't enable it yet.

`@rust-lang/bootstrap` should this be `x.py test --miri library/core` or `x.py miri library/core`? The flag has the advantage that we don't have to copy all the arguments from `Subcommand::Test`. It has the disadvantage that most test steps just ignore `--miri` and still run tests the regular way. For clippy you went the route of making it a separate subcommand. ~~I went with a flag now as that seemed easier, but I can change this.~~ I made it a new subcommand. Note however that the regular cargo invocation would be `cargo miri test ...`, so `x.py` is still going to be different in that the `test` is omitted. That said, we could also make it `./x.py miri-test` to make that difference smaller -- that's in fact more consistent with the internal name of the command when bootstrap invokes cargo.

`@rust-lang/libs` ~~unfortunately this PR does some unholy things to the `lib.rs` files of our library crates.~~
`@m-ou-se` found a way that entirely avoids library-level hacks, except for some new small `lib.miri.rs` files that hopefully you will never have to touch. There's a new hack in cargo-miri but there it is in good company...
2024-04-05 13:17:09 +00:00
lcnr
6db7ac6233 ping on wf changes, remove fixme 2024-04-05 15:09:48 +02:00
Chris Denton
7d008267dd
Revert #121666
This reverts #121666 due to #123495
2024-04-05 12:50:31 +00:00
bjorn3
40d40fb229 Fix warning in mini_core 2024-04-05 12:25:08 +00:00
bjorn3
737421a25b Rustup to rustc 1.79.0-nightly (385fa9d84 2024-04-04) 2024-04-05 12:15:41 +00:00
bjorn3
5a9940fe3d Sync from rust 385fa9d845 2024-04-05 11:39:51 +00:00
bors
cda7898ba8 Auto merge of #3451 - RalfJung:linux-foreign-items, r=RalfJung
linux/foreign_items: reorder things to make more sense

also remove duplicate socketpair
2024-04-05 11:19:55 +00:00
Ralf Jung
219226fea9 linux/foreign_items: reorder things to make more sense, remove duplicate socketpair 2024-04-05 13:18:26 +02:00
bors
4563f70c3b Auto merge of #122070 - Zoxc:dep-edges-from-previous, r=cjgillot
Encode dep graph edges directly from the previous graph when promoting

This encodes dep graph edges directly from the previous graph when promoting nodes from a previous session, avoiding allocations / copies.

~~Based on https://github.com/rust-lang/rust/pull/122064 and https://github.com/rust-lang/rust/pull/116375.~~

<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check:unchanged</td><td align="right">0.4177s</td><td align="right">0.4072s</td><td align="right">💚  -2.52%</td></tr><tr><td>🟣 <b>hyper</b>:check:unchanged</td><td align="right">0.1430s</td><td align="right">0.1420s</td><td align="right"> -0.69%</td></tr><tr><td>🟣 <b>regex</b>:check:unchanged</td><td align="right">0.3106s</td><td align="right">0.3038s</td><td align="right">💚  -2.19%</td></tr><tr><td>🟣 <b>syn</b>:check:unchanged</td><td align="right">0.5823s</td><td align="right">0.5688s</td><td align="right">💚  -2.33%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check:unchanged</td><td align="right">1.3992s</td><td align="right">1.3692s</td><td align="right">💚  -2.14%</td></tr><tr><td>Total</td><td align="right">2.8528s</td><td align="right">2.7910s</td><td align="right">💚  -2.17%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9803s</td><td align="right">💚  -1.97%</td></tr></table>
2024-04-05 11:11:17 +00:00
Ralf Jung
3ad9c83cd2 miri: go look for the item in all crates of the right name 2024-04-05 11:53:46 +02:00
bors
d009f60b55 Auto merge of #123469 - belovdv:remove-miri-jobserver-fixme, r=petrochenkov
remove miri jobserver workaround

This PR removes workaround, added in #113730, since jobserver is kept after [rust-lang/cargo#12776](https://github.com/rust-lang/cargo/pull/12776)
2024-04-05 09:09:35 +00:00
onur-ozkan
199589d814 handle rustc args properly in bootstrap
Because `RUSTFLAGS` gets overwritten during the conversion from `Cargo` to `Command`,
the passed rustc args were being lost. This change combines the rustc args with the values
that override `RUSTFLAGS`.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-05 11:45:31 +03:00
Chris Copeland
0459e55375
Fix target-cpu fpu features on Armv7-R, Armv7-M, and Armv8-M
This is achieved by converting `+<fpu>,-d32,{,-fp64}` to `+<fpu>d16{,sp}`.

By using a single additive feature that captures `d16` vs `d32` and `sp` vs
`dp`, we prevent `-<feature>` from overriding `-C target-cpu` at build time.

Remove extraneous `-fp16` from `armv7r` targets, as this is not included in
`vfp3` anyway, but was preventing `fp16` from being enabled by e.g.,
`-C target-cpu=cortex-r7`, which does support `fp16`.
2024-04-04 22:10:45 -07:00
bors
c0ddaef075 Auto merge of #123444 - saethlin:const-eval-inline-cycles, r=tmiasko
Teach MIR inliner query cycle avoidance about const_eval_select

Fixes https://github.com/rust-lang/rust/issues/122659

r? tmiasko
2024-04-05 04:34:05 +00:00
Ramon de C Valle
2498a9d464 CFI: Restore typeid_for_instance default behavior
Restore typeid_for_instance default behavior of performing self type
erasure, since it's the most common case and what it does most of the
time. Using concrete self (or not performing self type erasure) is for
assigning a secondary type id, and secondary type ids are only assigned
when they're unique and to methods, and also are only tested for when
methods are used as function pointers.
2024-04-04 21:19:33 -07:00
bors
3d7e88148a Auto merge of #123484 - jhpratt:rollup-usz4e64, r=jhpratt
Rollup of 9 pull requests

Successful merges:

 - #123206 (Require Pointee::Metadata to be Freeze)
 - #123363 (change `NormalizesTo` to fully structurally normalize)
 - #123407 (Default to light theme if JS is enabled but not working)
 - #123417 (Add Description for cargo in rustdoc documentation)
 - #123437 (Manually run `clang-format` on `CoverageMappingWrapper.cpp`)
 - #123454 (hir: Use `ItemLocalId::ZERO` in a couple more places)
 - #123464 (Cleanup: Rename `HAS_PROJECTIONS` to `HAS_ALIASES` etc.)
 - #123477 (do not ICE in `fn forced_ambiguity` if we get an error)
 - #123478 (CFI: Add test for `call_once` addr taken)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-05 02:32:03 +00:00
Jacob Pratt
e8b0c30578
Rollup merge of #123478 - maurer:cfi-call-once-addr-taken, r=compiler-errors
CFI: Add test for `call_once` addr taken

One of the proposed ways to reduce the non-passed argument erasure would cause this test to fail. Adding this now ensures that any attempt to reduce non-passed argument erasure won't make the same mistake.

r? `@compiler-errors`

cc `@rcvalle`
2024-04-04 21:16:59 -04:00
Jacob Pratt
e01d3e0824
Rollup merge of #123477 - lcnr:forced_ambig-no-ice, r=compiler-errors
do not ICE in `fn forced_ambiguity` if we get an error

see the comment. currently causing an ICE in typenum which we've been unable to minimize.

r? `@compiler-errors`
2024-04-04 21:16:58 -04:00
Jacob Pratt
58eb6e5803
Rollup merge of #123464 - fmease:rn-has-proj-to-has-aliases, r=compiler-errors
Cleanup: Rename `HAS_PROJECTIONS` to `HAS_ALIASES` etc.

The name of the bitflag `HAS_PROJECTIONS` and of its corresponding method `has_projections` is quite historical dating back to a time when projections were the only kind of alias type.

I think it's time to update it to clear up any potential confusion for newcomers and to reduce unnecessary friction during contributor onboarding.

r? types
2024-04-04 21:16:58 -04:00
Jacob Pratt
929e0db6a9
Rollup merge of #123454 - petrochenkov:zeroindex2, r=fmease
hir: Use `ItemLocalId::ZERO` in a couple more places

Follow up to https://github.com/rust-lang/rust/pull/123415 and https://github.com/rust-lang/rust/pull/123419.
2024-04-04 21:16:57 -04:00
Jacob Pratt
daef0fd878
Rollup merge of #123437 - Zalathar:clang-format, r=cuviper
Manually run `clang-format` on `CoverageMappingWrapper.cpp`

In the current version of #123409, there are several unrelated changes to `CoverageMappingWrapper.cpp` that seem to be the result of running `clang-format` on that file.

Instead of asking for those changes to be undone, I figure it's easier to just make them myself as a separate PR, since I was vaguely intending to do that at some point anyway.

In a few cases I've strategically added comments to make the grouping of parameters a little nicer, but mostly it doesn't matter much.
2024-04-04 21:16:57 -04:00
Jacob Pratt
50603cbb6d
Rollup merge of #123417 - harryhanYuhao:master, r=GuillaumeGomez
Add Description for cargo in rustdoc documentation

As most people use cargo now, I prioritised the description for cargo in rustdoc documentation.

I also added how to open the generated doc with cargo.

Btw, may I ask how to use `./x tidy`? It says `warning: `tidy` is not installed;`
2024-04-04 21:16:56 -04:00
Jacob Pratt
ac298726af
Rollup merge of #123407 - GuillaumeGomez:js-failed-theme, r=notriddle
Default to light theme if JS is enabled but not working

It doesn't [fix] #123399 but it allows to reduce the problem:

* if JS is completely disabled, then `noscript.css` will be applied
* if JS failed for any reason, then the light theme will be applied (because `noscript.css` won't be applied)

r? `@notriddle`
2024-04-04 21:16:56 -04:00
Jacob Pratt
fcb0e9d07a
Rollup merge of #123363 - lcnr:normalizes-to-zero-to-inf, r=BoxyUwU
change `NormalizesTo` to fully structurally normalize

notes in https://hackmd.io/wZ016dE4QKGIhrOnHLlThQ

need to also update the dev-guide once this PR lands. in short, the setup is now as follows:

`normalizes-to` internally implements one step normalization, applying that normalization to the `goal.predicate.term` causes the projected term to get recursively normalized. With this `normalizes-to` normalizes until the projected term is rigid, meaning that we normalize as many steps necessary, but at least 1.

To handle rigid aliases, we add another candidate only if the 1 to inf step normalization failed. With this `normalizes-to` is now full structural normalization. We can now change `AliasRelate` to simply emit `normalizes-to` goals for the rhs and lhs.

This avoids the concerns from https://github.com/rust-lang/trait-system-refactor-initiative/issues/103 and generally feels cleaner
2024-04-04 21:16:56 -04:00
Jacob Pratt
de2cb0d76c
Rollup merge of #123206 - stepancheg:pointee-metadata-freeze, r=Amanieu
Require Pointee::Metadata to be Freeze

So pointee metadata can be used in anonymous statics.

This is prerequisite for implementing ThinBox without allocation for ZST.

See https://github.com/rust-lang/rust/pull/123184#discussion_r1544627488

r? joboet
2024-04-04 21:16:55 -04:00
bors
9cbaa01599 Auto merge of #123465 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`
2024-04-05 00:30:47 +00:00
Michael Goulet
55e46612c1 Force move async-closures that are FnOnce to make their inner coroutines also move 2024-04-04 19:44:51 -04:00
Michael Goulet
3d9d5d7c96 Actually use the inferred ClosureKind from signature inference in coroutine-closures 2024-04-04 19:44:35 -04:00
y21
5d66521dfe use Lrc instead of the aliased type Arc directly 2024-04-05 00:17:27 +02:00
David Thomas
0989416d21 Remove rt::init allocation for thread name 2024-04-04 23:17:15 +01:00
Matthew Maurer
b53a0f2c9e CFI: Add test for call_once addr taken
One of the proposed ways to reduce the non-passed argument erasure would
cause this test to fail. Adding this now ensures that any attempt to
reduce non-passed argument erasure won't make the same mistake.
2024-04-04 22:06:58 +00:00
lcnr
9444ca354a do not ICE in forced ambiguity if we get an error 2024-04-05 00:04:38 +02:00
Daniel Paoliello
9d7090726d MSVC targets should use COFF as their archive format 2024-04-04 14:56:30 -07:00
Guillaume Gomez
a815b97850 Add regression test to ensure that even if JS is enabled but not working, a theme will still get applied 2024-04-04 23:49:34 +02:00