Commit Graph

278450 Commits

Author SHA1 Message Date
Matthias Krüger
e28e2b801e
Rollup merge of #135705 - compiler-errors:lint, r=estebank
Consolidate ad-hoc MIR lints into real pass-manager-based MIR lints

It feels much cleaner to do all MIR-related things using the pass manager.
2025-01-19 01:22:38 +01:00
Matthias Krüger
7e1ce54b22
Rollup merge of #135703 - estebank:empty-dfv, r=compiler-errors
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-19 01:22:37 +01:00
Matthias Krüger
85b69bf753
Rollup merge of #135641 - GuillaumeGomez:items-list, r=notriddle
[rustdoc] Replace module list items `ul`/`li` with `dl`/`dd`/`dt` elements

`@hywan` suggested that rustdoc should use `dl`,`dt` and `dd` HTML tags for listing items on module pages as it matches better what this is (an item and optionally its description). This is a very good idea so here is the implementation.

Also nice side-effect of this change: it reduces a bit the generated HTML since we go from:

This PR shouldn't impact page appearance.

```html
<ul class="item-table">
  <li>
    <div class="item-name">NAME</div>
    <div class="desc docblock-short">THE DOC</div>
  </li>
</ul>
```

to:

```html
<dl class="item-table">
  <dt>NAME</dt>
  <dd>THE DOC</dd>
</dl>
```

You can test it [here](https://rustdoc.crud.net/imperio/items-list/std/index.html).

r? `@notriddle`
2025-01-19 01:22:36 +01: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
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
Guillaume Gomez
b3865d1832 Remove more CSS classes 2025-01-18 20:29:55 +01: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
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
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
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
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
Weihang Lo
deb35b000e
Update cargo 2025-01-17 22:37:03 -05:00
bors
8e59cf95d5 Auto merge of #135618 - lcnr:coherence-unknown, r=compiler-errors
add cache to `AmbiguityCausesVisitor`

fixes #135457, alternative to #135524.

cc https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/new-solver.20hang.20.23135457

r? `@compiler-errors`
2025-01-18 00:06:27 +00:00
Trevor Gross
809f61a783 Add references to the IEEE functions for float_next_up_down
Mention the IEEE function by name and create a doc alias of the same.
2025-01-17 23:01:23 +00:00
Trevor Gross
366cecacdd Stabilize float_next_up_down
FCP completed at [1].

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

[1]: https://github.com/rust-lang/rust/issues/91399#issuecomment-2598734570
2025-01-17 23:01:10 +00:00
Guillaume Gomez
3c62ccdff5 Update rustdoc tests 2025-01-17 22:36:49 +01:00
Guillaume Gomez
42f9c79776 Handle reexports items list a bit differently since they cannot have documentation 2025-01-17 22:36:48 +01:00
Guillaume Gomez
b6ad420a20 Replace ul/li list with dl/dd/dt elements 2025-01-17 22:36:48 +01:00
bors
6067b36314 Auto merge of #135329 - oli-obk:push-sytltwnzxlrq, r=Noratrieb
Stable Hash: Ignore all HirIds that just identify the node itself

This should provide better incremental caching, but it seems there is more to it.

These IDs also serve no purpose being in the stable hash of the item they refer to, only when referring to *another* item is it important that we hash the `HirId`. So we can at least avoid the cost during stable hashing, even if we don't benefit from it by avoiding some queries' caches from being invalidated

Unsure how to make sure we do this right by construction. Would be nice to do something type based
2025-01-17 20:53:15 +00:00
binarycat
d58540df44 add src/librustdoc and src/rustdoc-json-types to RUSTC_IF_UNCHANGED_ALLOWED_PATHS
fixes https://github.com/rust-lang/rust/issues/135650
2025-01-17 14:31:24 -06:00
Rémy Rakic
00844be421 new solver: prefer trivial builtin impls over where-clauses
for now, only builtin `Sized` impls are tracked as being `Trivial`
2025-01-17 18:50:29 +00:00
MarcoIeni
0e80d78709
ci: switch to linux free arm runners 2025-01-17 16:38:10 +01:00
bors
bcd0683e5d Auto merge of #135534 - folkertdev:fix-wasm-i128-f128, r=tgross35
use indirect return for `i128` and `f128` on wasm32

fixes #135532

Based on https://github.com/WebAssembly/tool-conventions/blob/main/BasicCABI.md we now use an indirect return for  `i128`, `u128` and `f128`. That is what LLVM ended up doing anyway.

r? `@bjorn3`
2025-01-17 15:07:28 +00:00
Jiahao XU
2af4197f42
Fix use of pipe in tests/run-make/broken-pipe-no-ice/rmake.rs
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2025-01-18 01:39:01 +11:00
Jiahao XU
81d70f92ab
Fix import of pipe in kernel_copy.rs
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2025-01-18 00:44:44 +11:00
lcnr
0910173b35 add test 2025-01-17 13:23:25 +01:00
MarcoIeni
5f495153f0
ci: mirror buildkit image to ghcr 2025-01-17 12:59:48 +01:00
Rémy Rakic
dee52a3178 encode Locations::All typeck constraints as logical edges
Instead of materializing `Locations::All` constraints as physical edges
at all the points in the CFG, we record them as logical edges and only
materialize them during traversal as successors for a given node.

This fixes the slowness/hang in the `saturating-float-casts.rs` test.
2025-01-17 11:52:58 +00:00
Rémy Rakic
0114a9707e make LocalizedConstraintGraph a struct and not an alias
this prepares the code structure for adding logical edges to the graph next
2025-01-17 11:52:58 +00:00
MarcoIeni
5d07ee860f
ci: improve github action name 2025-01-17 11:41:40 +01:00
bors
73c0ae6aec Auto merge of #135615 - matthiaskrgr:rollup-ra7vftt, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #131806 (Treat other items as functions for the purpose of type-based search)
 - #134980 (Location-sensitive polonius prototype: endgame)
 - #135558 (Detect if-else chains with a missing final else in type errors)
 - #135594 (fix error for when results in a rustdoc-js test are in the wrong order)
 - #135601 (Fix suggestion to convert dereference of raw pointer to ref)
 - #135604 (Expand docs for `E0207` with additional example)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-17 09:03:22 +00:00
lcnr
94bf8f04f4 add cache to AmbiguityCausesVisitor 2025-01-17 10:01:45 +01:00
onur-ozkan
fdf4924a26 include x and x.ps1 scripts in tarball sources
Helps to provide 1:1 build experience between git-managed and tarball sources.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-17 11:37:10 +03:00
onur-ozkan
7874ba2f40 add tidy check on dist src files order
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-17 11:20:13 +03:00
Matthias Krüger
1360e76329
Rollup merge of #135604 - estebank:docs-e0207, r=jieyouxu
Expand docs for `E0207` with additional example

Add an example to E0207 docs showing how to tie the lifetime of the self type to an associated type in an impl when the trait *doesn't* have a lifetime to begin with.

CC #135589.
2025-01-17 09:11:20 +01:00