Commit graph

11610 commits

Author SHA1 Message Date
Dawer
e16f413582 eprint panic context 2021-06-01 00:49:44 +05:00
Dawer
f571b62a13 minor: doc comment pat_util 2021-06-01 00:49:44 +05:00
Dawer
977ba46bb1 Test match guards, reference patterns 2021-06-01 00:49:44 +05:00
Dawer
4cce7a6407 Box field detection; test #[non-exhaustive] attribute 2021-06-01 00:49:44 +05:00
Dawer
f46a42f73a Better tests: check if match checking bails out. 2021-06-01 00:49:27 +05:00
Dawer
e84efc4a46 Replace the old match checking algorithm 2021-06-01 00:23:09 +05:00
Dawer
894b4c64ff Include old tests 2021-06-01 00:08:43 +05:00
Dawer
7d675eda80 Don't panic on a pattern of unresolved ADT variant. 2021-06-01 00:08:43 +05:00
Dawer
466345ca81 Clean up, more docs. 2021-06-01 00:08:27 +05:00
Dawer
49e016169f Check pattern types. 2021-06-01 00:03:47 +05:00
Dawer
9b841a9a04 Expand binding patterns. 2021-06-01 00:03:47 +05:00
Dawer
d7239e5ab4 Fix visibility warnings 2021-06-01 00:03:47 +05:00
Dawer
a236bfa57a Lower binding pattern 2021-06-01 00:03:47 +05:00
Dawer
cf6f989a8d Lower bool literals 2021-06-01 00:03:47 +05:00
Dawer
d6d77e8a35 Treat ctor of unhandled type as non-exhaustive. 2021-06-01 00:03:47 +05:00
Dawer
e711abc290 Lower Pat::Path 2021-06-01 00:03:47 +05:00
Dawer
e50ce67631 Do not do match check if lowering failed. 2021-06-01 00:03:47 +05:00
Dawer
de6f430140 Fix panics on pattern_arena.borrow with ugly cloning 2021-06-01 00:03:46 +05:00
Dawer
975109051c Basic lowering hir_def::exrp::Pat -> typed HIR.
Pattern arena is broken
2021-06-01 00:03:46 +05:00
Dawer
2431ff5987 Handle unordered fields in struct patterns 2021-06-01 00:03:46 +05:00
Dawer
3ffcb2658c Complete field replacing 2021-06-01 00:03:46 +05:00
Dawer
3a85e47f6a Support bool literal patterns 2021-06-01 00:03:46 +05:00
Dawer
5a8a0b6269 Check enum patterns 2021-06-01 00:03:46 +05:00
Dawer
b4f4197332 Build wildcard witnesses instead of panicking 2021-06-01 00:03:46 +05:00
Dawer
678d85ca7e Implement struct ctor application 2021-06-01 00:03:46 +05:00
Dawer
062c7953a1 Add remaining Constructor variants 2021-06-01 00:03:46 +05:00
Dawer
2880fd2320 Complete usefulness::SubPatSet impl 2021-06-01 00:03:46 +05:00
Dawer
f4c3960364 List useless patterns in a useful match arm 2021-06-01 00:03:45 +05:00
Dawer
f4a95c93fe Remove unneeded indirection on PatCtxt 2021-06-01 00:03:45 +05:00
Dawer
26baab5d28 Enable generation of non-exhaustiveness witnesses 2021-06-01 00:03:45 +05:00
Dawer
c3c2893f30 Update match checking.
fn is_useful , more skeletons

Specify a lifetime on pattern references

impl PatStack

fill impl Matrix

PatStack::pop_head_constructor

Index-based approach

struct PatCtxt

fields construction fn Fields::wildcards

split wildcard

fn Constructor::is_covered_by_any(..)

fn Matrix::specialize_constructor(..)

impl Usefulness

Initial work on witness construction

Reorganize files

Replace match checking diagnostic

Handle types of expanded patterns

unit match checking go brrr
2021-06-01 00:03:45 +05:00
bors[bot]
7c1d8ca635
Merge #9088
9088: minor: remove debug print r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-05-31 17:22:09 +00:00
Aleksey Kladov
ee51bf04be minor: remove debug print 2021-05-31 20:20:30 +03:00
bors[bot]
4cb4b23dc6
Merge #9084 #9087
9084: fix: avoid panics in match case diagnostic r=matklad a=matklad

bors r+
🤖

closes #8809

9087: fix: fix shell injection in task spawning r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-05-31 17:12:01 +00:00
Jonas Schievink
b5fe4c6ef0 Use cargo check again 2021-05-31 18:58:36 +02:00
Aleksey Kladov
159922de93 minor: it's Parameter, not Argument 2021-05-31 19:45:50 +03:00
Aleksey Kladov
341f8bb200 fix: avoid panics in match case diagnostic 2021-05-31 19:45:50 +03:00
bors[bot]
10b15b27f2
Merge #8952
8952: add support of impl block for doctest into runnables r=matklad a=bnjjj

close #6356 

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2021-05-31 15:48:41 +00:00
Jonas Schievink
cfcadcb295 Simplify proc_macro_srv tests 2021-05-31 17:32:56 +02:00
bors[bot]
c460baeaf3
Merge #9079
9079: Don't take the parent kind of trailing attributes in attr completion r=Veykril a=Veykril

bors r+
fixes https://github.com/rust-analyzer/rust-analyzer/issues/9076

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-31 13:38:32 +00:00
Lukas Wirth
741b2f531f Don't take the parent kind of trailing attributes in attr completion 2021-05-31 15:35:22 +02:00
bors[bot]
e6ec860363
Merge #9039
9039: feat: Complete fields and methods with `self.` prefixed when inside methods r=matklad a=Veykril


![w65NbjkZiG](https://user-images.githubusercontent.com/3757771/119984385-a0111700-bfc1-11eb-9dbf-52fdaa4d72b5.gif)
Closes #7173

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-31 13:21:31 +00:00
Lukas Wirth
fb7105a580 Add config setting for self-on-the-fly 2021-05-31 15:14:56 +02:00
Lukas Wirth
4507382f2e Move unprefixed field/method completion to dot 2021-05-31 15:10:20 +02:00
Lukas Wirth
d346f5bf75 Less strings, more hir::Names 2021-05-31 14:55:16 +02:00
Lukas Wirth
ca49fbe0a1 Complete self. prefixed fields and methods inside methods 2021-05-31 14:52:55 +02:00
bors[bot]
e9a797748d
Merge #8866
8866: Update salsa r=matklad a=jonas-schievink

This updates salsa to include https://github.com/salsa-rs/salsa/pull/265, and removes all cancellation-related code from rust-analyzer

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-31 12:42:32 +00:00
bors[bot]
b8d269990c
Merge #9060
9060: feat: Diagnose unimplemented built-in macros r=matklad a=jonas-schievink

A number of built-in attribute macros are unsupported, I thought it might be useful to put a diagnostic on their definition in libcore. Not sure.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-31 12:34:01 +00:00
Lukas Wirth
971b0836ef Use Names instead of Strings in the completion rendering api 2021-05-31 14:15:15 +02:00
bors[bot]
3cb3f1d17b
Merge #9025
9025: internal: Display unknown types in `analysis-stats` r=flodiebold a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-05-31 08:20:28 +00:00