Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 87de2da

Browse files
committedJan 20, 2025
parse pinned local variable declarations
1 parent 73c0ae6 commit 87de2da

File tree

48 files changed

+389
-84
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+389
-84
lines changed
 

‎compiler/rustc_mir_build/src/thir/pattern/check_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ fn check_for_bindings_named_same_as_variants(
876876
) {
877877
if let PatKind::Binding {
878878
name,
879-
mode: BindingMode(ByRef::No, Mutability::Not),
879+
mode: BindingMode(ByRef::No, _, Mutability::Not),
880880
subpattern: None,
881881
ty,
882882
..

‎compiler/rustc_parse/messages.ftl

+7
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,8 @@ parse_note_mut_pattern_usage = `mut` may be followed by `variable` and `variable
663663
664664
parse_note_pattern_alternatives_use_single_vert = alternatives in or-patterns are separated with `|`, not `||`
665665
666+
parse_note_pin_pattern_usage = `pin mut` or `pin const` may be followed by `variable` and `variable @ pattern`
667+
666668
parse_nul_in_c_str = null characters in C string literals are not supported
667669
668670
parse_or_pattern_not_allowed_in_fn_parameters = top-level or-patterns are not allowed in function parameters
@@ -698,6 +700,11 @@ parse_pattern_on_wrong_side_of_at = pattern on wrong side of `@`
698700
.label_binding = binding on the right, should be on the left
699701
.suggestion = switch the order
700702
703+
parse_pin_on_nested_ident_pattern = `pin {$mutbl}` must be attached to each individual binding
704+
.suggestion = add `pin {$mutbl}` to each binding
705+
parse_pin_on_non_ident_pattern = `pin {$mutbl}` must be followed by a named binding
706+
.suggestion = remove the `pin {$mutbl}` prefix
707+
701708
parse_question_mark_in_type = invalid `?` in type
702709
.label = `?` is only allowed on expressions, not types
703710
.suggestion = if you meant to express that the type might not contain a value, use the `Option` wrapper type
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.