1
Fork 0
Commit graph

278879 commits

Author SHA1 Message Date
VinTarZ
824bad7f65
Fix debug_assertions broken in 1c5a125beb35725ccc2ade005db9870db734bf23 2025-01-16 14:19:16 +03:00
jnyfah
39a1bb9e98 update blocklike 2025-01-16 12:11:55 +01:00
Zalathar
6eabf03526 coverage: Make yank_to_spantree_root iterative instead of recursive
This avoids having to worry about stack space when traversing very long
spantree paths, e.g. when instrumenting a long sequence of if/else statements.
2025-01-16 22:07:18 +11:00
Zalathar
f1300c860e coverage: Completely overhaul counter assignment, using node-flow graphs 2025-01-16 22:07:18 +11:00
bors
d8a64098c9 Auto merge of #135344 - scottmcm:safe-dangling, r=joboet
Less unsafe in `dangling`/`without_provenance`

This PR was inspired by the new `NonNull::without_provenance` (cc https://github.com/rust-lang/rust/issues/135243#issuecomment-2583913562) since it made me realize that we could write `NonNull::dangling` in completely-safe code using other existing things.

Then doing that led me to a few more places that could be simplified, like now that GVN will optimize Transmute-then-PtrToPtr, we can just implement `ptr::without_provenance` by calling `ptr::without_provenance_mut` since the shipped rlib of `core` ends up with the same single statement as the implementation (thanks to GVN merging the steps) and thus there's no need to duplicate the `transmute` -- and more importantly, no need to repeat a long safety comment.

There did end up being a couple of other changes needed to avoid exploding certain bits of MIR, though -- like `<Box<[i32]>>::default()`'s MIR originally got way worse as certain things didn't inline, or had a bunch of extraneous UbChecks -- so there's a couple of other changes to solve that.
2025-01-16 10:52:11 +00:00
lh123
341a6d5bba feat: complete raw, const keyword 2025-01-16 18:27:59 +08:00
MarcoIeni
f5fe0a0293
ci: mirror ubuntu:22.04 to ghcr.io 2025-01-16 11:21:41 +01:00
Lukas Wirth
fa71da9ff0
Merge pull request #18951 from Veykril/push-zpvunsvlpuxt
Add missing `#[rust_analyzer::rust_fixture]` annotations
2025-01-16 10:21:22 +00:00
Lukas Wirth
56059f8c7a
Merge pull request #18950 from Veykril/push-okmsynnltxts
Generalize some type walking in hover type actions
2025-01-16 10:19:37 +00:00
Lukas Wirth
4d5632b720 Generalize some type walking in hover type actions 2025-01-16 11:06:11 +01:00
Lukas Wirth
664cdd2936 Minor docs improvement 2025-01-16 11:05:20 +01:00
Lukas Wirth
548d70f8aa Add edit test for await skipping completions 2025-01-16 10:56:57 +01:00
Luca Versari
8fee6a7739 Coerce safe-to-call target_feature functions to fn pointers. 2025-01-16 10:54:33 +01:00
Lukas Wirth
5a9763750e Add missing #[rust_analyzer::rust_fixture] annotations 2025-01-16 10:51:57 +01:00
bjorn3
cda9145b00 Fix rustc test suite 2025-01-16 09:42:35 +00:00
bjorn3
8a46f85c7e Rustup to rustc 1.86.0-nightly (419b3e2d3 2025-01-15) 2025-01-16 09:33:11 +00:00
bjorn3
aebad29932 Sync from rust 419b3e2d3e 2025-01-16 09:24:37 +00:00
Lukas Wirth
419bdb20e2
Merge pull request #18949 from Veykril/push-yzklntsnnuts
Partially back out "fix: Fix sourceroot construction for virtual manifests"
2025-01-16 09:18:48 +00:00
Lukas Wirth
c00dfedc34 Partially back out "fix: Fix sourceroot construction for virtual manifests" 2025-01-16 10:02:26 +01:00
Lukas Wirth
8ec90940f2
Merge pull request #18946 from lh123/goto-to-type-def-func-param-and-trait-bound
feat: show go-to-type-def actions for func param and trait bound when hovering
2025-01-16 08:48:02 +00:00
Lukas Wirth
d6477b952b
Merge pull request #18927 from ChayimFriedman2/skip-iter-await
feat: Add smart completions that skip `await` or `iter()` and `into_iter()`
2025-01-16 08:47:26 +00:00
Frank King
5079acc060 Implement use associated items of traits 2025-01-16 16:34:05 +08:00
ClearLove
48e671ec88
fix typo in library/alloc/src/sync.rs
Co-authored-by: Ibraheem Ahmed <ibraheem@ibraheem.ca>
2025-01-16 15:16:43 +08:00
bors
d61f55d8b9 Auto merge of #135484 - nikic:llvm-19.1.7, r=cuviper
Update to LLVM 19.1.7

Fixes https://github.com/rust-lang/rust/issues/134457.
Fixes https://github.com/rust-lang/rust/issues/111073.
2025-01-16 07:09:38 +00:00
Laurențiu Nicola
1c73899e18
Merge pull request #18944 from WaffleLapkin/trait_upcast_chalk
update chalk, fixing trait upcasting
2025-01-16 06:55:38 +00:00
lh123
fdc672e402 add goto-to-def actions for trait bound 2025-01-16 14:47:42 +08:00
lh123
b6ba392bb1 add go-to-type-def actions for func params 2025-01-16 14:47:26 +08:00
Scott McMurray
c18718c9c2 Less unsafe in dangling/without_provenance 2025-01-15 22:17:57 -08:00
Zalathar
2238b00dac Update docs for -Clink-dead-code to discourage its use 2025-01-16 15:43:29 +11:00
bors
5cd16b7f2b Auto merge of #135458 - jieyouxu:migrate-extern-fn-reachable, r=lqd
tests: Port `extern-fn-reachable` to rmake.rs

Part of #121876.

## Summary

This PR ports `tests/run-make/extern-fn-reachable` to use `rmake.rs`. Notable changes:

- We now use the `object` crate and look at the exported symbols specifically.
- This test's coverage regressed against windows-msvc back in [replace dynamic library module with libloading #90716](https://github.com/rust-lang/rust/pull/90716), but since we use `object` now, we're able to claw the test coverage back.
- The checks are now stricter:
    1. It no longer looks for substring symbol matches in `nm` textual outputs, it inspects the symbol names precisely.
    2. We now also explicitly check for the presence of leading underscore in exported symbol names on apple vs non-apple targets.
- Added another case of `#[no_mangle] fn fun6() {}` (note the lack of `pub`) to check that Rust nameres visibility is orthogonal to symbol visibility in dylib.

## History

- Test was initially introduced as a run-pass[^run-pass] test as part of [Don't mark reachable extern fns as internal #10539](https://github.com/rust-lang/rust/pull/10539).
- Test re-introduced as a run-make test in https://github.com/rust-lang/rust/pull/13741.
- Later, the test coverage regressed in https://github.com/rust-lang/rust/pull/90716.

[^run-pass]: no longer a thing nowadays

Supersedes #128314.
Co-authored with `@lolbinarycat.`

try-job: x86_64-msvc
try-job: i686-msvc
try-job: i686-mingw
try-job: x86_64-mingw-1
try-job: x86_64-apple-1
try-job: aarch64-apple
try-job: test-various
2025-01-16 02:31:22 +00:00
1hakusai1
36d705e042 Use resolve_method_call_as_callable to handle function types 2025-01-16 10:00:30 +09:00
1hakusai1
7f3601ffab refactor: Change order of arguments 2025-01-16 09:35:07 +09:00
1hakusai1
97a7d2354a refactor: rename to descriptive name 2025-01-16 09:33:52 +09:00
Esteban Küber
f78a1bd89a 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-16 00:18:26 +00:00
Waffle Lapkin
fea252667d
update chalk
this brings in support from trait upcasting, yay!
(and as such fixes a test)
2025-01-16 00:38:36 +01:00
Waffle Lapkin
20e3834f69
add a test for trait upcasting type mismatch
this adds a test asserting *incorrect* behavior that can be seen in
<https://github.com/rust-lang/rust-analyzer/issues/18083>, and a test
asserting the *correct* behavior for the case of no super traits.
2025-01-16 00:38:36 +01:00
Flakebi
41ae38294d Add gpu-kernel calling convention
The amdgpu-kernel calling convention was reverted in commit
f6b21e90d1 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.
2025-01-16 00:26:55 +01:00
Flakebi
e7e5202978
Add gpu-kernel calling convention
The amdgpu-kernel calling convention was reverted in commit
f6b21e90d1 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.
2025-01-16 00:26:55 +01:00
bors
6fc8a27931 Auto merge of #135555 - matthiaskrgr:rollup-jnqdbuu, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #135497 (fix typo in typenames of pin documentation)
 - #135522 (add incremental test for issue 135514)
 - #135523 (const traits: remove some known-bug that do not seem to make sense)
 - #135535 (Add GUI test for #135499)
 - #135541 (Methods of const traits are const)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-15 22:22:48 +00:00
Aeon
c4a5e12567
Clarify note in std::sync::LazyLock example 2025-01-15 16:08:22 -05:00
Matthias Krüger
2ea07deff2
Rollup merge of #135541 - oli-obk:push-lqlmstussztp, r=compiler-errors
Methods of const traits are const

Just a small FIXME that gets resolved.

I think the `constness` query should not cover all const callable things
2025-01-15 22:06:13 +01:00
Matthias Krüger
b6dc41f081
Rollup merge of #135535 - GuillaumeGomez:gui-test-135499, r=notriddle
Add GUI test for #135499

Fixes #135510.

cc `@lolbinarycat`
r? `@notriddle`
2025-01-15 22:06:12 +01:00
Matthias Krüger
e4bbca2a9b
Rollup merge of #135523 - RalfJung:wrong-known-bug, r=compiler-errors
const traits: remove some known-bug that do not seem to make sense

These tests were made to point to #103507 in https://github.com/rust-lang/rust/pull/114134; I think that was a mistake: that issue is about a rather specific problem, and most tests marked as known-bug in that PR are pointing at https://github.com/rust-lang/rust/issues/110395 which makes more sense.

Of the 4 tests that still point to #103507:
- One is [the original test](2088260852/tests/ui/impl-trait/normalize-tait-in-const.rs). It still fails to compile, though currently for unrelated reasons (`~const Fn` is not valid as that is not a const trait). I made it point at #110395 like all the other tests that were disabled when the previous const trait impl was removed.
- One is being fixed in https://github.com/rust-lang/rust/pull/135423
- The other two are fixed in this PR

The errors we are getting here are not great but they do look correct?

FWIW there are still a whole lot of tests mentioning #110395 despite that issue being closed... I hope someone is tracking that.^^

r? `@compiler-errors`
2025-01-15 22:06:12 +01:00
Matthias Krüger
5bebace822
Rollup merge of #135522 - lqd:issue-135514, r=compiler-errors
add incremental test for issue 135514

r? `@compiler-errors` as requested in https://github.com/rust-lang/rust/issues/135514#issuecomment-2591614811

This adds parts of `@steffahn's` repro as an incremental test for #135514. I had initially added the actual exploitation of the issue into the safe transmute, but removed it because it's not exactly needed for such a test. I can add it back if you'd like.

I've verified that the test fails with https://github.com/rust-lang/rust/pull/133828 reverted.
2025-01-15 22:06:11 +01:00
Matthias Krüger
85d2b2af15
Rollup merge of #135497 - DJMrTV:master, r=jhpratt
fix typo in typenames of pin documentation

I noticed this whilst reading the documentation for pin.

Basically there was just one to many closing angle brackets on the type parameters in the documentation where instead of being `Pin<&mut T>` it was `Pin<&mut T>>`
2025-01-15 22:06:11 +01:00
Jiri Bobek
c656f879c9 Export likely(), unlikely() and cold_path() in std::hint 2025-01-15 21:42:47 +01:00
Chayim Refael Friedman
553d525f16 Add smart completions that skip await or iter() and into_iter()
E.g. complete `await.foo()`.
2025-01-15 22:32:07 +02:00
HKalbasi
88ae0896f9
Merge pull request #18897 from duncanawoods/master
fix: Make test_runner::TestState::stdout optional to fix parsing cargo test json output
2025-01-15 19:51:36 +00:00
bors
419b3e2d3e Auto merge of #135540 - GuillaumeGomez:rollup-40lfb7l, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - #132654 (std: lazily allocate the main thread handle)
 - #135003 (deprecate `std::intrinsics::transmute` etc, use `std::mem::*` instead)
 - #135428 (rustdoc: Remove `AttributesExt` trait magic that added needless complexity)
 - #135498 (Prefer lower `TraitUpcasting` candidates in selection)
 - #135507 (TRPL: incorporate all backward-compatible Edition changes)
 - #135529 (remove outdated FIXME)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-15 18:26:54 +00:00
DJMrTV
b535a1dd65 fix typo in typenames of pin documentation 2025-01-15 19:18:17 +01:00