diff options
| author | bors <bors@rust-lang.org> | 2023-05-01 20:48:50 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-05-01 20:48:50 +0000 |
| commit | 2fdd1ac510f3e2254a89f4d8df7b1010934f81c5 (patch) | |
| tree | cbaea739cd9f5e5c850d01c2f2b232da39076668 /docs/dev | |
| parent | 001607fdb4ac6a3059813451234097ce7c2f35de (diff) | |
| parent | 6312fbf521e42e5a5ff193ceee6a8c7735be3a45 (diff) | |
Auto merge of #14664 - HKalbasi:mir, r=HKalbasi
MIR episode 4 In lowering, it now supports overloaded and arith assignment binary operators, statics. and constants in patterns. There is now 252 functions that we fail to emit mir for them, and the majority of them are due type mismatches or other deep and unrelated issues (but it isn't done yet, for example slice patterns and destructing assignment is not implemented yet). In evaluating, it now can evaluate associated constants in traits (so now typenum's `U5::ToConst` should work), allocator functions, atomic intrinsics, and some more things. It also provides a (hacky) basis for making progress in #14275. I also added a `Interpret` code lens to `Run` and `Debug` when the experimental `interpret tests` is enabled (previously it showed result in hover, which was unusable even for debugging) Changes in unrelated files are: * Changes substitutions of closures, now it includes parent substs ~~before~~ after `sig_ty`. * ~~A salsa input for retrieving the path of a file id, used in emitting stack trace for interpret result.~~ * Normalizing associated types in layout computing
Diffstat (limited to 'docs/dev')
| -rw-r--r-- | docs/dev/lsp-extensions.md | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md index d748400b695..76080eca4e0 100644 --- a/docs/dev/lsp-extensions.md +++ b/docs/dev/lsp-extensions.md @@ -1,5 +1,5 @@ <!--- -lsp_ext.rs hash: be2f663a78beb7bd +lsp_ext.rs hash: 37ac44a0f507e05a If you need to change the above hash to make the test pass, please check if you need to adjust this doc as well and ping this issue: @@ -548,6 +548,18 @@ For debugging or when working on rust-analyzer itself. Returns a textual representation of the MIR of the function containing the cursor. For debugging or when working on rust-analyzer itself. +## Interpret Function + +**Method:** `rust-analyzer/interpretFunction` + +**Request:** `TextDocumentPositionParams` + +**Response:** `string` + +Tries to evaluate the function using internal rust analyzer knowledge, without compiling +the code. Currently evaluates the function under cursor, but will give a runnable in +future. Highly experimental. + ## View File Text **Method:** `rust-analyzer/viewFileText` |
