Commit Graph

692 Commits

Author SHA1 Message Date
Dawer
5f2486e9a8 Handle impl ?Sized. Fix tests. 2021-08-04 20:20:10 +05:00
Dawer
421979bc68 HirDisplay prints ?Sized bounds now; impl Trait: Sized by default. 2021-08-04 20:05:46 +05:00
Dawer
d9e6377b91 adjust hir_def::TypeBound::as_path 2021-08-04 19:49:19 +05:00
Dawer
b217e9cc50 add implicit Sized bound to associated types 2021-08-04 19:41:05 +05:00
Dawer
8f2a040d10 add implicit sized to impl Trait parameters 2021-08-04 19:40:57 +05:00
Dawer
72002b401d internal: allow ambiguous unsize coercion. 2021-08-04 19:15:23 +05:00
Dawer
3981373b93 internal: add implicit Sized bounds to type parameters. 2021-08-04 19:04:21 +05:00
Aleksey Kladov
12d7f5b56e internal: explain that we don't ref in style.md 2021-08-02 15:59:28 +03:00
Lukas Wirth
1edbaa29f9 Wrap inner tail expressions in MissingOkOrSomeInTailExpr 2021-07-31 20:00:09 +02:00
bors[bot]
8232804d3e
Merge #9706
9706: minor: perf and grammar fixes r=lnicola a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-07-29 16:14:10 +00:00
Alexander Gonzalez
e57ad5456c fix: Typos 2021-07-27 18:31:21 -04: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
bors[bot]
0bee7cb716
Merge #9453
9453: Add first-class limits. r=matklad,lnicola a=rbartlensky

Partially fixes #9286.

This introduces a new `Limits` structure which is passed as an input
to `SourceDatabase`. This makes limits accessible almost everywhere in
the code, since most places have a database in scope.

One downside of this approach is that whenever you query limits, you
essentially do an `Arc::clone` which is less than ideal.

Let me know if I missed anything, or would like me to take a different approach!

Co-authored-by: Robert Bartlensky <bartlensky.robert@gmail.com>
2021-07-22 10:33:05 +00:00
Jonas Schievink
837eec8dab filter visiblities when resolving in extern crate 2021-07-21 17:51:56 +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
Robert Bartlensky
0b3d0cde8b Add Limit struct.
Fixes #9286.
2021-07-19 13:26:11 +01:00
Florian Diebold
ae22050a42 Determine expected parameters from expected return in calls
Fixes #9560
2021-07-18 20:56:44 +02:00
Florian Diebold
eb2cc1036a Adapt tests for correct behavior 2021-07-15 20:02:48 +02:00
Florian Diebold
44d3c32922 Add test for #9560 2021-07-11 16:14:39 +02:00
bors[bot]
f83f069f94
Merge #9552
9552: internal: `add_explicit_type` respects coercions r=Veykril a=Veykril

or so I'd like to say but there is one odd case here where it doesn't work(see [review](https://github.com/rust-analyzer/rust-analyzer/pull/9552#discussion_r667351856))

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6107

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-10 16:25:58 +00:00
Lukas Wirth
576e3a4e12 add_explicit_type respects coercions 2021-07-10 18:19:46 +02:00
Lukas Wirth
d5a43d1f85 Resolve type adjustments 2021-07-10 18:19:23 +02:00
Laurențiu Nicola
df729eda69 Bump chalk 2021-07-10 18:58:14 +03:00
bors[bot]
10273a7d63
Merge #9545
9545: Record autoderef adjustments r=flodiebold a=Veykril

cc #9475

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-10 10:27:16 +00:00
Lukas Wirth
69e6511820 Record autoderef adjustments 2021-07-10 12:26:18 +02:00
bors[bot]
eab5d985ec
Merge #9512
9512: Record coercion adjustments r=Veykril a=Veykril

cc https://github.com/rust-analyzer/rust-analyzer/issues/9475

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-09 14:07:23 +00:00
Lukas Wirth
9272942b92 Use CoerceMany in BreakableContext 2021-07-09 15:51:07 +02:00
Florian Diebold
d674d7185d Represent opaque types with TyKind::OpaqueType
... instead of using `AliasTy`. Chalk turns the alias type into the
placeholder during unification anyway, which confuses our method
resolution logic.

Fixes #9530.
2021-07-08 21:40:35 +02:00
Lukas Wirth
e968d834ca Add some more adjustment test annotations 2021-07-08 15:03:57 +02:00
Lukas Wirth
349f2535fb Copy some comments from rustc 2021-07-08 14:31:16 +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
Aleksey Kladov
86720f2953 minor: drop dummy authors field 2021-07-05 14:19:41 +03:00
bors[bot]
16871f6f93
Merge #9428
9428: fix: Fix deduction of `dyn Fn` closure parameter types r=flodiebold a=jonas-schievink



Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-07-02 12:49:34 +00: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
Lukas Wirth
af739731db Implement TypeRef::ForLifetime 2021-06-30 01:34:54 +02:00
Florian Diebold
a1120b6879 Fix benchmark_include_macro 2021-06-20 19:37:45 +02:00
Florian Diebold
78419779f1 More cleanups, use check for display_source_code tests 2021-06-20 19:12:06 +02:00
Florian Diebold
0219b145ea Clean up coercion tests 2021-06-20 19:12:06 +02:00
Florian Diebold
04fbdce426 Unify check_mismatches and check_types 2021-06-20 19:12:06 +02:00
Florian Diebold
679bb21633 Add coverage mark for block local impls 2021-06-20 19:12:06 +02:00