Laurențiu Nicola
24eca25d8a
Make some functions non-generic
2021-10-20 20:20:17 +03:00
Jonas Schievink
f8acae7895
Support let...else
2021-10-07 17:06:24 +02:00
Aramis Razzaghipour
9583dd5725
Replace if let
with match
where appropriate
2021-10-05 09:00:21 +11:00
Florian Diebold
a2d9f7d7bb
Avoid type inference panic on bitslice methods
...
Should fix #10090 , #10046 , #10179 .
This is only a workaround, but the proper fix requires some bigger
refactoring (also related to fixing #10058 ), and this at least prevents
the crash.
2021-09-12 10:49:40 +02:00
Lukas Wirth
36a5ce9790
minor: fix some clippy lints
2021-09-03 16:00:50 +02:00
bors[bot]
25368d2430
Merge #9954
...
9954: feat: Show try operator propogated types on ranged hover r=matklad a=Veykril
Basically this just shows the type of the inner expression of the `?` expression as well as the type of the expression that the `?` returns from:
![Code_wIrCxMqLH9](https://user-images.githubusercontent.com/3757771/130111025-f7ee0742-214a-493b-947a-b4a671e4be92.png )
Unless both of these types are `core::result::Result` in which case we show the error types only.
![Code_Xruw5FCBNI](https://user-images.githubusercontent.com/3757771/130111024-f9caef82-92e4-4070-b3dd-f2ff9e5d87a9.png )
If both types are `core::option::Option` with different type params we do not show this special hover either as it would be pointless(instead fallback to default type hover)
Very much open to changes to the hover text here(I suppose we also want to show the actual type of the `?` expression, that is its output type?).
Fixes #9931
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-01 09:26:10 +00:00
Florian Diebold
424dda8113
Refactor & improve handling of overloaded binary operators
...
Fixes #9971 . Also records them as method resolutions, which we could use
later.
2021-08-22 17:35:50 +02:00
bors[bot]
9e3517f8f3
Merge #9975
...
9975: minor: Fix panic caused by #9966 r=flodiebold a=flodiebold
Chalk can introduce new type variables when doing lazy normalization, so we have to do the proper 'fudging' after all.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-08-21 18:07:36 +00:00
Florian Diebold
df77e2448c
Fix panic caused by #9966
...
Chalk can introduce new type variables when doing lazy normalization, so
we have to do the proper 'fudging' after all.
2021-08-21 20:07:07 +02:00
Laurențiu Nicola
104d6124d7
Handle coercion on binary operator RHS
2021-08-21 17:54:45 +03:00
Florian Diebold
1791a35f9f
Determine expected parameters from expected return in calls
...
Fixes #9560
2021-08-21 14:33:31 +02:00
Lukas Wirth
95923c7b29
Fix imports
2021-08-19 17:33:58 +02:00
Jonas Schievink
4757679b9a
feat: type inference for if-let guards
2021-08-14 00:09:30 +02:00
Jonas Schievink
d568e7686a
Support if let
match guards
2021-08-13 00:25:14 +02:00
Dawer
6c366ade00
Clean up
2021-08-12 21:20:28 +05:00
Dawer
de074fe636
Accept ambiguous unsize coercion only if it has definite guidance.
2021-08-11 22:09:32 +05:00
Dawer
72002b401d
internal: allow ambiguous unsize coercion.
2021-08-04 19:15:23 +05:00
Aleksey Kladov
12d7f5b56e
internal: explain that we don't ref
in style.md
2021-08-02 15:59:28 +03:00
Laurențiu Nicola
ea0014c500
Remove some redundant clones
2021-07-27 21:32:55 +03:00
Jonas Schievink
b596c32a41
Resolve tuple variants in value namespace
2021-07-22 13:40:18 +02:00
Florian Diebold
7c00ca2f51
Revert "Merge #9655 "
...
This reverts commit 8c8c6fb73d
, reversing
changes made to ec7b4cbf8f
.
2021-07-20 22:53:39 +02:00
Florian Diebold
ae22050a42
Determine expected parameters from expected return in calls
...
Fixes #9560
2021-07-18 20:56:44 +02:00
Lukas Wirth
69e6511820
Record autoderef adjustments
2021-07-10 12:26:18 +02:00
Lukas Wirth
9272942b92
Use CoerceMany
in BreakableContext
2021-07-09 15:51:07 +02:00
Lukas Wirth
f73d0ee439
Minor cleanup
2021-07-08 14:27:54 +02:00
Lukas Wirth
64a1b26b8d
Implement CoerceMany
2021-07-08 14:16:23 +02:00
Lukas Wirth
9779526d8f
Record coercion adjustments
2021-07-08 13:07:24 +02:00
Laurențiu Nicola
3b2602cbb2
Don't unify array elements with their arrays
2021-07-08 12:55:00 +03:00
Jonas Schievink
cb63b021ff
Implement LUB coercion of array elements
2021-07-07 22:50:20 +02:00
Jonas Schievink
835d1cec59
Substitute self type instead of fusing binders
2021-07-02 00:16:36 +02:00
Jonas Schievink
cee9a7e26a
Bind the right number of variables in the FnPointer
2021-07-01 20:54:25 +02:00
Jonas Schievink
e6fdb38d38
Use as_tuple()
2021-07-01 20:45:47 +02:00
Jonas Schievink
b5a2289676
Remove unneeded shifted_in
2021-06-30 15:45:00 +02:00
Jonas Schievink
b502a10b1e
update comment
2021-06-30 15:13:59 +02:00
Jonas Schievink
88a86d4ff9
Fix deduction of dyn Fn
closure parameter types
2021-06-30 15:04:04 +02:00
Laurențiu Nicola
e3ce88f6f2
Minor clippy perf fixes
2021-06-18 14:40:51 +03:00
Lukas Wirth
95c8c65139
Nest all the or-patterns!
2021-06-17 17:37:14 +02:00
bors[bot]
5a8ddb4b2d
Merge #9260
...
9260: tree-wide: make rustdoc links spiky so they are clickable r=matklad a=lf-
Rustdoc was complaining about these while I was running with --document-private-items and I figure they should be fixed.
Co-authored-by: Jade <software@lfcode.ca>
2021-06-14 07:16:48 +00:00
Jade
20b325c7d5
tree-wide: make rustdoc links spiky so they are clickable
2021-06-13 21:58:05 -07:00
Maan2003
5ac6804bb3
cargo fmt
2021-06-13 09:48:15 +05:30
Maan2003
aabd41cafc
clippy::redundant_field_names
2021-06-13 09:40:22 +05:30
Maan2003
c9b4ac5be4
clippy::redudant_borrow
2021-06-13 09:24:16 +05:30
Florian Diebold
20487a1b4a
Fix coercion in match with expected type
...
Plus add infrastructure to test type mismatches without expect.
2021-06-12 23:04:43 +02:00
bors[bot]
50936397cc
Merge #9105
...
9105: internal: calculate pattern adjustments r=flodiebold a=iDawer
This extends `InferenceResult` with `pub pat_adjustments: FxHashMap<PatId, Vec<Ty>>`.
Fixes #9095
Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
2021-06-03 09:55:37 +00:00
Lukas Wirth
ded4e7cc83
Fix bind patterns always being treated as ref taking patterns
2021-06-02 20:00:39 +02:00
Dawer
0a8c30a96f
internal: implement pattern adjustments.
2021-06-02 01:32:05 +05:00
cynecx
759cb07891
hir_ty: use correct receiver_ty in method resolution
2021-05-31 20:26:38 +02:00
Jonas Schievink
33debc4065
Update salsa
2021-05-27 15:05:41 +02:00
bors[bot]
f3aaae6555
Merge #9007
...
9007: Internal: `clippy::redundant_clone` fixes r=lnicola a=lnicola
bors r+
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-05-26 15:36:14 +00:00
Laurențiu Nicola
8206939fed
clippy::redundant_clone fixes
2021-05-26 18:34:50 +03:00