1
Fork 0
Commit graph

278614 commits

Author SHA1 Message Date
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
Zalathar
a14c35c507 coverage: Remove the Site enum now that we only instrument nodes 2025-01-18 17:12:18 +11:00
Weihang Lo
deb35b000e
Update cargo 2025-01-17 22:37:03 -05:00
Esteban Küber
bbcf26fc33 Add context on private fields that are not on the same line as the struct name
```
error[E0451]: field `x` of struct `S` is private
  --> $DIR/visibility.rs:24:9
   |
LL |     let a = baz::S {
   |             ------ in this type
LL |         ..
   |         ^^ field `x` is private
```
2025-01-18 01:56:22 +00:00
Frank King
067cac91f9 Fix ICE in resolving associated items as non-bindings 2025-01-18 08:38:50 +08:00
Esteban Küber
3e99055c40 Add test for construction of struct with private field with default value
```
error[E0451]: field `beta` of struct `Alpha` is private
  --> $DIR/visibility.rs:11:37
   |
LL |         let x = crate::foo::Alpha { .. };
   |                                     ^^ field `beta` is private
```
2025-01-18 00:30:50 +00: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
Jens Reidel
dfb816208a
Drop MIPS glibc 2.23 patches that reside in crosstool-ng now
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-01-17 18:34:45 +01: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
ffc7b5dc20
ci: use ghcr ubuntu image for mingw-check-tidy 2025-01-17 13:14:51 +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
MarcoIeni
de89ffc341
CI: split i686-msvc job to two free runners 2025-01-17 09:22:10 +01: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
Matthias Krüger
82804078d8
Rollup merge of #135601 - samueltardieu:push-xslotxrnooym, r=jieyouxu
Fix suggestion to convert dereference of raw pointer to ref

Fix #135580
2025-01-17 09:11:19 +01:00
Matthias Krüger
231057cebf
Rollup merge of #135594 - lolbinarycat:tester.js-order-error, r=notriddle
fix error for when results in a rustdoc-js test are in the wrong order

see https://github.com/rust-lang/rust/pull/131806#issuecomment-2596305614
2025-01-17 09:11:19 +01:00
Matthias Krüger
c43893005e
Rollup merge of #135558 - estebank:issue-133316, r=chenyukang
Detect if-else chains with a missing final else in type errors

```
error[E0308]: `if` and `else` have incompatible types
  --> $DIR/if-else-chain-missing-else.rs:12:12
   |
LL |        let x = if let Ok(x) = res {
   |  ______________-
LL | |          x
   | |          - expected because of this
LL | |      } else if let Err(e) = res {
   | | ____________^
LL | ||         return Err(e);
LL | ||     };
   | ||     ^
   | ||_____|
   |  |_____`if` and `else` have incompatible types
   |        expected `i32`, found `()`
   |
   = note: `if` expressions without `else` evaluate to `()`
   = note: consider adding an `else` block that evaluates to the expected type
```

We probably want a longer explanation and fewer spans on this case.

Partially address #133316.
2025-01-17 09:11:18 +01:00
Matthias Krüger
dbdfa7914c
Rollup merge of #134980 - lqd:polonius-next-episode-7, r=jackh726
Location-sensitive polonius prototype: endgame

This PR sets up the naive location-sensitive analysis end-to-end, and replaces the location-insensitive analysis. It's roughly all the in-progress work I wanted to land for the prototype, modulo cleanups I still want to do after the holidays, or the polonius debugger, and so on.

Here, we traverse the localized constraint graph, have to deal with kills and time-traveling (👌), and record that as loan liveness for the existing scope and active loans computations.

Then the near future looks like this, especially if the 2025h1 project goal is accepted:
- gradually bringing it up to completion
- analyzing and fixing the few remaining test failures
- going over the *numerous* fixmes in this prototype (one of which is similar to a hang on one test's millions and millions of constraints)
- trying to see how to lower the impact of the lack of NLL liveness optimization on diagnostics, and their categorization of local variables and temporaries (the vast majority of blessed expectations differences), as well as the couple ICEs trying to find an NLL constraint to blame for errors.
- dealing with the theoretical weakness around kills, conflating reachability for the two TCS, etc that is described ad nauseam in the code.
- switching the compare mode to the in-tree implementation, and blessing the diagnostics
- apart from the hang, it's not catastrophically slower on our test suite, so then we can try to enable it on CI
- checking crater, maybe trying to make it faster :3, etc.

I've tried to gradually introduce this PR's work over 4 commits, because it's kind of subtle/annoying, and Niko/I are not completely convinced yet. That one comment explaining the situation is maybe 30% of the PR 😓. Who knew that spacetime reachability and time-traveling could be mind bending.

I kinda found this late and the impact on this part of the computation was a bit unexpected to us. A bit more care/thought will be needed here. I've described my plan in the comments though. In any case, I believe we have the current implementation is a conservative approximation that shouldn't result in unsoundness but false positives at worst. So it feels fine for now.

r? ``@jackh726``

---

Fixes #127628 -- which was a assertion triggered for a difference in loan computation between NLLs and the location-insensitive analysis. That doesn't exist anymore so I've removed this crash test.
2025-01-17 09:11:17 +01:00
Matthias Krüger
e2d14ec701
Rollup merge of #131806 - lolbinarycat:rustdoc-search-all-is-func, r=notriddle
Treat other items as functions for the purpose of type-based search

specifically, constants and statics are nullary functions, and struct fields are unary functions.

fixes #130204

r? ``@notriddle``
2025-01-17 09:11:17 +01:00
yukang
865a09d50a remove unnecessary assertion for reference error 2025-01-17 15:41:05 +08:00
bors
0c2c096e1a Auto merge of #135047 - Flakebi:amdgpu-kernel-cc, r=workingjubilee
Add gpu-kernel calling convention

The amdgpu-kernel calling convention was reverted in commit f6b21e90d1 (#120495 and https://github.com/rust-lang/rust-analyzer/pull/16463) due to inactivity in the amdgpu target.

Introduce a `gpu-kernel` calling convention that translates to `ptx_kernel` or `amdgpu_kernel`, depending on the target that rust compiles for.

Tracking issue: #135467
amdgpu target tracking issue: #135024
2025-01-17 04:36:09 +00:00
bors
bb3fa4b48e Auto merge of #135605 - jieyouxu:temp-require-force-rustdoc-js, r=clubby789
bootstrap: still require `COMPILETEST_FORCE_STAGE0` for `./x test rustdoc-js --stage 0`

This PR reverts #135375, because through some more testing I found out `./x test rustdoc-js --stage 0` does not in fact build rustdoc, and all the tests fail. This can't be intended behavior, so at least require `COMPILETEST_FORCE_STAGE0` to make it less likely to run `rustdoc-js --stage 0` by accident.

The problem that `--stage 0` is not working at all for this rustdoc-js test suite is tracked over at #135603.

cc `@lolbinarycat`

r? bootstrap
2025-01-17 01:46:18 +00:00
许杰友 Jieyou Xu (Joe)
097cb1a955 compiletest: require COMPILETEST_FORCE_STAGE0 for ./x test rustdoc-js --stage 0 2025-01-17 08:08:13 +08:00
Esteban Küber
9bdc65866c Expand docs for E0207 with additional example 2025-01-16 23:53:49 +00:00