Skip to content

Commit

Permalink
Renames to match rust-lang/rust#36599
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 6, 2016
1 parent d73dba2 commit 16709ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ pub enum Pat {
/// A range pattern, e.g. `1...2`
Range(Box<Lit>, Box<Lit>),
/// `[a, b, ..i, y, z]` is represented as:
/// `Pat::Vec(box [a, b], Some(i), box [y, z])`
Vec(Vec<Pat>, Option<Box<Pat>>, Vec<Pat>),
/// `Pat::Slice(box [a, b], Some(i), box [y, z])`
Slice(Vec<Pat>, Option<Box<Pat>>, Vec<Pat>),
/// A macro pattern; pre-expansion
Mac(Mac),
}
Expand Down Expand Up @@ -1496,7 +1496,7 @@ mod printing {
tokens.append("...");
hi.to_tokens(tokens);
}
Pat::Vec(ref _before, ref _dots, ref _after) => unimplemented!(),
Pat::Slice(ref _before, ref _dots, ref _after) => unimplemented!(),
Pat::Mac(ref mac) => mac.to_tokens(tokens),
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use super::*;
#[derive(Debug, Clone, Eq, PartialEq)]
pub enum Ty {
/// A variable-length array (`[T]`)
Vec(Box<Ty>),
Slice(Box<Ty>),
/// A fixed length array (`[T; n]`)
FixedLengthVec(Box<Ty>, usize),
Array(Box<Ty>, usize),
/// A raw pointer (`*const T` or `*mut T`)
Ptr(Box<MutTy>),
/// A reference (`&'a T` or `&'a mut T`)
Expand Down Expand Up @@ -226,7 +226,7 @@ pub mod parsing {
punct!("[") >>
elem: ty >>
punct!("]") >>
(Ty::Vec(Box::new(elem)))
(Ty::Slice(Box::new(elem)))
));

named!(ty_fixed_length_vec -> Ty, do_parse!(
Expand All @@ -235,7 +235,7 @@ pub mod parsing {
punct!(";") >>
len: int >>
punct!("]") >>
(Ty::FixedLengthVec(Box::new(elem), len.0 as usize))
(Ty::Array(Box::new(elem), len.0 as usize))
));

named!(ty_ptr -> Ty, do_parse!(
Expand Down Expand Up @@ -426,12 +426,12 @@ mod printing {
impl ToTokens for Ty {
fn to_tokens(&self, tokens: &mut Tokens) {
match *self {
Ty::Vec(ref inner) => {
Ty::Slice(ref inner) => {
tokens.append("[");
inner.to_tokens(tokens);
tokens.append("]");
}
Ty::FixedLengthVec(ref inner, len) => {
Ty::Array(ref inner, len) => {
tokens.append("[");
inner.to_tokens(tokens);
tokens.append(";");
Expand Down

0 comments on commit 16709ba

Please sign in to comment.