Commit graph

28 commits

Author SHA1 Message Date
Chayim Refael Friedman
287a6e9482 Properly handle normalization
Previously normalization was broken, which caused a lot of fake errors.

This fix most type mismatches of the new solver, and it also reverts many test regressions.

The downside is that now `chalk_ir::TyKind::AssociatedType`/`chalk_ir::TyKind::Alias` cannot be trusted anymore with their roles, namely: `AssociatedType` is always fully normalized and `Alias` only if it can possibly be normalized further. That seems okay as the new solver does not have this distinction at all (due to it being a lazy normalizer), so this will only hold for the migration time. This does mean we have to change some APIs, notably `hir::Type::walk()` and `TyFingerprint`, to treat `Alias` the same as `AssociatedType`.

Another small thing this commit does is to isolate processing of user-written types (currently involving replacing error types and normalizing, but in the future validation will also be needed) to separate functions.
2025-09-10 03:32:06 +03:00
Shoyu Vanilla
4a8bc8db38 Fix failing tests and fill-in missing details 2025-09-10 01:43:22 +09:00
Jake
5cba3e72bc
hir-ty: change struct constructor formatting.
before, when formatting struct constructor for `struct S(usize, usize)` it would format as:

    extern "rust-call" S(usize, usize) -> S

but after this change, we'll format as:

    fn S(usize, usize) -> S
2024-10-08 11:05:03 -07:00
Lukas Wirth
fbca403ebe fix: Fix lowering of for loops dropping the loop block 2024-09-04 12:00:16 +02:00
Lukas Wirth
f2fa456a8c Fix incorrect handling of cfg'd varargs 2024-07-25 11:02:19 +02:00
beetrees
d5db933f9d
Add f16 and f128 support 2024-07-10 10:43:14 +01:00
Lukas Wirth
31304ad1ad Drop unknown lifetimes when rendering generic args 2024-04-24 21:22:48 +02:00
Lukas Wirth
8078c3d9e8 Bump chalk 2024-04-08 11:03:19 +02:00
dfireBird
490391f576
fix HirDisplay inserting anonymous lifetimes and update tests 2024-03-18 17:18:08 +05:30
Shoyu Vanilla
46cdce1b53 Update expectation tests 2024-02-27 00:18:40 +09:00
Lukas Wirth
3a722bdf2e feat:Record FnAbi 2024-01-19 15:15:23 +01:00
austaras
bd61888b8d fix: resolve alias before resolve variant 2023-12-18 22:31:58 +08:00
hkalbasi
4f722165b6 Fix false positive type mismatch in const reference patterns 2023-12-15 19:09:07 +03:30
austaras
2411f1383a fix variant resolve for type alias 2023-11-26 21:00:11 +08:00
hkalbasi
5531d46c95 Emit '_ for lifetime generics in HirDisplay 2023-06-05 10:55:47 +03:30
hkalbasi
51368793b4 MIR episode 6 2023-05-28 23:25:15 +03:30
Ryo Yoshida
01f42d2405
fix: introduce new type var when expectation for ref pat is not ref 2023-05-22 23:13:41 +09:00
hkalbasi
59b6f2d9f2 Compute closure captures 2023-04-10 23:04:34 +03:30
Ryo Yoshida
5ab4e64a4c
fix: unify types in infer_expr_coerce_never() 2023-04-07 05:46:30 +09:00
Lukas Wirth
b85e2af898 Correctly handle non-semi statement expressions for never coercions 2023-03-04 19:48:03 +01:00
Lukas Wirth
ec273c3d12 Split pattern inference into more functions 2023-03-03 10:42:46 +01:00
Lukas Wirth
fc2b395e00 Show pattern mismatch diagnostics 2023-03-03 10:41:44 +01:00
Crauzer
b3bd5a471e implement vararg type collection from function params 2022-11-29 00:32:13 +01:00
Lukas Wirth
63ed71bd30 Honor cfg attributes on params when lowering their patterns 2022-10-10 09:47:09 +02:00
Ryo Yoshida
dac27679f7
fix: resolve path Self alone in value namespace 2022-08-18 20:12:59 +09:00
Ryo Yoshida
ffc6b42901
fix: infer byte string pattern as &[u8] when matched against slices 2022-08-10 19:17:13 +09:00
Roland Ruckerbauer
86bb27f1a4 Fix inference when pattern matching a tuple field with a wildcard. 2022-05-23 12:24:54 +02:00
Peh
1f011fa4a3 style: rename crates to kebab case 2022-05-01 10:48:58 +00:00
Renamed from crates/hir_ty/src/tests/patterns.rs (Browse further)