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
Florian Diebold
b26a472ccb
Fix type mismatch caused by macros
...
MacroStmts should be completely transparent, but it prevented
coercion. (I should maybe give `infer_expr` and `infer_expr_inner`
better names.)
2021-05-25 11:15:02 +02:00
Florian Diebold
4a6cdd776d
Record method call substs and use them in call info
2021-05-23 18:24:21 +02:00
Florian Diebold
63614aafad
Resolve any lifetime variables to 'static after inference
...
Chalk's unification can sometimes create lifetime variables, which we
currently don't really deal with, but at least we don't want to leak
them outside of inference.
Should fix #8919 .
2021-05-22 14:27:22 +02:00
Florian Diebold
ef558c97d0
Clean up visibilities
2021-05-21 19:51:21 +02:00
Florian Diebold
67f1a08fd8
Some remaining cleanups
2021-05-21 18:23:03 +02:00
Florian Diebold
6e5637983c
Record type mismatches for failed coercions in match etc.
2021-05-21 18:23:03 +02:00
Florian Diebold
556c9cebdb
Refactor expectation handling
...
So as to not use `TyKind::Error` as "no expectation".
2021-05-21 18:23:03 +02:00
Florian Diebold
99c73537fa
Remove TypeVariableTable
2021-05-21 17:49:09 +02:00
Florian Diebold
9716c0b949
Deal with goals arising from unification
2021-05-21 17:49:09 +02:00
Florian Diebold
4bd446f5b3
Get rid of resolve_ty_as_possible
...
Instead use shallow resolving where necessary.
2021-05-21 17:49:07 +02:00
Florian Diebold
a78f0076ab
Make resolve_ty_shallow return Ty
2021-05-21 17:48:34 +02:00
Florian Diebold
1250ddc5cf
Rework obligation handling
...
We can't do the easy hack that we did before anymore, where we kept
track of whether any inference variables changed since the last time we
rechecked obligations. Instead, we store the obligations in
canonicalized form; that way we can easily check the inference variables
to see whether they have changed since the goal was canonicalized.
2021-05-21 17:48:34 +02:00
Florian Diebold
a3d9cac690
Fix another panic
2021-05-21 17:48:34 +02:00
Florian Diebold
7c423f5b88
Fix panic
2021-05-21 17:48:34 +02:00
Florian Diebold
8397734cfe
Fix HIR expecting errors to unify with anything
2021-05-21 17:48:34 +02:00
Florian Diebold
b939a6dcac
Fix if/else coercion
2021-05-21 17:48:34 +02:00
Florian Diebold
212f0477f2
Make diverging type variables work again
...
Chalk doesn't know about the `diverging` flag, so we need to instead
propagate it before fully resolving the variables.
2021-05-21 17:48:34 +02:00
Florian Diebold
32fc944263
Fix handling of diverging branches in match coercion
...
Fixes #7626 .
2021-05-21 17:48:34 +02:00