Skip to content

Commit 1ffeb23

Browse files
committed
Fix an error in the example with type
`type` is a keyword and can't be used here.
1 parent 004472b commit 1ffeb23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/attributes/type_system.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ Because a tuple enum variant's constructor's [visibility] is reduced to be no gr
164164
> // Cannot match on a non-exhaustive struct enum variant without including a wildcard.
165165
> Message::Send { from, to, contents } => { },
166166
> // Cannot match on a non-exhaustive tuple or unit enum variant.
167-
> Message::Reaction(type) => { },
168167
> Message::Quit => { },
168+
> Message::Reaction(x) => { },
169169
170170
r[attributes.type-system.non_exhaustive.enum-exhaustiveness]
171171
When using a [`match` expression][expr.match] on a non-exhaustive [`enum`][enum] from an external crate, matching on a variant does not contribute towards the exhaustiveness of the arms. A [`_` wildcard][patterns.wildcard] arm is needed to make the match exhaustive.

0 commit comments

Comments
 (0)