about summary refs log tree commit diff
path: root/editors/code
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-10 19:43:51 +0000
committerbors <bors@rust-lang.org>2023-04-10 19:43:51 +0000
commit44cf8ef49ad3db5e82f18a89b20e925353389121 (patch)
tree439783fc580c779b5a503ed63125046f9d717b4f /editors/code
parent51d5862caf428c9e160ccf28d684f0a33faccd7d (diff)
parent59b6f2d9f2fe40b0176b64bf295562d0beaabc3e (diff)
downloadrust-44cf8ef49ad3db5e82f18a89b20e925353389121.tar.gz
rust-44cf8ef49ad3db5e82f18a89b20e925353389121.zip
Auto merge of #14470 - HKalbasi:mir, r=HKalbasi
Compute closure captures

This PR:
* Computes closure captures and the trait it implements (Fn, FnMut or FnOnce)
* Computes data layout of closures
* Adds support for closure MIR lowering
* Changes the closure type display from `|arg1: ty1, arg2: ty| -> ret` to `impl FnX(arg1: ty1, arg2: ty2) -> ret`

fix #12297
Diffstat (limited to 'editors/code')
-rw-r--r--editors/code/package.json17
1 files changed, 17 insertions, 0 deletions
diff --git a/editors/code/package.json b/editors/code/package.json
index 81fa97269a9..087fd1296b3 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -1028,6 +1028,23 @@
                         "Only show type hints for return types of closures with blocks."
                     ]
                 },
+                "rust-analyzer.inlayHints.closureStyle": {
+                    "markdownDescription": "Closure notation in type and chaining inaly hints.",
+                    "default": "impl_fn",
+                    "type": "string",
+                    "enum": [
+                        "impl_fn",
+                        "rust_analyzer",
+                        "with_id",
+                        "hide"
+                    ],
+                    "enumDescriptions": [
+                        "`impl_fn`: `impl FnMut(i32, u64) -> i8`",
+                        "`rust_analyzer`: `|i32, u64| -> i8`",
+                        "`with_id`: `{closure#14352}`, where that id is the unique number of the closure in r-a internals",
+                        "`hide`: Shows `...` for every closure type"
+                    ]
+                },
                 "rust-analyzer.inlayHints.discriminantHints.enable": {
                     "markdownDescription": "Whether to show enum variant discriminant hints.",
                     "default": "never",