diff options
| author | bors <bors@rust-lang.org> | 2016-02-14 06:18:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-02-14 06:18:10 +0000 |
| commit | 9d98390765bbe61ce2a39b40c99ae1a68bb6d1cc (patch) | |
| tree | 39f9e3130578f12a0090479173df5f25e1330e7e /src/libsyntax/parse/mod.rs | |
| parent | 09395bbfb0cacc6d53956c37cb85086bb8c837f2 (diff) | |
| parent | 9f414a44a747edc7dc229e0eaf6fbda5e6ea10e1 (diff) | |
Auto merge of #31581 - petrochenkov:patrefact, r=Manishearth
cc https://github.com/rust-lang/rust/pull/31487#issuecomment-182945101 plugin-[breaking-change] The first commit renames `ast::Pat_` to `ast::PatKind` and uses its variants in enum qualified form. I've also taken the opportunity and renamed `PatKind::Region` into `PatKind::Ref`. The second commit splits `PatKind::Enum` into `PatKind::TupleStruct` and `PatKind::UnitStruct`. So, pattern kinds now correspond to their struct/variant kinds - `Struct`, `TupleStruct` and `UnitStruct`. @nikomatsakis @nrc @arielb1 Are you okay with this naming scheme? An alternative possible naming scheme is `PatKind::StructVariant`, `PatKind::TupleVariant`, `PatKind::UnitVariant` (it's probably closer to the common use, but I like it less). I intend to apply these changes to HIR later, they should not necessarily go in the same nightly with https://github.com/rust-lang/rust/pull/31487 r? @Manishearth
Diffstat (limited to 'src/libsyntax/parse/mod.rs')
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index aaa6f79cb18..1ec2479058c 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -675,7 +675,7 @@ mod tests { use super::*; use std::rc::Rc; use codemap::{Span, BytePos, Pos, Spanned, NO_EXPANSION}; - use ast::{self, TokenTree}; + use ast::{self, TokenTree, PatKind}; use abi::Abi; use attr::{first_attr_value_str_by_name, AttrMetaMethods}; use parse; @@ -896,7 +896,7 @@ mod tests { assert!(panictry!(parser.parse_pat()) == P(ast::Pat{ id: ast::DUMMY_NODE_ID, - node: ast::PatIdent(ast::BindingMode::ByValue(ast::Mutability::Immutable), + node: PatKind::Ident(ast::BindingMode::ByValue(ast::Mutability::Immutable), Spanned{ span:sp(0, 1), node: str_to_ident("b") }, @@ -931,7 +931,7 @@ mod tests { }), pat: P(ast::Pat { id: ast::DUMMY_NODE_ID, - node: ast::PatIdent( + node: PatKind::Ident( ast::BindingMode::ByValue(ast::Mutability::Immutable), Spanned{ span: sp(6,7), @@ -1020,7 +1020,7 @@ mod tests { impl<'v> ::visit::Visitor<'v> for PatIdentVisitor { fn visit_pat(&mut self, p: &'v ast::Pat) { match p.node { - ast::PatIdent(_ , ref spannedident, _) => { + PatKind::Ident(_ , ref spannedident, _) => { self.spans.push(spannedident.span.clone()); } _ => { |
