Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Merge #5971 | bors[bot] | 2020-09-13 | 1 | -0/+22 |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5971: Implement async blocks r=flodiebold a=oxalica Fix #4018 @flodiebold already gave a generic guide in the issue. Here's some concern about implementation detail: - Chalk doesn't support generator type yet. - Adding generator type as a brand new type (ctor) can be complex and need to *re-introduced* builtin impls. (Like how we implement closures before native closure support of chalk, which is already removed in #5401 ) - The output type of async block should be known after type inference of the whole body. - We cannot directly get the type from source like return-positon-impl-trait. But we still need to provide trait bounds when chalk asking for `opaque_ty_data`. - During the inference, the output type of async block can be temporary unknown and participate the later inference. `let a = async { None }; let _: i32 = a.await.unwrap();` So in this PR, the type of async blocks is inferred as an opaque type parameterized by the `Future::Output` type it should be, like what we do with closure type. And it really works now. Well, I still have some questions: - The bounds `AsyncBlockImplType<T>: Future<Output = T>` is currently generated in `opaque_ty_data`. I'm not sure if we should put this code here. - Type of async block is now rendered as `impl Future<Output = OutputType>`. Do we need to special display to hint that it's a async block? Note that closure type has its special format, instead of `impl Fn(..) -> ..` or function type. Co-authored-by: oxalica <[email protected]> | ||||
| * | Implement async blocks | oxalica | 2020-09-10 | 1 | -0/+22 |
| | | |||||
* | | Adjust the test comment | Kirill Bulatov | 2020-09-11 | 1 | -9/+16 |
| | | |||||
* | | One more test | Kirill Bulatov | 2020-09-09 | 1 | -0/+15 |
| | | |||||
* | | Rename the method to avoid false promises | Kirill Bulatov | 2020-09-09 | 1 | -5/+5 |
| | | |||||
* | | Fix the tests | Kirill Bulatov | 2020-09-09 | 5 | -7/+9 |
| | | |||||
* | | Add tests | Kirill Bulatov | 2020-09-09 | 1 | -0/+153 |
| | | |||||
* | | Properly handle mod.rs imports | Kirill Bulatov | 2020-09-09 | 1 | -47/+40 |
| | | |||||
* | | Complete semicolon when needed | Kirill Bulatov | 2020-09-09 | 6 | -26/+30 |
| | | |||||
* | | Properly reacto to keywords | Kirill Bulatov | 2020-09-09 | 6 | -4/+28 |
| | | |||||
* | | Less false positive completion candidates | Kirill Bulatov | 2020-09-09 | 1 | -44/+59 |
| | | |||||
* | | Properly handle nested submodules in the same file | Kirill Bulatov | 2020-09-09 | 1 | -70/+79 |
| | | |||||
* | | Move most of the logic into the completion module | Kirill Bulatov | 2020-09-09 | 2 | -23/+98 |
| | | |||||
* | | Finally cretae the mod completion module | Kirill Bulatov | 2020-09-09 | 2 | -17/+40 |
| | | |||||
* | | Properly handle special cases (binaries, mod.rs) | Kirill Bulatov | 2020-09-09 | 1 | -3/+1 |
| | | |||||
* | | Exclude special files | Kirill Bulatov | 2020-09-09 | 1 | -3/+0 |
| | | |||||
* | | Happy path implemented | Kirill Bulatov | 2020-09-09 | 1 | -1/+1 |
| | | |||||
* | | Better API | Kirill Bulatov | 2020-09-09 | 1 | -5/+4 |
| | | |||||
* | | First steps for mod<|> completion | Kirill Bulatov | 2020-09-09 | 1 | -2/+23 |
|/ | |||||
* | Complete `pub` in fields | Aleksey Kladov | 2020-08-25 | 4 | -7/+36 |
| | |||||
* | Use the same abstraction for attrs and docs | Aleksey Kladov | 2020-08-25 | 2 | -2/+2 |
| | | | | | Doc comments *are* attributes, so there's no reason to have two crates here. | ||||
* | :arrow_up: ungrammar | Aleksey Kladov | 2020-08-21 | 1 | -1/+1 |
| | |||||
* | Switch to expect_test from crates.io | Aleksey Kladov | 2020-08-21 | 13 | -13/+13 |
| | |||||
* | Add SelfParam to code_model | Aleksey Kladov | 2020-08-19 | 3 | -5/+3 |
| | |||||
* | Minor | Aleksey Kladov | 2020-08-19 | 1 | -3/+3 |
| | |||||
* | Cleanup feature generation | Aleksey Kladov | 2020-08-18 | 3 | -10/+10 |
| | |||||
* | synchronizing changes | Dmitry | 2020-08-14 | 2 | -7/+20 |
| | |||||
* | Rename hypothetical -> speculative | Aleksey Kladov | 2020-08-14 | 1 | -1/+1 |
| | |||||
* | Remove Hygiene from completion | Aleksey Kladov | 2020-08-13 | 3 | -59/+65 |
| | |||||
* | Minor | Aleksey Kladov | 2020-08-13 | 1 | -6/+12 |
| | |||||
* | Rename ra_ide -> ide | Aleksey Kladov | 2020-08-13 | 18 | -0/+6880 |