Commit Graph

37 Commits

Author SHA1 Message Date
Eric Mark Martin 82bc771cda add comment back 2023-06-28 01:51:53 -04:00
Eric Mark Martin 3450bdf7f3 add note for non-exhaustive matches with guards 2023-06-28 01:51:53 -04:00
Michael Goulet d655086a0c Revert "Structurally resolve correctly in check_pat_lit"
This reverts commit d6d10ddda6.
2023-06-24 18:41:27 +00:00
Oli Scherer 9043823a5a Only rewrite valtree-constants to patterns and keep other constants opaque 2023-05-31 14:02:57 +00:00
Matthias Krüger 8fb6099e9a Rollup merge of #111558 - c410-f3r:t3st3ss, r=WaffleLapkin
Move tests

r? `@petrochenkov`
2023-05-29 21:34:16 +02:00
Camille GILLOT e1a4b693ca Add NOTE annotations. 2023-05-25 18:17:02 +00:00
Camille GILLOT 4c7f97e41e Add inter-crate test. 2023-05-25 17:04:14 +00:00
Caio 5424ca1c27 Move tests 2023-05-24 19:35:59 -03:00
Urgau da32210204 Rename drop_ref lint to dropping_references 2023-05-21 14:16:41 +02:00
Urgau dcf1795512 Rename drop_copy lint to dropping_copy_types 2023-05-21 13:37:32 +02:00
bors bc32adad0b Auto merge of #105750 - oli-obk:valtrees, r=lcnr
Always fall back to PartialEq when a constant in a pattern is not recursively structural-eq

Right now we destructure the constant as far as we can, but with this PR we just don't take it apart anymore. This is preparatory work for moving to always using valtrees, as these will just do a single conversion of the constant to a valtree at the start, and if that fails, fall back to `PartialEq`.

This removes a few cases where we emitted the `unreachable pattern` lint, because we stop looking into the constant deeply enough to detect that a constant is already covered by another pattern.

Previous work: https://github.com/rust-lang/rust/pull/70743

This is groundwork towards fixing https://github.com/rust-lang/rust/issues/83085 and https://github.com/rust-lang/rust/issues/105047
2023-05-16 13:10:24 +00:00
Nilstrieb 36d6a63950 Rollup merge of #111428 - bvanjoi:fix-109250, r=Nilstrieb
refactor(resolve): clean up the early error return caused by non-call

closes https://github.com/rust-lang/rust/issues/109250

It seems no bad happened, r? ``@Nilstrieb``
2023-05-16 11:39:38 +02:00
Oli Scherer 877c7e9fa1 Always fall back to PartialEq when a constant in a pattern is not recursively structural-eq 2023-05-15 14:20:31 +00:00
Urgau 15096038c6 Adjust tests for new drop and forget lints 2023-05-10 19:36:02 +02:00
bohan 2f814644c9 refactor(resolve): clean up the early error return caused by non-call 2023-05-10 22:35:01 +08:00
Ezra Shaw 06f01d0c0f tweak spans for ref mut suggestion 2023-05-05 22:40:05 +12:00
yukang 5afa27c67b fix tests 2023-05-01 16:15:17 +08:00
Nilstrieb 4a65efc7e8 Rip it out
My type ascription
Oh rip it out
Ah
If you think we live too much then
You can sacrifice diagnostics
Don't mix your garbage
Into my syntax
So many weird hacks keep diagnostics alive
Yet I don't even step outside
So many bad diagnostics keep tyasc alive
Yet tyasc doesn't even bother to survive!
2023-05-01 16:15:13 +08:00
Oli Scherer f79bdb9a33 Run check_match and check_liveness when MIR is built instead of having an explicit phase for them 2023-04-21 22:32:38 +00:00
Camille GILLOT def7dd3d9c Reinstate confusion note. 2023-04-03 15:59:21 +00:00
Camille GILLOT b6ccedde88 Perform match checking on THIR. 2023-04-03 15:59:21 +00:00
Camille GILLOT c5c3f7e806 Shrink binding span. 2023-04-03 15:59:21 +00:00
Jamen Marz 635fd65763 Add notes to non-structural const in pattern error message 2023-03-27 11:08:11 -04:00
Ezra Shaw 531a1e00ec error-msg: impl better suggestion for E0532 2023-03-15 22:19:54 +13:00
Vadim Petrochenkov cde9e9d7ec resolve: Remove struct_field_names_untracked 2023-03-13 17:31:55 +04:00
Esteban Küber 5eb6468cef Modify primary span label for E0308
The previous output was unintuitive to users.
2023-01-30 20:12:19 +00:00
Matthias Krüger 6f970db125 Rollup merge of #106978 - mejrs:mir_build3, r=davidtwco
Migrate mir_build's borrow conflicts

This also changes the error message slightly, for two reasons:

- I'm not a fan of saying "value borrowed, by `x`, here"
- it simplifies the error implementation significantly.
2023-01-26 15:02:20 +01:00
Matthias Krüger 75d1d276bd Rollup merge of #106897 - estebank:issue-99430, r=davidtwco
Tweak E0597

CC #99430
2023-01-25 22:19:52 +01:00
--global ac6454ed96 Change bindings_with_variant_name to deny-by-default 2023-01-20 02:26:12 -05:00
mejrs 8d591b2212 Migrate mir_build's borrow conflicts 2023-01-17 13:48:43 +01:00
Esteban Küber e775d95135 Tweak E0597
CC #99430
2023-01-15 19:46:20 +00:00
Ezra Shaw 2d97c581d8 suggest fix for attempted integer identifier in patterns 2023-01-14 12:51:20 +13:00
mejrs 70d2e86bcc Translate Overlap eagerly 2023-01-11 14:40:13 -08:00
mejrs b67adfa326 Don't recommend if let if let else works 2023-01-11 14:40:07 -08:00
mejrs d09f21f498 Migrate pattern matching 2023-01-11 14:40:02 -08:00
mejrs d3dde881c1 Migrate deconstruct_pat.rs 2023-01-11 14:39:49 -08:00
Albert Larsan 8f6b5d4e26 Move /src/test to /tests 2023-01-11 09:32:08 +00:00