Commit Graph

278856 Commits

Author SHA1 Message Date
Zalathar
a14c35c507 coverage: Remove the Site enum now that we only instrument nodes 2025-01-18 17:12:18 +11:00
Scott McMurray
6fe82006a4 Update our range assumes to the format that LLVM prefers 2025-01-17 20:39:38 -08: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
Jakub Beránek
f854f34a50 Do not include GCC source code in source tarballs
The licensing story is unclear, it makes the archive much larger, and we should not need it for building anything in the tarballs (yet).
2025-01-17 23:01:48 +01: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
Mark Murphy
2406225266 Update syntax tree viewer docs 2025-01-17 15:55:38 -05: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
Laurențiu Nicola
577a96a71f Bump windows-sys 2025-01-17 21:28:11 +02:00
Laurențiu Nicola
6c1b1a1414
Merge pull request #18963 from gvozdvmozgu/Win32_Foundation
add missing `Win32_Foundation` feature
2025-01-17 18:54:57 +00: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
gvozdvmozgu
3ce55e949e add missing Win32_Foundation feature 2025-01-17 08:44:50 -08: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
Lukas Wirth
ff5c32f542
Merge pull request #18908 from jnyfah/error-braces
Fix: Detect missing errors for } braces before else in let...else statements
2025-01-17 13:29:56 +00:00
clubby789
f7c2d1194d doc: Point to methods on Command as alternatives to set/remove_var 2025-01-17 12:53:58 +00: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
14b00fba0a 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
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