Commit Graph

278856 Commits

Author SHA1 Message Date
Matthias Krüger
81a464f8a5
Rollup merge of #135623 - marcoieni:mingw-check-tidy-dockerfile, r=Kobzol
ci: use ghcr ubuntu image for mingw-check-tidy
2025-01-19 01:18:54 +01:00
Matthias Krüger
8825073dcc
Rollup merge of #135616 - marcoieni:split-i686-msvc-job, r=Kobzol
CI: split i686-msvc job to two free runners

try-job: i686-msvc-1
try-job: i686-msvc-2
2025-01-19 01:18:53 +01:00
Rémy Rakic
c69dea90d7 add tests for issue 135671 2025-01-18 22:09:35 +00:00
Rémy Rakic
122a55bb44 Revert "Auto merge of #133734 - scottmcm:lower-indexing-to-ptrmetadata, r=davidtwco,RalfJung"
This reverts commit b57d93d8b9, reversing
changes made to 0aeaa5eb22.
2025-01-18 22:09:35 +00:00
Rémy Rakic
9acb9fa57b Revert "Auto merge of #134330 - scottmcm:no-more-rvalue-len, r=matthewjasper"
This reverts commit e108481f74, reversing
changes made to 303e8bd768.
2025-01-18 22:09:34 +00:00
Rémy Rakic
0bb4880581 Revert "Rollup merge of #134371 - scottmcm:fix-134352, r=oli-obk"
This reverts commit 7c301ecdf5, reversing
changes made to dffaad8332.
2025-01-18 22:09:34 +00:00
Rémy Rakic
ca1c17c88d Revert "Auto merge of #134330 - scottmcm:no-more-rvalue-len, r=matthewjasper"
This reverts commit e108481f74, reversing
changes made to 303e8bd768.
2025-01-18 22:09:34 +00:00
Michael Goulet
0e98d9a3f7 Fix comment 2025-01-18 22:03:04 +00:00
Michael Goulet
f3bd95d43c Use par_body_owners in coroutine check 2025-01-18 22:03:04 +00:00
Michael Goulet
bd5f0178bc Rename typeck_with_fallback 2025-01-18 22:03:04 +00:00
Michael Sloan
0257cfb974 then be -> be based on feedback from @ibraheemdev 2025-01-18 14:52:16 -07:00
bors
1d55f7270d Auto merge of #135633 - marcoieni:ci-free-arm-linux, r=Kobzol
ci: switch to linux free arm runners

try-job: aarch64-gnu
try-job: aarch64-gnu-debug
try-job: dist-aarch64-linux
2025-01-18 21:27:25 +00:00
Michael Goulet
b08f3d5bdb Consolidate ad-hoc MIR lints into real pass-manager-based MIR lints 2025-01-18 21:25:47 +00:00
Esteban Küber
e68a8ce035 Provide suggestion for #![feature(default_field_values)]
```
error[E0797]: base expression required after `..`
  --> $DIR/feature-gate-default-field-values.rs:62:21
   |
LL |     let x = Foo { .. };
   |                     ^
   |
help: add `#![feature(default_field_values)]` to the crate attributes to enable default values on `struct` fields
   |
LL + #![feature(default_field_values)]
   |
help: add a base expression here
   |
LL |     let x = Foo { ../* expr */ };
   |                     ++++++++++
```
2025-01-18 21:15:42 +00:00
Esteban Küber
e7ac2eabd0 Deduplicate logic 2025-01-18 21:15:42 +00:00
Esteban Küber
7175da59d3 Structured suggestion for "missing feature intrinsic"
```
error: `size_of_val` is not yet stable as a const intrinsic
  --> $DIR/const-unstable-intrinsic.rs:17:9
   |
LL |         unstable_intrinsic::size_of_val(&x);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: add `#![feature(unstable)]` to the crate attributes to enable
help: add `#![feature(unstable)]` to the crate attributes to enable
   |
LL + #![feature("unstable")]
   |
```
2025-01-18 21:15:37 +00:00
Esteban Küber
a47fee50bd Structured suggestion for "missing feature in unstable fn call"
When encountering a call corresponding to an item marked as unstable behind a feature flag, provide a structured suggestion pointing at where in the crate the `#![feature(..)]` needs to be written.

```
error: `foobar` is not yet stable as a const fn
  --> $DIR/const-stability-attribute-implies-no-feature.rs:12:5
   |
LL |     foobar();
   |     ^^^^^^^^
   |
help: add `#![feature(const_foobar)]` to the crate attributes to enable
   |
LL + #![feature(const_foobar)]
   |
```

Fix #81370.
2025-01-18 21:13:27 +00:00
Esteban Küber
27f079ae24 Disallow A { .. } if A has no fields
```
error: `A` has no fields, `..` needs at least one default field in the struct definition
  --> $DIR/empty-struct.rs:16:17
   |
LL |     let _ = A { .. };
   |             -   ^^
   |             |
   |             this type has no fields
```
2025-01-18 21:05:09 +00:00
Esteban Küber
deef3ebaec Emit a single privacy error for multiple fields on the same struct expression
Collect all unreachable fields in a single struct literal struct and emit a single error, instead of one error per private field.

```
error[E0451]: fields `beta` and `gamma` of struct `Alpha` are private
  --> $DIR/visibility.rs:18:13
   |
LL |     let _x = Alpha {
   |              ----- in this type
LL |         beta: 0,
   |         ^^^^^^^ private field
LL |         ..
   |         ^^ field `gamma` is private
```
2025-01-18 20:33:15 +00:00
Guillaume Gomez
b3865d1832 Remove more CSS classes 2025-01-18 20:29:55 +01:00
Michael Goulet
2a180a93a1 Get rid of ToPolyTraitRef 2025-01-18 18:47:17 +00:00
bors
0493557083 Auto merge of #135682 - matthiaskrgr:rollup-cl7zlt1, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #133700 (const-eval: detect more pointers as definitely not-null)
 - #135290 (Encode constraints that hold at all points as logical edges in location-sensitive polonius)
 - #135478 (Run clippy for rustc_codegen_gcc on CI)
 - #135583 (Move `std::pipe::*` into `std::io`)
 - #135612 (Include x scripts in tarballs)
 - #135624 (ci: mirror buildkit image to ghcr)
 - #135661 (Stabilize `float_next_up_down`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-18 18:40:20 +00:00
Piotr Osiewicz
06f6d8bcbc lsp-server: Drop outgoing messages on background thread
Closes #18961
2025-01-18 17:47:27 +01:00
Laurențiu Nicola
61af2cc09a
Merge pull request #18966 from lnicola/bump-windows-sys
minor: Bump `windows-sys`
2025-01-18 15:59:53 +00:00
Laurențiu Nicola
b8eec1a35e
Merge pull request #18957 from markmurphydev/docs_vscode_syntax_tree
Update syntax tree viewer docs
2025-01-18 15:59:22 +00:00
bors
efc25761e5 Auto merge of #135667 - weihanglo:update-cargo, r=weihanglo
Update cargo

13 commits in 088d496082726091024f1689c124a0c3dccbd775..045bf21b36a2e1f3ed85e38278d1c3cc4305e134
2025-01-10 20:10:21 +0000 to 2025-01-17 14:59:36 +0000
- created a function for user defined aliases (rust-lang/cargo#15076)
- took the functionality of the third party subcommand from the list_commands function (rust-lang/cargo#15075)
- fix: wrong concat and field name (rust-lang/cargo#15074)
- fix(publish): Report all unpublishable packages  (rust-lang/cargo#15070)
- docs(cargo-clippy): correct typo (rust-lang/cargo#15072)
- docs(cargo-package): alwasy include the lockfile (rust-lang/cargo#15067)
- docs(ref): Deprecate 'package.authors'  (rust-lang/cargo#15068)
- fix(build-std): parse as comma-separated list (rust-lang/cargo#15065)
- Fix benchsuite issue with newer versions of git (rust-lang/cargo#15069)
- Document that cargo automatically registers variables used in env! macro to trigger rebuilds (rust-lang/cargo#15062)
- perf(cargo-package): match certain path prefix with pathspec (rust-lang/cargo#14997)
- Clarify note in example (rust-lang/cargo#15054)
- chore(deps): update msrv (3 versions) to v1.82 (rust-lang/cargo#15050)
2025-01-18 15:42:37 +00:00
Matthias Krüger
23fb4f22b3
Rollup merge of #135661 - tgross35:stabilize-float_next_up_down, r=scottmcm
Stabilize `float_next_up_down`

FCP completed at [1].

For `f16` and `f128`, this just removes the gates in comments and doctests.

Closes https://github.com/rust-lang/rust/issues/91399

[1]: https://github.com/rust-lang/rust/issues/91399#issuecomment-2598734570
2025-01-18 13:58:06 +01:00
Matthias Krüger
055368163d
Rollup merge of #135624 - marcoieni:mirror-buildkit-image, r=Kobzol
ci: mirror buildkit image to ghcr
2025-01-18 13:58:05 +01:00
Matthias Krüger
b0d0ec4ca6
Rollup merge of #135612 - onur-ozkan:include-x-scripts-in-tarballs, r=clubby789
Include x scripts in tarballs

Helps to provide 1:1 build experience between git-managed and tarball sources.
2025-01-18 13:58:04 +01:00
Matthias Krüger
508c72b81e
Rollup merge of #135583 - NobodyXu:move-pipe-to-io, r=joshtriplett
Move `std::pipe::*` into `std::io`

Resolve concern from final comment period https://github.com/rust-lang/rust/issues/127154#issuecomment-2590419895
2025-01-18 13:58:03 +01:00
Matthias Krüger
86947bb18a
Rollup merge of #135478 - Kobzol:gcc-clippy, r=onur-ozkan
Run clippy for rustc_codegen_gcc on CI

Requested on [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Run.20clippy.20for.20rustc_codegen_gcc.20in.20the.20Rust.20CI).

Opening as a draft, since it's not clear which rules should be applied to it.

r? `@ghost`
2025-01-18 13:58:02 +01:00
Matthias Krüger
56447d738b
Rollup merge of #135290 - lqd:polonius-next-episode-8, r=jackh726
Encode constraints that hold at all points as logical edges in location-sensitive polonius

Currently, with the full setup in #134980 (but is from #134268), the polonius location-sensitive analysis converts `Locations::All` typeck constraints as edges at all points in the CFG. This was temporary.

There's a FIXME about that already, and this PR implements it: we now use the constraints that hold at all points during traversal instead of eagerly materializing them as physical edges.

Another easy one `@jackh726.`

This fixes the slowness that was happening on the big CFG from the `saturating-float-casts` test (because of its 12M materialized edges) without, AFAICT, simply moving this overhead to traversal: materializing the logical edges is done on-demand.

r? `@jackh726` (no rush either)
2025-01-18 13:58:01 +01:00
Matthias Krüger
b78edd7957
Rollup merge of #133700 - RalfJung:const-non-null, r=lcnr
const-eval: detect more pointers as definitely not-null

This fixes https://github.com/rust-lang/rust/issues/133523 by making the `scalar_may_be_null` check smarter: for instance, an odd offset in any 2-aligned allocation can never be null, even if it is out-of-bounds.

More generally, if an allocation with unknown base address B is aligned to alignment N, and a pointer is at offset X inside that allocation, then we know that `(B + X) mod N = B mod N + X mod N = X mod N`. Since `0 mod N` is definitely 0, if we learn that `X mod N` is *not* 0 we can deduce that `B + X` is not 0.

This is immediately visible on stable, via `ptr.is_null()` (and, more subtly, by not raising a UB error when such a pointer is used somewhere that a non-null pointer is required). Therefore nominating for `@rust-lang/lang.`
2025-01-18 13:58:00 +01:00
bors
8321f00bf4 Auto merge of #135678 - matthiaskrgr:rollup-psuyzpn, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #134455 (cleanup promoteds move check)
 - #135421 (Make tidy warn on unrecognized directives)
 - #135611 (Remove unnecessary assertion for reference error)
 - #135620 (ci: improve github action name)
 - #135639 (new solver: prefer trivial builtin impls)
 - #135654 (add src/librustdoc and src/rustdoc-json-types to RUSTC_IF_UNCHANGED_ALLOWED_PATHS)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-18 12:57:05 +00:00
Lukas Wirth
013130c22c
Merge pull request #18968 from Veykril/push-szvltqqttsyy
fix: `cargo rustc --print` needs `unstable-options`
2025-01-18 11:21:03 +00:00
Zalathar
ea0c86c434 coverage: Add a few more comments to counter creation 2025-01-18 22:14:16 +11:00
Zalathar
6000d5c462 coverage: Remove BcbCounter and BcbExpression
Making these separate types from `CovTerm` and `Expression` was historically
very helpful, but now that most of the counter-creation work is handled by
`node_flow` they are no longer needed.
2025-01-18 22:14:16 +11:00
Zalathar
4170b93cdc coverage: Flatten top-level counter creation into plain functions
- Move `make_bcb_counters` out of `CoverageCounters`
- Split out `make_node_counter_priority_list`
- Flatten `Transcriber` into the function `transcribe_counters`
2025-01-18 22:12:47 +11:00
Lukas Wirth
5f117b4591 fix: cargo rustc --print needs unstable-options 2025-01-18 12:04:57 +01:00
bors
bd62a452f4 Auto merge of #135675 - erickt:fix-fuchsia-sha, r=lqd
Bump Fuchsia integration commit

This advances Fuchsia to a checkout from 2025-01-13, which corresponds to a recent Rust roll, and hopefully avoids #135667, where a repository used by the older version of Rust was accidentally archived and broke checking out the prior version.

try-job: x86_64-fuchsia

cc `@ehuss`
2025-01-18 10:10:37 +00:00
Lukas Wirth
b53b2990cd Extract variable assist triggers less eagerly 2025-01-18 09:52:56 +01:00
Matthias Krüger
e8736955d1
Rollup merge of #135654 - lolbinarycat:bootstrap-135650, r=onur-ozkan
add src/librustdoc and src/rustdoc-json-types to RUSTC_IF_UNCHANGED_ALLOWED_PATHS

fixes https://github.com/rust-lang/rust/issues/135650

r? ``@onur-ozkan``
2025-01-18 09:11:07 +01:00
Matthias Krüger
862a17cd17
Rollup merge of #135639 - lqd:trivial-builtin-impls, r=lcnr
new solver: prefer trivial builtin impls

As discussed [on zulip](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/needs_help.3A.20trivial.20builtin.20impls), this PR:
- adds a new `BuiltinImplSource::Trivial` source, and marks the `Sized` builtin impls as trivial
- prefers these trivial builtin impls in `merge_trait_candidates`

The comments can likely be wordsmithed a bit better, and I ~stole~ was inspired by the old solver ones. Let me know how you want them improved.

When enabling the new solver for tests, 3 UI tests now pass:
- `regions/issue-26448-1.rs` and its sibling `regions/issue-26448-2.rs` were rejected by the new solver but accepted by the old one
- and `issues/issue-42796.rs` where the old solver emitted some overflow errors in addition to the expected error

(For some reason one of these tests is run-pass, but I can take care of that another day)

r? lcnr
2025-01-18 09:11:06 +01:00
Matthias Krüger
80fcf159c9
Rollup merge of #135620 - marcoieni:edit-ghcr-action-name, r=Kobzol
ci: improve github action name
2025-01-18 09:11:06 +01:00
Matthias Krüger
233fd55e6e
Rollup merge of #135611 - chenyukang:yukang-fix-135341-ice-crash, r=oli-obk
Remove unnecessary assertion for reference error

Fixes #135341

From comment: https://github.com/rust-lang/rust/issues/135341#issuecomment-2594430504

r? ``@oli-obk``
2025-01-18 09:11:05 +01:00
Matthias Krüger
8fec08b988
Rollup merge of #135421 - cod10129:warn-tidy-ignore, r=onur-ozkan
Make tidy warn on unrecognized directives

This PR makes it so tidy warns on unrecognized directives, as recommended on [the discussion of #130984](https://github.com/rust-lang/rust/issues/130984#issuecomment-2589284620). This is edited from the previous version of this PR, which only warned on "tidy-ignore" and no other tidy directive typos.

Fixes #130984.

``@rustbot`` label A-tidy C-enhancement
2025-01-18 09:11:04 +01:00
Matthias Krüger
dbc27cac27
Rollup merge of #134455 - lcnr:move-errors-in-promoteds, r=compiler-errors
cleanup promoteds move check

r? types
2025-01-18 09:11:03 +01:00
Ralf Jung
e1dda10057 const-eval: detect more pointers as definitely not-null 2025-01-18 08:51:28 +01:00
Zalathar
48399442d4 coverage: Move phys_counter_for_node into CoverageCounters 2025-01-18 18:51:22 +11:00
Erick Tryzelaar
37a88ba320 Bump Fuchsia integration commit
This advances Fuchsia to a checkout from 2025-01-13, which corresponds
to a recent Rust roll, and hopefully avoids #135667, where a repository
used by the older version of Rust was accidentally archived and broke
checking out the prior version.

try-job: x86_64-fuchsia
2025-01-18 06:13:00 +00:00