diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-09-06 15:23:55 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-09-08 16:12:13 -0700 |
| commit | eb678ff87f0cdbf523b26fe9255cff684b4091e5 (patch) | |
| tree | 9fb3745051a57fd5f73d6d50aabf07ce9d2f6ea4 /src/libsyntax/parse/obsolete.rs | |
| parent | 6f34760e4173dda94162502153fe4c5a2a96fc9d (diff) | |
| download | rust-eb678ff87f0cdbf523b26fe9255cff684b4091e5.tar.gz rust-eb678ff87f0cdbf523b26fe9255cff684b4091e5.zip | |
librustc: Change the syntax of subslice matching to use postfix `..`
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]
Diffstat (limited to 'src/libsyntax/parse/obsolete.rs')
| -rw-r--r-- | src/libsyntax/parse/obsolete.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index 5273addf4f5..ec6fd013d08 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -35,6 +35,7 @@ pub enum ObsoleteSyntax { ObsoleteManagedType, ObsoleteManagedExpr, ObsoleteImportRenaming, + ObsoleteSubsliceMatch, } pub trait ParserObsoleteMethods { @@ -87,6 +88,10 @@ impl<'a> ParserObsoleteMethods for parser::Parser<'a> { ObsoleteImportRenaming => ( "`use foo = bar` syntax", "write `use bar as foo` instead" + ), + ObsoleteSubsliceMatch => ( + "subslice match syntax", + "instead of `..xs`, write `xs..` in a pattern" ) }; |
