Commit Graph

238983 Commits

Author SHA1 Message Date
bors
92d9ca7d64 Auto merge of #15876 - DropDemBits:lsp-ext-multiple-snippet-textedit, r=Veykril
minor: Allow multiple snippet edits in a `TextDocumentEdit`

Explicitly[^1] allow a single `TextDocumentEdit` to have multiple `SnippetTextEdit`s. This allows things like renaming extracted variables and functions without having to go through a separate rename step. For an example of what this looks like, see the video in [this comment](https://github.com/microsoft/vscode/issues/145374#issuecomment-1177341711).

The behavior described here lines up with [what VSCode does](bdc113ffe1/src/vscode-dts/vscode.d.ts (L3728-L3731)), and presumably what the eventual LSP behavior will be.

[^1]: This was technically the case before #15269, a single `TextDocumentEdit` always had multiple edits which were `InsertTextFormat.Snippet` as all of the edits were marked as being snippets, even if there weren't any tab stops or placeholders.
2023-11-12 15:20:42 +00:00
bors
8bfe0aaba9 Auto merge of #15880 - lnicola:vfs-toml, r=Veykril
internal: Include toml files in the vfs

Closes #15753
2023-11-12 15:04:02 +00:00
Laurențiu Nicola
bad3d9e766 Include toml files in the vfs 2023-11-12 16:45:47 +02:00
bjorn3
bf85e182d0
Merge pull request #1421 from Kobzol/patch-1
Add Rustup installation instructions to README
2023-11-12 15:45:43 +01:00
bors
1152f593b3 Auto merge of #15870 - lnicola:expand-macro, r=lnicola
minor: Make "Expand macro" command title more explicit

Closes [#15856](https://github.com/rust-lang/rust-analyzer/issues/15856).

I opted for "caret", since it's the better term (cursor is the mouse), but I'm not sure how popular it is these days.
2023-11-12 13:48:43 +00:00
bors
e25a04fbe5 Auto merge of #3143 - devnexen:fbsd_update, r=RalfJung
freebsd interceptions update proposal
2023-11-12 13:24:22 +00:00
Ralf Jung
ba523be7a8 better error when calling pthread shims on unsupported unixes 2023-11-12 14:22:55 +01:00
Ralf Jung
887ffc68ee tweak comments 2023-11-12 14:18:22 +01:00
Ralf Jung
5b5006916b target_feature: make it more clear what that 'Option' means 2023-11-12 12:46:05 +01:00
bors
886d5fbeb0 Auto merge of #11508 - Jarcho:issue_11474, r=blyxyas
Lint `needless_borrow` and `explicit_auto_deref` on most union field accesses

Changes both lints to follow rustc's rules around auto-deref through `ManuallyDrop` union fields rather than just bailing on union fields.

changelog: [`needless_borrow`] & [`explicit_auto_deref`]: Lint on most union field accesses
2023-11-12 11:24:01 +00:00
David Carlier
be6f27b686 freebsd interceptions update proposal 2023-11-12 11:17:24 +00:00
Nilstrieb
8bcd221b4c Small improvements in object lifetime default code
I found those while trying to understand how the code works.
2023-11-12 11:59:01 +01:00
Laurențiu Nicola
cace36cade Make Expand macro command title more explicit 2023-11-12 11:43:46 +02:00
Zalathar
ed8298b825 coverage: Avoid creating malformed macro name spans
This method is trying to detect macro invocations, so that it can split a span
into two parts just after the `!` of the invocation.

Under some circumstances (probably involving nested macros), it gets confused
and produces a span that is larger than the original span, and possibly extends
outside its enclosing function and even into an adjacent file.

In extreme cases, that can result in malformed coverage mappings that cause
`llvm-cov` to fail. For now, we at least want to detect these egregious cases
and avoid them, so that coverage reports can still be produced.
2023-11-12 18:33:11 +11:00
bors
a04d56b36d Auto merge of #117817 - fmease:deny-more-tilde-const, r=fee1-dead
Deny more `~const` trait bounds

thereby fixing a family of ICEs (delayed bugs) for `feature(const_trait_impl, effects)` code.

As discussed
r? `@fee1-dead`
2023-11-12 04:40:44 +00:00
Paul Menage
2e6b57541d Add -Z llvm_module_flag
Allow adding values to the `!llvm.module.flags` metadata for a generated
module.  The syntax is

`-Z llvm_module_flag=<name>:<type>:<value>:<behavior>`

Currently only u32 values are supported but the type is required to be
specified for forward compatibility.  The `behavior` element must match
one of the named LLVM metadata behaviors.viors.

This flag is expected to be perma-unstable.
2023-11-11 19:48:47 -08:00
Young-Flash
23fde40fed fix PathSegment grammar 2023-11-12 11:20:14 +08:00
DropDemBits
1e4686865e
Allow multiple snippet edits in a TextDocumentEdit 2023-11-11 22:12:49 -05:00
DropDemBits
4aaa592a9a
Migrate destructure_tuple_binding to mutable ast
Due to the way the current tree mutation api works, we need to collect
changes before we can apply them to the real syntax tree, and also can only
switch to a file once.

`destructure_tuple_binding_in_sub_pattern` also gets migrated even
though can't be used.
2023-11-11 21:07:19 -05:00
DropDemBits
f3dcc67dfa
Migrate add_type_ascription 2023-11-11 21:05:27 -05:00
DropDemBits
5fc8cc52e2
Add LetStmt::set_ty
Way for setting and removing the type ascription of a let stmt
2023-11-11 21:05:27 -05:00
DropDemBits
92422f7488
Use syntax's version of SyntaxElement 2023-11-11 21:05:27 -05:00
DropDemBits
cc4e06f04b
Migrate add_turbo_fish to mutable ast
`add_type_ascription` is still left as-is since it's a different assist
2023-11-11 21:05:26 -05:00
DropDemBits
02c7b8b9ba
Add MethodCallExpr::get_or_create_generic_arg_list
Mirrors `PathSegment's` version, except that it always generates a
turbofish
2023-11-11 21:05:26 -05:00
nokazn
b6f0994ee6
docs: fix VS Code setting samples 2023-11-12 10:29:56 +09:00
León Orell Valerian Liehr
8ce5d784a6
Deny more ~const trait bounds 2023-11-12 00:00:12 +01:00
bors
8ee9a9c549 Auto merge of #11767 - matthri:unnecessary-fallible-conversions-ext-notes, r=blyxyas
Add type details to unnecessary_fallible_conversions note

fixes: #11753

changelog: [`unnecessary_fallible_conversions`]: add type details to lint note
2023-11-11 22:51:27 +00:00
James Dietz
3f0908f47c round to even 2023-11-11 17:22:07 -05:00
Jakub Beránek
d8445b1cf2
Add Rustup installation instructions to README
Now that cranelift is distributed with Rustup, I find myself constantly searching for the https://github.com/rust-lang/rust/pull/81746 PR. I think that it would be useful to also describe the Rustup installation/usage instructions here in README.
2023-11-11 22:49:27 +01:00
James Dietz
e81964e6f9 fix rounding issue with exponents in fmt 2023-11-11 16:40:22 -05:00
sjwang05
f88cf0206f
Move unclosed delim errors to separate function 2023-11-11 13:39:08 -08:00
Jacherr
938984a24e run cargo dev fmt 2023-11-11 21:29:09 +00:00
Jacherr
941164807f implement more types to lint, fix wording 2023-11-11 21:26:50 +00:00
bors
2c1b65ee14 Auto merge of #115694 - clarfonthey:std-hash-private, r=dtolnay
Add `std:#️⃣:{DefaultHasher, RandomState}` exports (needs FCP)

This implements rust-lang/libs-team#267 to move the libstd hasher types to `std::hash` where they belong, instead of `std::collections::hash_map`.

<details><summary>The below no longer applies, but is kept for clarity.</summary>
This is a small refactor for #27242, which moves the definitions of `RandomState` and `DefaultHasher` into `std::hash`, but in a way that won't be noticed in the public API.

I've opened rust-lang/libs-team#267 as a formal ACP to move these directly into the root of `std::hash`, but for now, they're at least separated out from the collections code in a way that will make moving that around easier.

I decided to simply copy the rustdoc for `std::hash` from `core::hash` since I think it would be ideal for the two to diverge longer-term, especially if the ACP is accepted. However, I would be willing to factor them out into a common markdown document if that's preferred.
</details>
2023-11-11 21:12:20 +00:00
Jason Newcomb
1a01132417 Lint explicit_auto_deref on most union field accesses. 2023-11-11 15:54:58 -05:00
Matthias Richter
4dead776e1 add type details to unnecessary_fallible_conversions note 2023-11-11 21:01:36 +01:00
Jason Newcomb
a68cd88860 Lint needless_borrow on most union field accesses 2023-11-11 14:50:19 -05:00
bors
ed086d86b8 Auto merge of #117820 - Mark-Simulacrum:bump-version, r=Mark-Simulacrum
Bump nightly version

https://forge.rust-lang.org/release/process.html#bump-the-stable-version-number-t-6-days-friday-the-week-before

r? `@Mark-Simulacrum`
2023-11-11 18:37:45 +00:00
Mark Rousskov
be67b7bdc7 Bump nightly version 2023-11-11 11:29:33 -05:00
bors
5fcf5289e7 Auto merge of #15871 - Veykril:import-map, r=Veykril
Add config for preferring / ignoring prelude modules in find_path
2023-11-11 15:05:08 +00:00
bors
d487579efd Auto merge of #11792 - y21:issue11764, r=llogiq
[`map_identity`]: respect match ergonomics

Fixes #11764

Note: the original tests before this were slightly wrong themselves already and had to be changed. They were calling `map` on an iterator of `&(i32, i32)`s, so this PR would stop linting there, but they were meant to test something else unrelated to binding modes, so I just changed them to remove the references so that it iterates over owned values and they all bind by value. This way they continue to test what they checked for before: the identity function for tuple patterns.

changelog: [`map_identity`]: respect match ergonomics
2023-11-11 14:58:00 +00:00
Lukas Wirth
74e5444f15 Fix some FIXMEs 2023-11-11 15:49:57 +01:00
León Orell Valerian Liehr
732b4bb664
Make rustc_parse_format compile on stable again 2023-11-11 15:48:13 +01:00
Ralf Jung
86e5d36c19 Miri: use new init_logger function, avoid calling env::set_var 2023-11-11 15:24:33 +01:00
Ralf Jung
581a317bbb rustc_log: provide a way to init logging based on the values, not names, of the env vars 2023-11-11 15:24:33 +01:00
Lukas Wirth
ba61766217 Add config for preferring / ignoring prelude modules in find_path 2023-11-11 14:56:38 +01:00
Lukas Wirth
801a887954 Record all import paths per item in ImportMap 2023-11-11 14:48:44 +01:00
bjorn3
cdae1c939f Set CG_CLIF_FORCE_GNU_AS for all rustc tests 2023-11-11 13:19:49 +00:00
Lukas Wirth
2339ba4440 Prepare ImportMap for supportin multiple import paths per item 2023-11-11 14:04:24 +01:00
y21
b2cf8f7a24 [map_identity]: respect match ergonomics 2023-11-11 13:48:26 +01:00