Skip to content

deps: Update syntex_syntax to 0.30.0 #891

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
Mar 29, 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
8 changes: 4 additions & 4 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.41"
term = "0.2.11"
strings = "0.0.1"
diff = "0.1.8"
syntex_syntax = "0.29.1"
syntex_syntax = "0.30"
log = "0.3.2"
env_logger = "0.3.1"
getopts = "0.2"
13 changes: 9 additions & 4 deletions src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,19 +185,21 @@ impl Rewrite for ast::Expr {
ast::ExprKind::Repeat(ref expr, ref repeats) => {
rewrite_pair(&**expr, &**repeats, "[", "; ", "]", context, width, offset)
}
ast::ExprKind::Range(Some(ref lhs), Some(ref rhs)) => {
// TODO(#890): Handle closed ranges; rust tracking issue
// https://github.com/rust-lang/rust/issues/28237
ast::ExprKind::Range(Some(ref lhs), Some(ref rhs), _range_limits) => {
rewrite_pair(&**lhs, &**rhs, "", "..", "", context, width, offset)
}
ast::ExprKind::Range(None, Some(ref rhs)) => {
ast::ExprKind::Range(None, Some(ref rhs), _range_limits) => {
rewrite_unary_prefix(context, "..", &**rhs, width, offset)
}
ast::ExprKind::Range(Some(ref lhs), None) => {
ast::ExprKind::Range(Some(ref lhs), None, _range_limits) => {
Some(format!("{}..",
try_opt!(lhs.rewrite(context,
try_opt!(width.checked_sub(2)),
offset))))
}
ast::ExprKind::Range(None, None) => {
ast::ExprKind::Range(None, None, _range_limits) => {
if width >= 2 {
Some("..".into())
} else {
Expand All @@ -213,6 +215,9 @@ impl Rewrite for ast::Expr {
width,
offset)
}
// TODO(#867): Handle type ascription; rust tracking issue
// https://github.com/rust-lang/rust/issues/31436
ast::ExprKind::Try(_) => unimplemented!(),
};
result.and_then(|res| recover_comment_removed(res, self.span, context, width, offset))
}
Expand Down
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ pub fn format_string(input: String, config: &Config) -> FileMap {
let krate = parse::parse_crate_from_source_str(path.to_owned(),
input,
Vec::new(),
&parse_session);
&parse_session)
.unwrap();

// Suppress error output after parsing.
let silent_emitter = Box::new(EmitterWriter::new(Box::new(Vec::new()), None, codemap.clone()));
Expand Down Expand Up @@ -412,7 +413,7 @@ pub fn format(file: &Path, config: &Config) -> FileMap {
codemap.clone());
let mut parse_session = ParseSess::with_span_handler(tty_handler, codemap.clone());

let krate = parse::parse_crate_from_file(file, Vec::new(), &parse_session);
let krate = parse::parse_crate_from_file(file, Vec::new(), &parse_session).unwrap();

// Suppress error output after parsing.
let silent_emitter = Box::new(EmitterWriter::new(Box::new(Vec::new()), None, codemap.clone()));
Expand Down