Commit Graph

308824 Commits

Author SHA1 Message Date
Chayim Refael Friedman
9b5b558f37 Merge pull request #20899 from A4-Tacks/ide-comp-test-track
minor: fix track_caller for ide-complpetion test utils
2025-10-24 05:44:37 +00:00
A4-Tacks
1a8055d777 minor: fix track_caller for ide-complpetion test utils 2025-10-24 13:34:39 +08:00
Shoyu Vanilla (Flint)
a1df998fb1 Merge pull request #20658 from A4-Tacks/more-expr-else-after-if
Fix else completion for more expressions
2025-10-24 04:27:41 +00:00
Shoyu Vanilla (Flint)
b12c794608 Merge pull request #20893 from ChayimFriedman2/specialization-ns
fix: Implement `Interner::impl_specializes()`
2025-10-24 04:23:11 +00:00
Stuart Cook
7141a0f634 Rollup merge of #148054 - nnethercote:chain, r=saethlin
Streamline iterator chaining when computing successors.

There are numerous unnecessary `into_iter` calls.

Also add a comment explaining why the code looks like this, because it's non-obvious at first glance.

r? `@saethlin`
2025-10-24 14:53:48 +11:00
Stuart Cook
195815583d Rollup merge of #148042 - epage:info-space, r=Urgau
test(frontmatter): Cover spaces between infostring parts

As these characters are specifically called out in the RFC, I felt it would be important to have a test to cover them.

Tracking issue: rust-lang/rust#136889
2025-10-24 14:53:47 +11:00
Stuart Cook
439d374ef8 Rollup merge of #148039 - JonathanBrouwer:add-myself, r=JonathanBrouwer
Add myself to the review rotation
2025-10-24 14:53:47 +11:00
Stuart Cook
b8ca0d40ff Rollup merge of #148021 - GuillaumeGomez:simplify-mod-render, r=notriddle
[rustdoc] Simplify module rendering and HTML tags handling

Extracted code from rust-lang/rust#145458.

This PR simplifies the rendering of modules, in particular the HTML tags handling. Instead of having all items in a `vec`, we make a map with their types as key, allowing to then iterate over the types, which allows us to open and close the HTML tag at every turn without the need to check if a tag was opened or not, or to check it's still the same kind of type.

For a better review experience: enable "Hide whitespace", the diff will be much smaller.

r? `@notriddle`
2025-10-24 14:53:46 +11:00
Stuart Cook
3f40ce54a9 Rollup merge of #148016 - clarfonthey:const-convert-revert-2, r=cuviper
Revert constification of `Borrow` and `Deref for Cow` due to inference failure

Reported issue: rust-lang/rust#147964
Original PR: rust-lang/rust#145279
Previous revert: rust-lang/rust#148011
`const Borrow`/`Deref` tracking issue: rust-lang/rust#143773

Should have additional crater run to verify this fixes the issue.

Since other PR is in the queue, this will need to be rebased after that merges. Also will want a beta nomination.
2025-10-24 14:53:45 +11:00
bors
38bc2468de Auto merge of #148049 - cuviper:revert-hash_map, r=Mark-Simulacrum
Revert "feat: implement `hash_map!` macro"

Crater for 1.91-beta found that this unstable macro caused ambiguity in the ecosystem: rust-lang/rust#147971

Since we are very close to release, it's probably best to just revert the macro for now, and re-add it later in a less invasive way -- i.e. not a top-level macro, and not in the prelude until a future edition (as noted [here](https://std-dev-guide.rust-lang.org/breaking-changes/prelude.html#macros)).

`@rustbot` label beta-nominated
2025-10-24 03:21:07 +00:00
Camille GILLOT
b67453fccd Stop passing resolver disambiguator state to AST lowering. 2025-10-24 02:41:52 +00:00
Camille Gillot
ed85b96bb5 Insert assignment after Retag. 2025-10-24 02:41:51 +00:00
Camille Gillot
a15ef42488 Only load pin field once. 2025-10-24 02:41:50 +00:00
A4-Tacks
76b7c79e32 Support else completion for more expressions
- Support else completion in ArrayExpr, ReturnExpr and PrefixExpr etc
- Support else completion after MatchArm expression

Before this PR, the else branch could not be completed in most expressions

Example
---
```rust
fn foo() -> [i32; 1] {
    [if true {
        2
    } $0]
}
```
->
```rust
fn foo() -> [i32; 1] {
    [if true {
        2
    } else {
        $0
    }]
}
```

---

```rust
fn foo() -> i32 {
    match () {
        () => if true {
            2
        } $0
    }
}
```
->
```rust
fn foo() -> i32 {
    match () {
        () => if true {
            2
        } else {
            $0
        }
    }
}
```
2025-10-24 10:06:06 +08:00
Shoyu Vanilla (Flint)
2b5b7cc662 Merge pull request #20844 from A4-Tacks/add-braces-assignment
Add applicable on assignment for add_braces
2025-10-24 01:53:21 +00:00
Chayim Refael Friedman
3a47c64664 Lower async closures to TyKind::CoroutineClosure
Instead of `TyKind::Closure`.

Note: the same `InternedCoroutineId` is used both for the *async closure* as well as for the *async block it returns*. When used in `TyKind::CoroutineClosure`, it represents the closure. When used in `TyKind::Coroutine`, it represents the async block. The generic args are different, though.

Also noteworthy is that we distinguish between the different kinds of coroutines (general coroutines, async coroutines and eventually gen coroutines too) via the expression producing them (stored in the `InternedCoroutineId`). It might be worth it to introduce a `CoroutineKind` field to `InternedCoroutineId`, although this is not done in this PR.
2025-10-24 04:31:56 +03:00
Chayim Refael Friedman
c859e76f57 Represent async blocks as TyKind::Coroutine, not as opaques 2025-10-24 04:31:53 +03:00
Ed Page
aec6d517d7 refactor(rustdoc): Remove redundant langstr checks
These same checks feed into `doctest.can_be_merged`,
making them redundant.
2025-10-23 20:18:52 -05:00
Manuel Drehwald
bfbe728d93 Merge pull request #2616 from rust-lang/gpu-example-update
Add the gpu version of the kernel which was missing in the docs
2025-10-24 03:11:16 +02:00
Manuel Drehwald
8badb14d82 Add the gpu version of the kernel which was missing in the docs 2025-10-24 03:09:24 +02:00
Chayim Refael Friedman
d6d007c290 Merge pull request #20896 from smmalis37/delete-mapping
Remove hir-ty/src/next_solver/mapping.rs
2025-10-24 00:13:13 +00:00
Steven Malis
617683f8d4 Remove hir-ty/src/next_solver/mapping.rs 2025-10-23 19:18:18 -04:00
ltdk
4a4f3b0e8e Add regression test for inference failures 2025-10-23 18:24:39 -04:00
Rémy Rakic
dd83c57674 add crashes tests for overlapping spans 2025-10-23 22:15:34 +00:00
Nicholas Nethercote
3d951598b2 Streamline iterator chaining when computing successors.
There are numerous unnecessary `into_iter` calls.

Also add a comment explaining why the code looks like this, because it's
non-obvious at first glance.
2025-10-24 08:41:39 +11:00
bors
27050c0d15 Auto merge of #148030 - hkBst:patch-3, r=lqd
Add Marijn Schouten to .mailmap

Should fix https://github.com/rust-lang/thanks/issues/85
2025-10-23 21:32:14 +00:00
Augie Fackler
e3e342a90b rustc_codegen_llvm: adapt for LLVM 22 change to pass masked intrinsic alignment as an attribute
This was a bit more invasive than I had kind of hoped. An alternate
approach would be to add an extra call_intrinsic_with_attrs() that would
have the new-in-this-change signature for call_intrinsic, but this felt
about equivalent and made it a little easier to audit the relevant
callsites of call_intrinsic().
2025-10-23 17:23:01 -04:00
Johannes Altmanninger
71851588e9 Fix rustfmt for files that use 2024-edition syntax
"cargo fmt" works fine but "rustfmt" fails to format some files.

	$ rustfmt crates/ide-db/src/search.rs
	error: let chains are only allowed in Rust 2024 or later
	   --> /home/johannes/git/rust-analyzer/crates/ide-db/src/search.rs:298:12
	    |
	298 |         if let &Definition::Module(module) = self
	    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I guess I could work around this by setting my format command to
"cargo fmt -- $filename" instead of "rustfmt $filename".

But it'd be nice if this worked OOTB. Make it so by adding specifying
the edition in rustfmt.toml.  We already have several other places
specifying the edition.

changelog internal
2025-10-23 23:13:13 +02:00
A4-Tacks
0ab44184a4 Add applicable on assignment for add_braces
```rust
fn foo() {
    let x =$0 n + 100;
}
```
->
```rust
fn foo() {
    let x = {
        n + 100
    };
}
```
2025-10-24 03:59:09 +08:00
Guillaume Gomez
ab1dcee5f2 Merge ClassInfo::open and ClassInfo::link_closing_tag fields into closing_tags
Improve documentation
Improve code
2025-10-23 21:47:15 +02:00
Guillaume Gomez
90c047b3d9 Replace the FxHashMap with an FxIndexMap 2025-10-23 21:45:37 +02:00
Josh Stone
c01682ebf6 Revert "feat: implement hash_map! macro"
This reverts commit 066023e47c.
2025-10-23 12:37:53 -07:00
Josh Stone
a81ed52f58 Add a regression test for rust-lang/rust#147971 2025-10-23 12:37:53 -07:00
Rémy Rakic
a2b48332ba Revert "Auto merge of #146121 - Muscraft:filter-suggestion-parts, r=petrochenkov"
This reverts commit 99317ef14d, reversing
changes made to 9cd272dc85.
2025-10-23 18:18:35 +00:00
Jynn Nelson
5976015e72 compiletest: show output in debug logging
I had a test I was confused by; the root issue is that `error-pattern`
runs before normalization, even though `//~ ERROR` runs after
normalization. This logging caught the issue immediately.
2025-10-23 14:07:00 -04:00
Chayim Refael Friedman
c1ecea6d7e Implement Interner::impl_specializes()
Using specialization logic ported from rustc.
2025-10-23 20:48:51 +03:00
Chayim Refael Friedman
6e397d3cd5 Merge pull request #20889 from A4-Tacks/heuristic-field-expr
Heuristic sensing parenthesis completion of fields
2025-10-23 17:16:53 +00:00
A4-Tacks
03b8682865 Fix some typos 2025-10-24 01:06:27 +08:00
Ed Page
bca35effc2 test(frontmatter): Cover spaces between infostring parts
As these characters are specifically called out in the RFC, I felt it
would be important to have a test to cover them.
2025-10-23 11:47:53 -05:00
Jonathan Brouwer
9ceb997e04 Add myself to the review rotation 2025-10-23 17:52:54 +02:00
Chayim Refael Friedman
88e4ea560a Merge pull request #20891 from daladim/semantic_type_for_logical_not
Semantic type for logical not
2025-10-23 15:46:11 +00:00
Guillaume Gomez
713cd50ea0 Switch back to stream highlight processing 2025-10-23 17:03:01 +02:00
Guillaume Gomez
6ed9a9dd8f Flush elements when there are too many 2025-10-23 17:03:01 +02:00
Guillaume Gomez
b28eabc5e6 Improve performance 2025-10-23 17:03:01 +02:00
Guillaume Gomez
c6e26f9881 Make compatible stack elements "glue" together to prevent creating more HTML tags than necessary 2025-10-23 17:03:01 +02:00
Guillaume Gomez
a5346c609e Improve source code for highlight.rs 2025-10-23 17:03:00 +02:00
daladim
1ef688810f Updated unit tests 2025-10-23 16:58:12 +02:00
daladim
68cb0a9b3f Added the "negation" semantic token 2025-10-23 16:38:26 +02:00
bors
6501e64fcb Auto merge of #147486 - petrochenkov:optpriv, r=lcnr
privacy: Introduce some caching to type visiting in `DefIdVisitorSkeleton`

The caching fixes compilation speed issues in special cases like https://github.com/rust-lang/rust/issues/145741, without introducing too much overhead in general cases.

I tried to cache more, but it caused regressions from the caching overhead, like it can be seen from benchmark runs below.

Inspired by https://github.com/rust-lang/rust/pull/146128.
Closes https://github.com/rust-lang/rust/issues/145741.
2025-10-23 14:30:10 +00:00
Marijn Schouten
41b4b2f718 Add Marijn Schouten to .mailmap 2025-10-23 15:17:44 +02:00