Commit graph

16347 commits

Author SHA1 Message Date
Chayim Refael Friedman
528ed6bd01 Allow flyimporting excluded trait items if there is an exact match in the name
I.e. with `fn foo()`, don't complete at `x.fo|`, but complete (with imports) for `x.foo|`, since this is less likely to have false positives.

I opted to only do that for flyimport, even though for basic imports there can also be snippet completion (completing the params list for a method), since this is less universally applicable and seems not so useful.
2025-01-01 13:54:23 +01:00
Chayim Refael Friedman
bd6ea14002 Allow excluding specific traits from completion
To be accurate, only their methods are excluded, the trait themselves are still available.

I also excluded a bunch of std traits by default. Some less opinionated, like `AsRef`, which should never be used directly except in generic scenarios (and won't be excluded there), some more opinionated, like the ops traits, which I know some users sometimes want to use directly. Either way it's configurable.

It should be pretty easy to extend support to excluding only specific methods, but I didn't do that currently.

Traits configured to be excluded are resolved in each completion request from scratch. If this proves too expensive, it is easy enough to cache them in the DB.
2025-01-01 13:49:35 +01:00
Lukas Wirth
854caf37d6
Merge pull request #18757 from roife/fix-17812
feat: support updating snapshot tests with codelens/hovering/runnables
2025-01-01 12:44:55 +00:00
Lukas Wirth
c95aa86d30 internal: Do not render closure ids in hover messages
They are not useful
2025-01-01 13:41:07 +01:00
Max Niederman
8cefc0a05b cover guard patterns in clippy lints 2024-12-31 17:59:34 -08:00
bors
2085bce154 Auto merge of #134988 - tgross35:rollup-s59bx7c, r=tgross35
Rollup of 8 pull requests

Successful merges:

 - #132474 (Add more mailmap entries)
 - #133486 (borrowck diagnostics: make `add_move_error_suggestions` use the HIR rather than `SourceMap`)
 - #134861 (Add GUI test for item info elements color)
 - #134968 (Print how to rebless Python formatting in tidy)
 - #134971 (chore: fix typos)
 - #134972 (add .mailmap entry for myself)
 - #134974 (Revert #119515 single line where clause style guide)
 - #134975 (Revert style guide rhs break)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-01 01:34:29 +00:00
Trevor Gross
53b99dee15
Rollup merge of #134968 - Kobzol:tidy-bless-log, r=Noratrieb
Print how to rebless Python formatting in tidy

Suggested [here](https://github.com/rust-lang/rust/pull/134964#discussion_r1900124882).

r? ``@Noratrieb``
2024-12-31 18:42:24 -05:00
Weihang Lo
acb38ec197
Update cargo 2024-12-31 17:05:16 -05:00
Chayim Refael Friedman
1334961586
Merge pull request #18797 from profetia/issue10583
Fix replace-if-let-with-match generates non-exhausive match
2024-12-31 15:40:55 +00:00
lucasholten
ccbc3d2cb5 Add back optimizations 2024-12-31 15:48:58 +01:00
lucasholten
03b7eb3810 Add back tests removed in #18080 2024-12-31 15:48:58 +01:00
lucasholten
5b51c4c961 Add back crate graph deduplication 2024-12-31 15:47:29 +01:00
lucasholten
431aab10fb Remove CARGO_RUSTC_CURRENT_DIR 2024-12-31 15:47:29 +01:00
Jakub Beránek
ca8b12eb54 Print how to rebless Python formatting in tidy 2024-12-31 15:45:21 +01:00
yanglsh
258823daa9 Fix replace-if-let-with-match generates non-exhausive match 2024-12-31 07:40:45 -07:00
Lukas Wirth
204c8d704a Base relative cargo configs onto the manifest
This is not correct, but should be equivalent in most cases
2024-12-31 14:52:00 +01:00
Lukas Wirth
551a91aeaa fix: Populate cargo config env vars for crates 2024-12-31 14:32:35 +01:00
Matthias Krüger
d08d132524
Rollup merge of #134918 - ChrisDenton:issue-70093, r=jieyouxu
Windows: Enable issue 70093 link tests

Tracking issue for `-Z link-native-libraries`: #134948
Tracking issue for `-Z link-directives`: #134947

`-Zlink-native-libraries=no` and `-Zlink-directives=no` *should* work on Windows, at least for msvc. The fly in ointment is that `default-linker-libraries` doesn't. On unixy platforms rustc calls another compiler which in turn calls the linker along with the default libraries. On MSVC rustc calls the linker directly therefore it would need to be the one to implement `default-linker-libraries`. Except it doesn't so we workaround that in the test by using `-C link-arg` to talk to the linker.
2024-12-31 14:30:43 +01:00
Lukas Wirth
88e630b859
Merge pull request #18802 from roife/fix-18800
fix: incorrect file_id used for ranges in outgoing calls
2024-12-31 12:33:51 +00:00
Lukas Wirth
fd7ef275f6
Merge pull request #18805 from Veykril/push-pzurvxvoolxs
internal: Implement `<RaSpanServer as SourceFile>::eq`
2024-12-31 12:15:38 +00:00
roife
8860d073f3 fix: incorrect file_id used for ranges in outgoing calls 2024-12-31 20:10:22 +08:00
Lukas Wirth
7468106726 Implement <RaSpanServer as SourceFile>::eq 2024-12-31 13:00:46 +01:00
Lukas Wirth
b8fdfcc227 Remove recursion_limit special casing in tests 2024-12-31 13:00:23 +01:00
Lukas Wirth
8bb0fab904
Merge pull request #18758 from mgsloan/scip-unique-symbols
Improve SCIP symbols
2024-12-31 09:25:30 +00:00
The Miri Cronjob Bot
e898da11d2 Merge from rustc 2024-12-31 05:12:50 +00:00
roife
f581774e23 feat: show go-to-type-def actions for subst when hovering 2024-12-31 13:05:29 +08:00
The Miri Cronjob Bot
332fefbd3e Preparing for merge from rustc 2024-12-31 05:05:17 +00:00
ericlehong
e34465f852 Fix typos
Signed-off-by: ericlehong <193237094+ericlehong@users.noreply.github.com>
2024-12-31 12:33:36 +08:00
bors
80f5a81df9 Auto merge of #134929 - compiler-errors:style-edition-2024, r=ytmimi
Stabilize `style_edition = "2024"` in-tree

This PR stabilizes the `style_edition` flag in rustfmt.

**Why am I doing this in-tree?** The beta release cut is imminent (according to forge, on January 3) and this is the most lightweight approach to getting this flag stable on nightly. It's imperative (as far as I can tell -- `@traviscross` can verify or disagree) that we stabilize the `style_edition` flag so that users can control their style edition separately from the edition.

I'm happy to move this PR to the rustfmt repo and subsequently prepare a subtree sync if someone on `@rust-lang/rustfmt` believes that we should get this landed on the rustfmt side then synced. If this is the right recourse, I'd like to note that this is still quite time-sensitive. However, I'm happy to dedicate time to get this done if necessary, since I'd really like to un-jeopardize the style edition.

Tracking:

- https://github.com/rust-lang/rust/issues/123799
2024-12-31 03:05:49 +00:00
Michael Goulet
f694db1e28 Stabilize style_edition 2024 in-tree 2024-12-31 00:50:21 +00:00
bors
4e5fec2f1e Auto merge of #134757 - RalfJung:const_swap, r=scottmcm
stabilize const_swap

libs-api FCP passed in https://github.com/rust-lang/rust/issues/83163.

However, I only just realized that this actually involves an intrinsic. The intrinsic could be implemented entirely with existing stable const functionality, but we choose to make it a primitive to be able to detect more UB. So nominating for `@rust-lang/lang`  to make sure they are aware; I leave it up to them whether they want to FCP this.

While at it I also renamed the intrinsic to make the "nonoverlapping" constraint more clear.

Fixes #83163
2024-12-30 23:46:42 +00:00
Chris Denton
7d5ff8b8bd
Windows: Enable issue 70093 link tests 2024-12-30 22:52:23 +00:00
Michael Sloan
8a032e4d50 Move container_to_definition function into enclosing_definition 2024-12-30 13:52:09 -07:00
Michael Sloan
96fc18a3ce Remove erroneous omit of inherent impls
Should have been included in 34dc94bb2d05def8b88739a9382b127feb1a35a0
2024-12-30 13:51:41 -07:00
Michael Sloan
2d434dd767 TODO -> FIXME 2024-12-30 13:51:32 -07:00
Michael Sloan
b7cdd64690 Make impl HirDisplay for TraitRef provide just the trait type 2024-12-30 13:34:02 -07:00
yanglsh
8b66221e81 Add test cases for #10583 2024-12-30 12:07:35 -07:00
Matthias Krüger
b31c9d5036
Rollup merge of #134922 - ericlehong:fix/typos, r=lqd
Fix typos

This PR fixes typos errors in comments, docs and logs.

Thank you very much.
2024-12-30 19:34:57 +01:00
Matthias Krüger
4b9e3daa0b
Rollup merge of #134911 - HigherOrderLogic:master, r=onur-ozkan
chore: fix typos

This PR fixes typos errors in docstring only, so functionality wise, it should stay the same.
2024-12-30 19:34:56 +01:00
Ralf Jung
3c0c138687
fmt
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
2024-12-30 19:30:08 +01:00
Davis Muro
891041fbc9
deny usage of FileCheck prefixes as revision names 2024-12-30 08:48:59 -08:00
roife
dbf07bab76 refactor snapshot-tests detection in runnables 2024-12-30 23:56:31 +08:00
dfireBird
a0acb233e1
Fix render of literal to be rendered in codeblock 2024-12-30 20:03:10 +05:30
ericlehong
a0b3452fb5 Fix typos
Signed-off-by: ericlehong <193237094+ericlehong@users.noreply.github.com>
2024-12-30 21:43:22 +08:00
Lukas Wirth
20a7bf12eb
Merge pull request #18790 from ChayimFriedman2/proper-make
internal: Create a quoting mechanism instead of textual AST make
2024-12-30 11:39:29 +00:00
Lukas Wirth
56e05dc2bc
Merge pull request #18794 from 1hakusai1/fix_fill_match_arm_in_tokio_main
Fix bug of "fill match arm" action in tokio::main macro
2024-12-30 11:30:32 +00:00
Lukas Wirth
39ba498c8c
Merge pull request #18793 from ChayimFriedman2/fixup
minor: Remove unneeded conversions
2024-12-30 11:20:49 +00:00
1hakusai1
6fa3b3f85b Fix bug of "fill match arm" action in tokio::main macro
https://github.com/rust-lang/rust-analyzer/issues/18027
2024-12-30 20:06:17 +09:00
Chayim Refael Friedman
b4ad30deaa Remove unneeded conversions 2024-12-30 13:04:19 +02:00
Lukas Wirth
4a1c7d1719
Merge pull request #18792 from Veykril/push-wonkvzozmmwz
Decouple proc-macro server protocol from the server implementation
2024-12-30 11:00:08 +00:00