aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge #5971bors[bot]2020-09-137-53/+213
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
| * Fix type walking about type of async blockoxalica2020-09-111-14/+9
| |
| * Fix and prettify commentsoxalica2020-09-111-4/+6
| |
| * Implement async blocksoxalica2020-09-107-53/+216
| |
* | Implement box pattern inferenceJonas Schievink2020-09-121-1/+13
| |
* | Add box pattern testJonas Schievink2020-09-121-0/+25
| |
* | Rename record_field_pat to record_pat_fieldPavan Kumar Sunkara2020-09-102-4/+4
| |
* | Tweak interner for chalkNathan Whitaker2020-09-091-9/+9
| |
* | Lookup ADT and assoc. type names for chalk debugNathan Whitaker2020-09-092-5/+21
|/
* Switch to expect_test from crates.ioAleksey Kladov2020-08-219-9/+9
|
* Add type safety to diagnostic codesAleksey Kladov2020-08-181-17/+17
|
* Speedup ty testsAleksey Kladov2020-08-181-6/+11
| | | | Closes #5792
* Merge #5682bors[bot]2020-08-181-0/+25
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 5682: Add an option to disable diagnostics r=matklad a=popzxc As far as I know, currently it's not possible to disable a selected type of diagnostics provided by `rust-analyzer`. This causes an inconvenient situation with a false-positive warnings: you either have to disable all the diagnostics, or you have to ignore these warnings. There are some open issues related to this problem, e.g.: https://github.com/rust-analyzer/rust-analyzer/issues/5412, https://github.com/rust-analyzer/rust-analyzer/issues/5502 This PR attempts to make it possible to selectively disable some diagnostics on per-project basis. Co-authored-by: Igor Aleksanov <[email protected]>
| * Merge branch 'master' into add-disable-diagnosticsIgor Aleksanov2020-08-141-0/+25
| |
* | Fix missing match arm false error on unknown typeCAD972020-08-172-4/+2
| |
* | Document missing match arm false positiveCAD972020-08-171-0/+19
| | | | | | | | | | | | This should already be guarded against (https://github.com/rust-analyzer/rust-analyzer/blob/d2212a49f6d447a14cdc87a9de2a4844e78b6905/crates/hir_ty/src/diagnostics/expr.rs#L225-L230) but it isn't preventing this false positive for some reason.
* | Chalk 0.23Jeremy Kolb2020-08-161-2/+2
| |
* | Only print chalk programs with CHALK_PRINTWilco Kusee2020-08-141-10/+15
| |
* | Lookup adt namesWilco Kusee2020-08-141-1/+2
| |
* | Only use logging db if CHALK_DEBUG is activeWilco Kusee2020-08-141-12/+15
| |
* | Print chalk programs in debug outputWilco Kusee2020-08-142-12/+19
|/
* display correctly 'impl Trait<T> + Trait<T>' #4814Benjamin Coenen2020-08-131-0/+1
| | | | Signed-off-by: Benjamin Coenen <[email protected]>
* Rename ra_hir_ty -> hir_tyAleksey Kladov2020-08-1335-0/+22837