Skip to content

Commit 8fa971a

Browse files
committed
Merge pull request #1134 from snorr/master
Fix typos and update syntax in RFC 164
2 parents 4bd1848 + e84d654 commit 8fa971a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

text/0164-feature-gate-slice-pats.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44

55
# Summary
66

7-
Rust's support for pattern matching on sices has grown steadily and incrementally without a lot of oversight,
8-
and we have concern that Rust is doing too much here, that the complexity is not worth it. This RFC proposes
9-
to feature gate multiple-element slice matches in the head and middle positions (`[..xs, 0, 0]` and `[0, ..xs, 0]`.
7+
Rust's support for pattern matching on slices has grown steadily and incrementally without a lot of oversight.
8+
We have concern that Rust is doing too much here, and that the complexity is not worth it. This RFC proposes
9+
to feature gate multiple-element slice matches in the head and middle positions (`[xs.., 0, 0]` and `[0, xs.., 0]`).
1010

1111
# Motivation
1212

13-
Some general reasons and one specific: first, the implementation of Rust's match machinery is notoriously complex, and not well-loved. Remove features is seen as a valid way to reduce complexity. Second, slice matching in particular, is difficult to implement, while also being of only moderate utility (there are many types of collections - slices just happen to be built into the language). Finally, the exhaustiveness check is not correct for slice patterns - because of their complexity; it's not known that it
14-
can be done correctly, nor whether it is worth the effort even if.
13+
Some general reasons and one specific: first, the implementation of Rust's match machinery is notoriously complex, and not well-loved. Removing features is seen as a valid way to reduce complexity. Second, slice matching in particular, is difficult to implement, while also being of only moderate utility (there are many types of collections - slices just happen to be built into the language). Finally, the exhaustiveness check is not correct for slice patterns because of their complexity; it's not known if it
14+
can be done correctly, nor whether it is worth the effort to do so.
1515

1616
# Detailed design
1717

18-
The `advanced_slice_patterns` feature gate will be added. When the compiler encounters slice pattern matches in head or middle position it will emit a warning or error accourding to the current settings.
18+
The `advanced_slice_patterns` feature gate will be added. When the compiler encounters slice pattern matches in head or middle position it will emit a warning or error according to the current settings.
1919

2020
# Drawbacks
2121

0 commit comments

Comments
 (0)