Skip to content

deps: Update syntex_syntax to 0.33 #1022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ regex = "0.1"
term = "0.4"
strings = "0.0.1"
diff = "0.1"
syntex_syntax = "0.32"
syntex_syntax = "0.33"
log = "0.3"
env_logger = "0.3"
getopts = "0.2"
Expand Down
12 changes: 6 additions & 6 deletions src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,15 +581,15 @@ impl Rewrite for ast::Stmt {
struct Loop<'a> {
cond: Option<&'a ast::Expr>,
block: &'a ast::Block,
label: Option<ast::Ident>,
label: Option<ast::SpannedIdent>,
pat: Option<&'a ast::Pat>,
keyword: &'a str,
matcher: &'a str,
connector: &'a str,
}

impl<'a> Loop<'a> {
fn new_loop(block: &'a ast::Block, label: Option<ast::Ident>) -> Loop<'a> {
fn new_loop(block: &'a ast::Block, label: Option<ast::SpannedIdent>) -> Loop<'a> {
Loop {
cond: None,
block: block,
Expand All @@ -604,7 +604,7 @@ impl<'a> Loop<'a> {
fn new_while(pat: Option<&'a ast::Pat>,
cond: &'a ast::Expr,
block: &'a ast::Block,
label: Option<ast::Ident>)
label: Option<ast::SpannedIdent>)
-> Loop<'a> {
Loop {
cond: Some(cond),
Expand All @@ -623,7 +623,7 @@ impl<'a> Loop<'a> {
fn new_for(pat: &'a ast::Pat,
cond: &'a ast::Expr,
block: &'a ast::Block,
label: Option<ast::Ident>)
label: Option<ast::SpannedIdent>)
-> Loop<'a> {
Loop {
cond: Some(cond),
Expand Down Expand Up @@ -676,9 +676,9 @@ impl<'a> Rewrite for Loop<'a> {
}
}

fn rewrite_label(label: Option<ast::Ident>) -> String {
fn rewrite_label(label: Option<ast::SpannedIdent>) -> String {
match label {
Some(ident) => format!("{}: ", ident),
Some(ident) => format!("{}: ", ident.node),
None => "".to_owned(),
}
}
Expand Down
10 changes: 2 additions & 8 deletions src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ impl<'a> FmtVisitor<'a> {
indent,
item.ident,
fn_decl,
None,
generics,
ast::Unsafety::Normal,
ast::Constness::NotConst,
Expand Down Expand Up @@ -169,7 +168,6 @@ impl<'a> FmtVisitor<'a> {
indent: Indent,
ident: ast::Ident,
fd: &ast::FnDecl,
explicit_self: Option<&ast::ExplicitSelf>,
generics: &ast::Generics,
unsafety: ast::Unsafety,
constness: ast::Constness,
Expand All @@ -189,7 +187,6 @@ impl<'a> FmtVisitor<'a> {
indent,
ident,
fd,
explicit_self,
generics,
unsafety,
constness,
Expand Down Expand Up @@ -234,7 +231,6 @@ impl<'a> FmtVisitor<'a> {
indent,
ident,
&sig.decl,
Some(&sig.explicit_self),
&sig.generics,
sig.unsafety,
sig.constness,
Expand Down Expand Up @@ -1129,7 +1125,7 @@ fn rewrite_explicit_self(explicit_self: &ast::ExplicitSelf,
context: &RewriteContext)
-> Option<String> {
match explicit_self.node {
ast::SelfKind::Region(lt, m, _) => {
ast::SelfKind::Region(lt, m) => {
let mut_str = format_mutability(m);
match lt {
Some(ref l) => {
Expand All @@ -1155,7 +1151,6 @@ fn rewrite_explicit_self(explicit_self: &ast::ExplicitSelf,

Some(format!("{}self", format_mutability(mutability)))
}
_ => None,
}
}

Expand Down Expand Up @@ -1229,7 +1224,6 @@ fn rewrite_fn_base(context: &RewriteContext,
indent: Indent,
ident: ast::Ident,
fd: &ast::FnDecl,
explicit_self: Option<&ast::ExplicitSelf>,
generics: &ast::Generics,
unsafety: ast::Unsafety,
constness: ast::Constness,
Expand Down Expand Up @@ -1328,7 +1322,7 @@ fn rewrite_fn_base(context: &RewriteContext,
span_for_return(&fd.output).lo);
let arg_str = try_opt!(rewrite_args(context,
&fd.inputs,
explicit_self,
fd.get_self().as_ref(),
one_line_budget,
multi_line_budget,
indent,
Expand Down
15 changes: 10 additions & 5 deletions src/patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,25 @@ impl Rewrite for Pat {
let prefix = format!("&{}", format_mutability(mutability));
rewrite_unary_prefix(context, &prefix, &**pat, width, offset)
}
PatKind::Tup(ref items) => {
// FIXME(#1021): Handle `..` in tuple / tuple struct patterns (RFC 1492)
PatKind::Tuple(ref items, dotdot_pos) => {
if dotdot_pos.is_some() {
return None;
}
rewrite_tuple(context,
items.iter().map(|x| &**x),
self.span,
width,
offset)
}
PatKind::Path(ref path) => rewrite_path(context, true, None, path, width, offset),
PatKind::TupleStruct(ref path, ref pat_vec) => {
PatKind::TupleStruct(ref path, ref pat_vec, dotdot_pos) => {
let path_str = try_opt!(rewrite_path(context, true, None, path, width, offset));

match *pat_vec {
Some(ref pat_vec) => {
// FIXME(#1021): Handle `..` in tuple / tuple struct patterns (RFC 1492)
match dotdot_pos {
Some(_) => Some(format!("{}(..)", path_str)),
None => {
if pat_vec.is_empty() {
Some(path_str)
} else {
Expand All @@ -95,7 +101,6 @@ impl Rewrite for Pat {
context.config))))
}
}
None => Some(format!("{}(..)", path_str)),
}
}
PatKind::Lit(ref expr) => expr.rewrite(context, width, offset),
Expand Down
1 change: 1 addition & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ impl Rewrite for ast::Ty {
}
ast::TyKind::Mac(..) |
ast::TyKind::Typeof(..) => unreachable!(),
ast::TyKind::ImplicitSelf => Some(String::from("")),
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ impl<'a> FmtVisitor<'a> {
self.rewrite_fn(indent,
ident,
fd,
None,
generics,
unsafety,
constness,
Expand All @@ -155,7 +154,6 @@ impl<'a> FmtVisitor<'a> {
self.rewrite_fn(indent,
ident,
fd,
Some(&sig.explicit_self),
&sig.generics,
sig.unsafety,
sig.constness,
Expand Down