mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
Merge pull request #1022 from kamalmarhubi/update-syntex-syntax
deps: Update syntex_syntax to 0.33
This commit is contained in:
commit
3a87aa5318
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -10,7 +10,7 @@ dependencies = [
|
||||
"regex 0.1.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"strings 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syntex_syntax 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syntex_syntax 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-segmentation 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -112,7 +112,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "syntex_syntax"
|
||||
version = "0.32.0"
|
||||
version = "0.33.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -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"
|
||||
|
12
src/expr.rs
12
src/expr.rs
@ -581,7 +581,7 @@ 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,
|
||||
@ -589,7 +589,7 @@ struct Loop<'a> {
|
||||
}
|
||||
|
||||
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,
|
||||
@ -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),
|
||||
@ -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),
|
||||
@ -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(),
|
||||
}
|
||||
}
|
||||
|
10
src/items.rs
10
src/items.rs
@ -116,7 +116,6 @@ impl<'a> FmtVisitor<'a> {
|
||||
indent,
|
||||
item.ident,
|
||||
fn_decl,
|
||||
None,
|
||||
generics,
|
||||
ast::Unsafety::Normal,
|
||||
ast::Constness::NotConst,
|
||||
@ -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,
|
||||
@ -189,7 +187,6 @@ impl<'a> FmtVisitor<'a> {
|
||||
indent,
|
||||
ident,
|
||||
fd,
|
||||
explicit_self,
|
||||
generics,
|
||||
unsafety,
|
||||
constness,
|
||||
@ -234,7 +231,6 @@ impl<'a> FmtVisitor<'a> {
|
||||
indent,
|
||||
ident,
|
||||
&sig.decl,
|
||||
Some(&sig.explicit_self),
|
||||
&sig.generics,
|
||||
sig.unsafety,
|
||||
sig.constness,
|
||||
@ -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) => {
|
||||
@ -1155,7 +1151,6 @@ fn rewrite_explicit_self(explicit_self: &ast::ExplicitSelf,
|
||||
|
||||
Some(format!("{}self", format_mutability(mutability)))
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
@ -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,
|
||||
@ -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,
|
||||
|
@ -59,7 +59,11 @@ 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,
|
||||
@ -67,11 +71,13 @@ impl Rewrite for Pat {
|
||||
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 {
|
||||
@ -95,7 +101,6 @@ impl Rewrite for Pat {
|
||||
context.config))))
|
||||
}
|
||||
}
|
||||
None => Some(format!("{}(..)", path_str)),
|
||||
}
|
||||
}
|
||||
PatKind::Lit(ref expr) => expr.rewrite(context, width, offset),
|
||||
|
@ -588,6 +588,7 @@ impl Rewrite for ast::Ty {
|
||||
}
|
||||
ast::TyKind::Mac(..) |
|
||||
ast::TyKind::Typeof(..) => unreachable!(),
|
||||
ast::TyKind::ImplicitSelf => Some(String::from("")),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -142,7 +142,6 @@ impl<'a> FmtVisitor<'a> {
|
||||
self.rewrite_fn(indent,
|
||||
ident,
|
||||
fd,
|
||||
None,
|
||||
generics,
|
||||
unsafety,
|
||||
constness,
|
||||
@ -155,7 +154,6 @@ impl<'a> FmtVisitor<'a> {
|
||||
self.rewrite_fn(indent,
|
||||
ident,
|
||||
fd,
|
||||
Some(&sig.explicit_self),
|
||||
&sig.generics,
|
||||
sig.unsafety,
|
||||
sig.constness,
|
||||
|
Loading…
Reference in New Issue
Block a user