Skip to content

Conversation

pcwalton
Copy link
Contributor

@pcwalton pcwalton commented Sep 6, 2014

instead of prefix ...

This breaks code that looked like:

match foo {
    [ first, ..middle, last ] => { ... }
}

Change this code to:

match foo {
    [ first, middle.., last ] => { ... }
}

RFC #55.

Closes #16967.

[breaking-change]

r? @brson

@alexcrichton
Copy link
Member

r=me with a test for the new syntax and a test for the old syntax printing an error

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be mod_spans.len() >= 2 or > 1.

Which is arguably why I'd consider the older version a little clearer in that regard.

instead of prefix `..`.

This breaks code that looked like:

    match foo {
        [ first, ..middle, last ] => { ... }
    }

Change this code to:

    match foo {
        [ first, middle.., last ] => { ... }
    }

RFC rust-lang#55.

Closes rust-lang#16967.

[breaking-change]
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Sep 9, 2014
@bors bors merged commit eb678ff into rust-lang:master Sep 9, 2014
lnicola pushed a commit to lnicola/rust that referenced this pull request Apr 20, 2024
Revert "fix: set the right postfix snippets competion source range"

This reverts commit c5686c8.

Fix rust-lang#17036. See rust-lang/rust-analyzer#17036 (comment)
lnicola pushed a commit to lnicola/rust that referenced this pull request Apr 20, 2024
Revert "fix: set the right postfix snippets competion source range"

This reverts commit c5686c8.

Fix rust-lang#17036. See rust-lang/rust-analyzer#17036 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Futureproof subslice syntax

3 participants