Commit Graph

273 Commits

Author SHA1 Message Date
Lukas Wirth
0e7117900c internal: Resolve labels in body lowering 2023-04-06 14:21:20 +02:00
bors
e9e57725aa Auto merge of #14505 - Veykril:block-trait-impls, r=Veykril
fix: Fix block local impl trait solving regressions

Fixes https://github.com/rust-lang/rust-analyzer/issues/14443
2023-04-06 08:37:33 +00:00
Lukas Wirth
1c16e4ee97 fix: Fix block local impl trait solving regressions 2023-04-06 10:37:00 +02:00
Ryo Yoshida
0a2d0b15a1
Add regression test for #10989 2023-04-06 03:39:59 +09:00
bors
25124a84de Auto merge of #14490 - Veykril:crategraph-dedup, r=Veykril
internal: Switch crate graph to use an Arena instead of a hashmap
2023-04-05 14:12:11 +00:00
bors
a1ca52e2a9 Auto merge of #14486 - HKalbasi:dev, r=Veykril
Desugar async fn completely

fix #14479
2023-04-05 13:58:38 +00:00
bors
af30656785 Auto merge of #14436 - lowr:patch/normalize-assoc-type-in-path-expr, r=HKalbasi
Normalize associated types in paths in expressions

Part of #14393

When we resolve paths in expressions (either path expressions or paths in struct expressions), there's a need of projection normalization, which `TyLoweringContext` cannot do on its own. We've been properly applying normalization for paths in struct expressions without type anchor, but not for others:

```rust
enum E {
    S { v: i32 }
    Empty,
}

impl Foo for Bar {
    type Assoc = E;
    fn foo() {
        let _ = Self::Assoc::S { v: 42 };   // path in struct expr without type anchor; we already support this
        let _ = <Self>::Assoc::S { v: 42 }; // path in struct expr with type anchor; resolves with this PR
        let _ = Self::Assoc::Empty;         // path expr; resolves with this PR
    }
}
```

With this PR we correctly resolve the whole path, but we need some more tweaks in HIR and/or IDE layers to properly resolve a qualifier (prefix) of such paths and provide IDE features that are pointed out in #14393 to be currently broken.
2023-04-05 10:47:47 +00:00
Lukas Wirth
7f0fbf7f9d Switch crate graph to use an Arena instead of a hashmap 2023-04-05 10:32:02 +02:00
hkalbasi
c26b12d01c Desugar async fn completely 2023-04-04 23:07:38 +03:30
hkalbasi
d7fe4e2fa8 lower adjusts in simple index except the last one 2023-04-01 16:49:32 +03:30
hkalbasi
8a6ca86247 Use async block in async fn type inference 2023-04-01 04:35:28 +03:30
Lukas Wirth
e244942209 internal: Set Durability to HIGH for enable_proc_attr_macros input 2023-03-30 15:11:22 +02:00
bors
5390949c11 Auto merge of #14448 - Veykril:infer-table, r=Veykril
internal: Don't expose InferenceTable outside of hir-ty
2023-03-30 12:49:23 +00:00
Lukas Wirth
fc840dbb2d internal: Don't expose InferenceTable outside of hir-ty 2023-03-30 13:27:10 +02:00
Lukas Wirth
33b6012827 Introduce StructFlags 2023-03-30 12:49:08 +02:00
Lukas Wirth
251b3a47af Simplify 2023-03-30 09:21:10 +02:00
Lukas Wirth
e797479651 fix: Handle box and raw pointers correctly in builtin_deref 2023-03-29 21:38:32 +02:00
Ryo Yoshida
6447d485e3
Normalize type anchor type before resolving the rest of value paths 2023-03-29 23:37:01 +09:00
Ryo Yoshida
8aef04f1a7
Resolve and normalize path segments one by one in variant resolution 2023-03-29 23:32:37 +09:00
Lukas Wirth
798990bf33 fix: Add missing autoborrow adjustment for index expressions 2023-03-29 16:11:48 +02:00
Lukas Wirth
bea1c71f83 Use struct_tail_without_normalization in Expectation::rvalue_hint 2023-03-29 14:49:06 +02:00
bors
7a98e24777 Auto merge of #14431 - Veykril:simplify, r=Veykril
minor: Simplify
2023-03-29 07:28:42 +00:00
Lukas Wirth
8ea1afce28 Simplify 2023-03-28 16:32:26 +02:00
hkalbasi
d0d4245a74 use FxHashSet instead of FxHashMap 2023-03-28 15:59:16 +03:30
hkalbasi
d5c7ec499a fix stack overflow in is_ty_uninhabited_from 2023-03-28 15:45:35 +03:30
Lukas Wirth
342fd2b9f3 fix: Properly handle local trait impls 2023-03-28 08:34:29 +02:00
bors
3321799e8f Auto merge of #14368 - HKalbasi:mir, r=HKalbasi
MIR episode 3

This PR adds lowering for try operator and overloaded dereference, and adds evaluating support for function pointers and trait objects. It also adds a flag to `analysis-stats` to show percentage of functions that it fails to emit mir for them, which is currently `20%` (which is somehow lying, as most of the supported `80%` are tests). The most offenders are closure (1975 items) and overloaded index (415 items). I will try to add overloaded index before monday to have it in this PR, and tackle the closure in the next episode.
2023-03-21 19:57:27 +00:00
hkalbasi
8a3ad7c3d5 Support evaluating inherent associated constants with generics 2023-03-21 02:20:30 +03:30
hkalbasi
3303a6eff5 Implement some intrinsics 2023-03-20 21:48:01 +03:30
hkalbasi
8e73ea5253 Desugar try blocks 2023-03-19 13:02:51 +03:30
Ryo Yoshida
e12460bbca
Add regression test
so that we can catch regressions when we move away from chalk.
2023-03-19 16:58:10 +09:00
Ryo Yoshida
1d1a86f350
Bump chalk to 0.89 2023-03-19 16:45:26 +09:00
hkalbasi
453ae2e00e Support range MIR lowering 2023-03-18 02:06:36 +03:30
hkalbasi
9ad83deecc Support overloaded index MIR lowering 2023-03-17 19:10:25 +03:30
hkalbasi
eb4939e217 Support overloaded deref MIR lowering 2023-03-17 14:02:55 +03:30
hkalbasi
9564773d5e Improve pattern matching MIR lowering 2023-03-17 13:08:36 +03:30
hkalbasi
051dae2221 Support record pattern MIR lowering 2023-03-17 13:08:36 +03:30
hkalbasi
513e340bd3 implement transmute intrinsic 2023-03-17 13:08:36 +03:30
hkalbasi
7525a38af5 Support evaluating dyn Trait methods 2023-03-17 13:08:35 +03:30
hkalbasi
a063f000ff Support function pointer MIR lowering 2023-03-17 13:08:35 +03:30
hkalbasi
b7b9ae59a0 desugar ? operator 2023-03-17 13:08:35 +03:30
Lukas Wirth
3bf07a5f04 Simplify 2023-03-15 13:54:06 +01:00
Zachary S
af175ddcdc Add test for async closure types.
(rebased onto 6dfd8ae)
2023-03-15 13:10:35 +01:00
Zachary S
6746a08b44 fix: Fix return type of async closures.
(rebased onto 6dfd8ae)
2023-03-15 13:10:00 +01:00
Lukas Wirth
510e4b4029 Simplify 2023-03-14 20:22:11 +01:00
Lukas Wirth
f34b2469bd lint incoherent inherent impls 2023-03-14 19:20:44 +01:00
bors
6a98e961f8 Auto merge of #14340 - Veykril:expand, r=lnicola
internal: Rename AstDatabase to ExpandDatabase
2023-03-14 09:37:54 +00:00
hkalbasi
d7da9e64d1 Add storage dead for let bindings without initializer 2023-03-14 12:15:16 +03:30
Lukas Wirth
9fb9ee3b6a internal: Rename AstDatabase to ExpandDatabase 2023-03-13 16:35:41 +01:00
Laurențiu Nicola
bdbd2a59b0 Merge branch 'master' into sync-from-rust 2023-03-13 10:21:53 +02:00