Commit Graph

267808 Commits

Author SHA1 Message Date
Obei Sideg
041e76b7cd
Add multi-producer, multi-consumer channel (mpmc) 2024-09-30 20:43:51 +03:00
Trevor Gross
eaaa94318b Unpin cc and upgrade to the latest version
`cc` was previously pinned because version 1.1.106 dropped support for
Visual Studio 12 (2013), and we wanted to decouple that from the rest of
the automated updates. As noted in [2], there is no longer anything
indicating we support VS2013, so it should be okay to unpin it.

`cc` 1.1.22 contains a fix that may help improve the high MSVC CI
failure rate [3], so we also have motivation to update to that point.

[1]: https://github.com/rust-lang/rust/issues/129307
[2]: https://github.com/rust-lang/rust/issues/129307#issuecomment-2383749868
[3]: https://github.com/rust-lang/rust/issues/127883
2024-09-30 13:31:42 -04:00
Michael Goulet
7c552d56b2 Also fix first_method_vtable_slot 2024-09-30 13:17:33 -04:00
Michael Goulet
d87e0ca497 Extract trait_refs_are_compatible, make it instantiate binders 2024-09-30 13:17:33 -04:00
Michael Goulet
af3f212453 Instantiate binders in supertrait_vtable_slot 2024-09-30 13:17:33 -04:00
Michael Goulet
cbb5047d35 Relate binders explicitly, do a leak check too 2024-09-30 12:42:29 -04:00
Matthias Krüger
fd67755554
Rollup merge of #131056 - onur-ozkan:cargo-compiler-fingerprint, r=Kobzol
enable compiler fingerprint logs in verbose mode

This provides very useful logs especially when debugging build cache-related stuff.
2024-09-30 18:25:15 +02:00
Matthias Krüger
8502e99217
Rollup merge of #131053 - Urgau:print-check-cfg-doc, r=jieyouxu
Improve `--print=check-cfg` documentation

This PR improves the `--print=check-cfg` documentation by:
 1. switching to a table for better readability
 2. adding a clear indication where the specific check-cfg syntax starts
 3. adding a link to the main `--check-cfg` documentation

`@rustbot` label +F-check-cfg
2024-09-30 18:25:15 +02:00
Matthias Krüger
5df1123b39
Rollup merge of #131038 - onkoe:fix/adt_const_params_leak_118179, r=compiler-errors
Fix `adt_const_params` leaking `{type error}` in error msg

Fixes the confusing diagnostic described in #118179. (users would see `{type error}` in some situations, which is pretty weird)

`adt_const_params` tracking issue: #95174
2024-09-30 18:25:14 +02:00
Matthias Krüger
dc1ccc5264
Rollup merge of #131035 - dingxiangfei2009:tweak-if-let-rescope-lint, r=jieyouxu
Preserve brackets around if-lets and skip while-lets

r? `@jieyouxu`

Tracked by #124085

Fresh out of #129466, we have discovered 9 crates that the lint did not successfully migrate because the span of `if let` includes the surrounding brackets `(..)` like the following, which surprised me a bit.

```rust
if (if let .. { .. } else { .. }) {
// ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// the span somehow includes the surrounding brackets
}
```

There is one crate that failed the migration because some suggestion spans cross the macro expansion boundaries. Surely there is no way to patch them with `match` rewrite. To handle this case, we will instead require all spans to be tested for admissibility as suggestion spans.

Besides, there are 4 false negative cases discovered with desugared-`while let`. We don't need to lint them, because the `else` branch surely contains exactly one statement because the drop order is not changed whatsoever in this case.

```rust
while let Some(value) = droppy().get() {
..
}
// is desugared into
loop {
    if let Some(value) = droppy().get() {
        ..
    } else {
        break;
        // here can be nothing observable in this block
    }
}
```

I believe this is the one and only false positive that I have found. I think we have finally nailed all the corner cases this time.
2024-09-30 18:25:14 +02:00
Matthias Krüger
b6b43af68d
Rollup merge of #131023 - clubby789:doc-item-path, r=notriddle
Copy correct path to clipboard for modules/keywords/primitives

Fixes #131021
2024-09-30 18:25:13 +02:00
bors
63a0bdd562 Auto merge of #130951 - tgross35:cargo-update-bootstrap, r=Kobzol
Bump `cc` and run `cargo update` for bootstrap

Bump `cc` to 1.1.22, which includes a caching fix. Also run `cargo update` which does a minor increment on a few dependencies.
2024-09-30 16:19:00 +00:00
Michael Goulet
eb75d20a55 Relax a debug assertion in codegen 2024-09-30 12:18:02 -04:00
Ding Xiang Fei
ed5443fcdf
apply suggestions 2024-09-30 22:21:45 +08:00
bors
c3ce4e66a5 Auto merge of #131063 - matthiaskrgr:rollup-hfs3fo1, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #130895 (make type-check-4 asm tests about non-const expressions)
 - #131057 (Reject leading unsafe in `cfg!(...)` and `--check-cfg`)
 - #131060 (Drop conditionally applied cargo `-Zon-broken-pipe=kill` flags to fix stage 1 cargo rebuilds)
 - #131061 (replace manual verbose checks with `Config::is_verbose`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-30 13:33:35 +00:00
Matthias Krüger
5ba81d723a
Rollup merge of #131061 - onur-ozkan:verbose-checks, r=Kobzol
replace manual verbose checks with `Config::is_verbose`

self-explanatory
2024-09-30 14:33:48 +02:00
Matthias Krüger
d97c661155
Rollup merge of #131060 - jieyouxu:rmake-rebuild, r=onur-ozkan
Drop conditionally applied cargo `-Zon-broken-pipe=kill` flags to fix stage 1 cargo rebuilds

The conditionally applied `-Zon-broken-pipe=kill` flag trigger rebuilds because they can invalidate previous tool build cache due to differing flags. This PR removes those flags to stop tool build cache invalidation.

> The build cache for clippy will be broken because bootstrap sets `-Zon-broken-pipe=kill` for every invocation except for cargo. Which means building cargo will invalidate any tool build cache which was built previously.
>
> *From <https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Modifying.20run-make.20tests.20unnecessarily.20rebuild.20stage.201.20cargo/near/473486972>*

Fixes #130980.
But introduces #131059 (breaks 2 cargo tests that relied upon some behavior related to `-Zon-broken-pipe=kill` being set).

r? `@onur-ozkan` (or bootstrap)
2024-09-30 14:33:47 +02:00
Matthias Krüger
90fdb11f51
Rollup merge of #131057 - Urgau:cfg-erronous-unsafe, r=jieyouxu
Reject leading unsafe in `cfg!(...)` and `--check-cfg`

This PR reject leading unsafe in `cfg!(...)` and `--check-cfg`.

Fixes (after-backport) https://github.com/rust-lang/rust/issues/131055
r? `@jieyouxu`
2024-09-30 14:33:46 +02:00
Matthias Krüger
fd2785f67a
Rollup merge of #130895 - RalfJung:asm-tests, r=nnethercote
make type-check-4 asm tests about non-const expressions

These tests recently got changed in https://github.com/rust-lang/rust/pull/129759. I asked the PR author to make the tests read from a `static mut` (rather than just making them "pass"), but I now think that was a mistake: previously the tests failed because the const was not a valid const expression, after the PR they failed because the const failed to evaluate.

So this PR restores the tests to "fail because the const is not a valid const expression". That can be done in a target-independent way so I unified the x86 and aarch64 tests into one.

Cc `@oli-obk` as the original [author](0d88631059) of these tests -- not sure if you still remember what they were intended to test.
2024-09-30 14:33:46 +02:00
Ralf Jung
ac2e318034 make type-check-4 asm tests about non-const expressions 2024-09-30 13:47:36 +02:00
onur-ozkan
fd1429a56b replace manual verbose checks with Config::is_verbose
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-30 14:20:12 +03:00
许杰友 Jieyou Xu (Joe)
5a7058c5a5 Drop conditionally applied cargo -Zon-broken-pipe=kill flags
These conditionally applied flags trigger rebuilds because they can
invalidate previous cargo build cache.
2024-09-30 19:09:29 +08:00
bors
b529e278bb Auto merge of #131044 - EnzymeAD:enzyme-testinfra, r=jieyouxu
add has_enzyme/needs-enzyme to the test infra

This unblocks merging the Enzyme / Autodiff frontend.
For the full implementation, see: https://github.com/rust-lang/rust/pull/129175

We don't want to run tests that require Enzyme / Autodiff support when we build rustc without the required features.

It correctly filtered out a test which started with `//@ needs-enzyme`.
```
running 80 tests
i...............................................................................

test result: ok. 79 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 380.41ms
```

Tracking:

- https://github.com/rust-lang/rust/issues/124509

r? jieyouxu
2024-09-30 10:54:45 +00:00
Urgau
9cb540a13c Reject leading unsafe in cfg!(...) and --check-cfg. 2024-09-30 12:15:08 +02:00
onur-ozkan
874d55cea8 enable compiler fingerprint logs in verbose mode
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-30 13:14:05 +03:00
Urgau
020bd6d323 Improve --print=check-cfg documentation 2024-09-30 11:15:05 +02:00
lcnr
15ac698393 canonicalizer: rm region uniquification, add caching 2024-09-30 10:18:27 +02:00
bors
0245b0ca1e Auto merge of #131009 - klensy:wu, r=Kobzol
weekly update: add header to compiler deps update

Look at #131000: library and rustbook have nice headers for deps updates (i.e. `library dependencies:`), but not compiler one. Fixes this.
2024-09-30 07:28:48 +00:00
Ralf Jung
4b8a5bd511 panic when an interpreter error gets unintentionally discarded 2024-09-30 08:37:00 +02:00
Barrett Ray
c5598d6a9e fix(hir_analysis/wfcheck): don't leak {type error}
avoid `{type error}` being leaked in user-facing messages,
particularly when using the `adt_const_params` feature
2024-09-29 23:40:43 -05:00
bors
e9df22f51d Auto merge of #131036 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2024-09-30 03:16:29 +00:00
bors
4e91cedaed Auto merge of #129499 - fee1-dead-contrib:supereffects, r=compiler-errors
properly elaborate effects implied bounds for super traits

Summary: This PR makes it so that we elaborate `<T as Tr>::Fx: EffectsCompat<somebool>` into `<T as SuperTr>::Fx: EffectsCompat<somebool>` when we know that `trait Tr: ~const SuperTr`.

Some discussion at https://github.com/rust-lang/project-const-traits/issues/2.

r? project-const-traits
`@rust-lang/project-const-traits:` how do we feel about this approach?
2024-09-30 00:30:09 +00:00
Manuel Drehwald
bc2a913a9b add has_enzyme/needs-enzyme to the test infra 2024-09-29 18:27:33 -04:00
Samuel Moelius
54e4761d05 Address review comment
https://github.com/rust-lang/rust-clippy/pull/13286#discussion_r1780038602
2024-09-29 18:21:47 -04:00
bors
0d6e130196 Auto merge of #131002 - steffahn:rustdoc-long-names-fix, r=notriddle
In redesigned rustdoc toolbar: Adjust spacings and sizing to improve behavior with over-long names

Fixes #130993.

Some additional adjustments also fix more issues I’ve noticed such as:

* on small screens, opening search made the 3 bottons move down very slightly (because the row with the crate picker got larger, enlarging the whole grid), this is fixed with a `min-height: 60px` on the toolbar
* with long names in the “breadcrumps” area, wrapping was very broken
  * ![Screenshot_20240929_031831](https://github.com/user-attachments/assets/6f46bbb7-004b-4606-bf17-8a6f3289a8f7)
  * fixed:
  * ![Screenshot_20240929_035312](https://github.com/user-attachments/assets/4e2f8dd2-043e-4279-b588-0a72c7533f8e)
* the left grid area has a minimal width (105px); like before, that leaves about enough space for crate names becoming as short as “all cra…”;
    to save even more space, there’s support for a little bit of extra squeezing of the buttons
  * ![Screenshot_20240929_034511](https://github.com/user-attachments/assets/7c6788ee-8ec1-4a38-b341-8d67704f5575)
  * ![Screenshot_20240929_034525](https://github.com/user-attachments/assets/e141756d-37a9-4205-bc4d-235ddd1c0609)
  * ![Screenshot_20240929_034535](https://github.com/user-attachments/assets/526447f3-48b6-47aa-8a60-e5b0d4d055f0)

I’m really not super good with HTML or CSS stuff at all; there seem to be many magical numbers already, I’ve just used `px` values until things look right, I hope that’s okay 🤷‍♂️

r? `@GuillaumeGomez`

cc `@notriddle`
2024-09-29 22:04:32 +00:00
bors
061004aa01 Auto merge of #13469 - nyurik:apply-ref-option, r=llogiq
Convert `&Option<T>` to `Option<&T>`

Run `ref_option` (#13336) on the Clippy's own code, quiet a few hits. Per mentioned video, this may actually improve performance as well.  Switch lint to `pedantic`

----

changelog: [`ref_option`]: upgrade lint to `pedantic`
2024-09-29 21:34:13 +00:00
Ralf Jung
8c0adc6716 update lockfile 2024-09-29 23:08:25 +02:00
Ding Xiang Fei
6d1a25ad7e
preserve brackets around if-lets and skip while-lets 2024-09-30 04:21:10 +08:00
bors
e239d0794c Auto merge of #3927 - RalfJung:fmt-imports, r=oli-obk,saethlin
let rustfmt format imports

This matches the recent change in rustc.

`@rust-lang/miri` what do you think?
2024-09-29 20:10:23 +00:00
clubby789
5726000b2d Copy correct path to clipboard for modules/keywords/primitives 2024-09-29 19:43:09 +00:00
bors
7608018cbd Auto merge of #131029 - matthiaskrgr:rollup-rh66wir, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #123932 (restate GlobalAlloc method safety preconditions in terms of what the caller has to do for greater clarity)
 - #129003 (Improve Ord docs)
 - #130972 (stabilize const_cell_into_inner)
 - #130990 (try to get rid of mir::Const::normalize)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-29 19:40:50 +00:00
Asuna
762a91b40e Simplify negative Option::{is_some_and,is_none_or} 2024-09-30 03:36:41 +08:00
Matthias Krüger
a0ae32d6a2
Rollup merge of #130990 - RalfJung:mir-const-normalize, r=compiler-errors
try to get rid of mir::Const::normalize

It was easy to make this compile, let's see if anything breaks...

r? `@compiler-errors`
2024-09-29 20:17:37 +02:00
Matthias Krüger
a061e566a6
Rollup merge of #130972 - RalfJung:const_cell_into_inner, r=dtolnay
stabilize const_cell_into_inner

This const-stabilizes
- `UnsafeCell::into_inner`
- `Cell::into_inner`
- `RefCell::into_inner`
- `OnceCell::into_inner`

`@rust-lang/wg-const-eval` this uses `rustc_allow_const_fn_unstable(const_precise_live_drops)`, so we'd be comitting to always finding *some* way to accept this code. IMO that's fine -- what these functions do is to move out the only field of a struct, and that struct has no destructor itself. The field's destructor does not get run as it gets returned to the caller.

`@rust-lang/libs-api` this was FCP'd already [years ago](https://github.com/rust-lang/rust/issues/78729#issuecomment-811409860), except that  `OnceCell::into_inner` was added to the same feature gate since then (Cc `@tgross35).` Does that mean we have to re-run the FCP? If yes, I'd honestly prefer to move `OnceCell` into its own feature gate to not risk missing the next release. (That's why it's not great to add new functions to an already FCP'd feature gate.) OTOH if this needs an FCP either way since the previous FCP was so long ago, then we might as well do it all at once.
2024-09-29 20:17:36 +02:00
Matthias Krüger
c1e54cfa40
Rollup merge of #129003 - Voultapher:improve-ord-docs, r=workingjubilee
Improve Ord docs

- Makes wording more clear and re-structures some sections that can be overwhelming for someone not already in the know.
- Adds examples of how *not* to implement Ord, inspired by various anti-patterns found in real world code.

Many of the wording changes are inspired directly by my personal experience of being confused by the `Ord` docs and seeing other people get it wrong as well, especially lately having looked at a number of `Ord` implementations as part of #128899.

Created with help by `@orlp.`

r​? `@workingjubilee`
2024-09-29 20:17:36 +02:00
Matthias Krüger
1d45203779
Rollup merge of #123932 - adamse:global-alloc-safety-preconds-positive, r=tgross35
restate GlobalAlloc method safety preconditions in terms of what the caller has to do for greater clarity
2024-09-29 20:17:35 +02:00
Ralf Jung
ad8a5ce4ca let rustfmt format imports 2024-09-29 19:26:32 +02:00
Michael Howell
c27b54ac4a rustdoc-gui: fix test cases 2024-09-29 10:02:06 -07:00
Ralf Jung
7caf2cdc2c interpret: always enable write_immediate sanity checks 2024-09-29 18:18:33 +02:00
Michael Goulet
486440fc74 Tweak comments and remove trivial return 2024-09-29 11:57:35 -04:00