Merge pull request #1673 from topecongiro/get-tests-passing-again
Get tests passing again
This commit is contained in:
commit
a1fdc32d99
@ -1,8 +1,8 @@
|
||||
sudo: false
|
||||
language: rust
|
||||
rust:
|
||||
- stable
|
||||
- beta
|
||||
# - stable
|
||||
# - beta
|
||||
- nightly
|
||||
os:
|
||||
- linux
|
||||
|
32
appveyor.yml
32
appveyor.yml
@ -6,23 +6,23 @@ environment:
|
||||
PROJECT_NAME: rustfmt
|
||||
matrix:
|
||||
# Stable channel
|
||||
- TARGET: i686-pc-windows-gnu
|
||||
CHANNEL: stable
|
||||
- TARGET: i686-pc-windows-msvc
|
||||
CHANNEL: stable
|
||||
- TARGET: x86_64-pc-windows-gnu
|
||||
CHANNEL: stable
|
||||
- TARGET: x86_64-pc-windows-msvc
|
||||
CHANNEL: stable
|
||||
# - TARGET: i686-pc-windows-gnu
|
||||
# CHANNEL: stable
|
||||
# - TARGET: i686-pc-windows-msvc
|
||||
# CHANNEL: stable
|
||||
# - TARGET: x86_64-pc-windows-gnu
|
||||
# CHANNEL: stable
|
||||
# - TARGET: x86_64-pc-windows-msvc
|
||||
# CHANNEL: stable
|
||||
# Beta channel
|
||||
- TARGET: i686-pc-windows-gnu
|
||||
CHANNEL: beta
|
||||
- TARGET: i686-pc-windows-msvc
|
||||
CHANNEL: beta
|
||||
- TARGET: x86_64-pc-windows-gnu
|
||||
CHANNEL: beta
|
||||
- TARGET: x86_64-pc-windows-msvc
|
||||
CHANNEL: beta
|
||||
# - TARGET: i686-pc-windows-gnu
|
||||
# CHANNEL: beta
|
||||
# - TARGET: i686-pc-windows-msvc
|
||||
# CHANNEL: beta
|
||||
# - TARGET: x86_64-pc-windows-gnu
|
||||
# CHANNEL: beta
|
||||
# - TARGET: x86_64-pc-windows-msvc
|
||||
# CHANNEL: beta
|
||||
# Nightly channel
|
||||
- TARGET: i686-pc-windows-gnu
|
||||
CHANNEL: nightly
|
||||
|
@ -319,8 +319,8 @@ fn left_trim_comment_line<'a>(line: &'a str, style: &CommentStyle) -> &'a str {
|
||||
} else {
|
||||
&line[opener.trim_right().len()..]
|
||||
}
|
||||
} else if line.starts_with("/* ") || line.starts_with("// ") ||
|
||||
line.starts_with("//!") || line.starts_with("///") ||
|
||||
} else if line.starts_with("/* ") || line.starts_with("// ") || line.starts_with("//!") ||
|
||||
line.starts_with("///") ||
|
||||
line.starts_with("** ") || line.starts_with("/*!") ||
|
||||
(line.starts_with("/**") && !line.starts_with("/**/"))
|
||||
{
|
||||
|
119
src/expr.rs
119
src/expr.rs
@ -370,7 +370,9 @@ pub fn rewrite_pair<LHS, RHS>(
|
||||
// This is needed in case of line break not caused by a
|
||||
// shortage of space, but by end-of-line comments, for example.
|
||||
if !rhs_result.contains('\n') {
|
||||
let lhs_shape = try_opt!(shape.sub_width(prefix.len() + infix.len()));
|
||||
let lhs_shape = try_opt!(try_opt!(shape.offset_left(prefix.len())).sub_width(
|
||||
infix.len(),
|
||||
));
|
||||
let lhs_result = lhs.rewrite(context, lhs_shape);
|
||||
if let Some(lhs_result) = lhs_result {
|
||||
let mut result = format!("{}{}{}", prefix, lhs_result, infix);
|
||||
@ -411,22 +413,23 @@ pub fn rewrite_pair<LHS, RHS>(
|
||||
try_opt!(shape.sub_width(suffix.len() + prefix.len())).visual_indent(prefix.len())
|
||||
}
|
||||
Style::Rfc => {
|
||||
shape
|
||||
.block_indent(context.config.tab_spaces())
|
||||
.with_max_width(context.config)
|
||||
// Try to calculate the initial constraint on the right hand side.
|
||||
let rhs_overhead = context
|
||||
.config
|
||||
.max_width()
|
||||
.checked_sub(shape.used_width() + shape.width)
|
||||
.unwrap_or(0);
|
||||
try_opt!(
|
||||
Shape::indented(shape.indent.block_indent(context.config), context.config)
|
||||
.sub_width(rhs_overhead)
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
let rhs_result = try_opt!(rhs.rewrite(context, rhs_shape));
|
||||
let lhs_shape = match context.config.control_style() {
|
||||
Style::Legacy => {
|
||||
let lhs_overhead = shape.used_width() + prefix.len() + infix.len();
|
||||
Shape {
|
||||
width: try_opt!(context.config.max_width().checked_sub(lhs_overhead)),
|
||||
..shape
|
||||
}
|
||||
}
|
||||
Style::Rfc => try_opt!(shape.sub_width(prefix.len() + infix.len())),
|
||||
let lhs_overhead = shape.used_width() + prefix.len() + infix.len();
|
||||
let lhs_shape = Shape {
|
||||
width: try_opt!(context.config.max_width().checked_sub(lhs_overhead)),
|
||||
..shape
|
||||
};
|
||||
let lhs_result = try_opt!(lhs.rewrite(context, lhs_shape));
|
||||
Some(format!(
|
||||
@ -483,12 +486,9 @@ pub fn rewrite_array<'a, I>(
|
||||
}
|
||||
}
|
||||
|
||||
let has_long_item = try_opt!(
|
||||
items
|
||||
.iter()
|
||||
.map(|li| li.item.as_ref().map(|s| s.len() > 10))
|
||||
.fold(Some(false), |acc, x| acc.and_then(|y| x.map(|x| x || y)))
|
||||
);
|
||||
let has_long_item = items.iter().any(|li| {
|
||||
li.item.as_ref().map(|s| s.len() > 10).unwrap_or(false)
|
||||
});
|
||||
|
||||
let tactic = match context.config.array_layout() {
|
||||
IndentStyle::Block => {
|
||||
@ -621,7 +621,7 @@ fn rewrite_closure(
|
||||
|
||||
// 1 = space between `|...|` and body.
|
||||
let extra_offset = extra_offset(&prefix, shape) + 1;
|
||||
let body_shape = try_opt!(shape.sub_width(extra_offset)).add_offset(extra_offset);
|
||||
let body_shape = try_opt!(shape.offset_left(extra_offset));
|
||||
|
||||
if let ast::ExprKind::Block(ref block) = body.node {
|
||||
// The body of the closure is an empty block.
|
||||
@ -728,9 +728,10 @@ fn and_one_line(x: Option<String>) -> Option<String> {
|
||||
|
||||
fn nop_block_collapse(block_str: Option<String>, budget: usize) -> Option<String> {
|
||||
debug!("nop_block_collapse {:?} {}", block_str, budget);
|
||||
block_str.map(|block_str| if block_str.starts_with('{') &&
|
||||
budget >= 2 &&
|
||||
(block_str[1..].find(|c: char| !c.is_whitespace()).unwrap() == block_str.len() - 2)
|
||||
block_str.map(|block_str| if block_str.starts_with('{') && budget >= 2 &&
|
||||
(block_str[1..]
|
||||
.find(|c: char| !c.is_whitespace())
|
||||
.unwrap() == block_str.len() - 2)
|
||||
{
|
||||
"{}".to_owned()
|
||||
} else {
|
||||
@ -1019,13 +1020,13 @@ fn rewrite(&self, context: &RewriteContext, shape: Shape) -> Option<String> {
|
||||
|
||||
let label_string = rewrite_label(self.label);
|
||||
// 1 = space after keyword.
|
||||
let add_offset = self.keyword.len() + label_string.len() + 1;
|
||||
let offset = self.keyword.len() + label_string.len() + 1;
|
||||
|
||||
let pat_expr_string = match self.cond {
|
||||
Some(cond) => {
|
||||
let mut cond_shape = match context.config.control_style() {
|
||||
Style::Legacy => try_opt!(constr_shape.shrink_left(add_offset)),
|
||||
Style::Rfc => try_opt!(constr_shape.sub_width(add_offset)),
|
||||
Style::Legacy => try_opt!(constr_shape.shrink_left(offset)),
|
||||
Style::Rfc => try_opt!(constr_shape.offset_left(offset)),
|
||||
};
|
||||
if context.config.control_brace_style() != ControlBraceStyle::AlwaysNextLine {
|
||||
// 2 = " {".len()
|
||||
@ -1345,7 +1346,7 @@ fn rewrite_match(
|
||||
// `match `cond` {`
|
||||
let cond_shape = match context.config.control_style() {
|
||||
Style::Legacy => try_opt!(shape.shrink_left(6).and_then(|s| s.sub_width(2))),
|
||||
Style::Rfc => try_opt!(shape.sub_width(8)),
|
||||
Style::Rfc => try_opt!(shape.offset_left(8)),
|
||||
};
|
||||
let cond_str = try_opt!(cond.rewrite(context, cond_shape));
|
||||
let alt_block_sep = String::from("\n") + &shape.indent.block_only().to_string(context.config);
|
||||
@ -1508,9 +1509,9 @@ fn rewrite(&self, context: &RewriteContext, shape: Shape) -> Option<String> {
|
||||
let pats_str = format!("{}{}", pats_str, guard_str);
|
||||
|
||||
let (mut extend, body) = match body.node {
|
||||
ast::ExprKind::Block(ref block) if !is_unsafe_block(block) &&
|
||||
is_simple_block(block, context.codemap) &&
|
||||
context.config.wrap_match_arms() => {
|
||||
ast::ExprKind::Block(ref block)
|
||||
if !is_unsafe_block(block) && is_simple_block(block, context.codemap) &&
|
||||
context.config.wrap_match_arms() => {
|
||||
if let ast::StmtKind::Expr(ref expr) = block.stmts[0].node {
|
||||
(false, &**expr)
|
||||
} else {
|
||||
@ -1571,8 +1572,7 @@ fn rewrite(&self, context: &RewriteContext, shape: Shape) -> Option<String> {
|
||||
|
||||
// FIXME: we're doing a second rewrite of the expr; This may not be
|
||||
// necessary.
|
||||
let body_shape = try_opt!(shape.sub_width(context.config.tab_spaces()))
|
||||
.block_indent(context.config.tab_spaces());
|
||||
let body_shape = try_opt!(shape.block_left(context.config.tab_spaces()));
|
||||
let next_line_body = try_opt!(nop_block_collapse(
|
||||
body.rewrite(context, body_shape),
|
||||
body_shape.width,
|
||||
@ -1649,7 +1649,9 @@ fn rewrite_guard(
|
||||
s.rewrite(context, cond_shape)
|
||||
})
|
||||
{
|
||||
return Some(format!(" if {}", cond_str));
|
||||
if !cond_str.contains('\n') {
|
||||
return Some(format!(" if {}", cond_str));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1697,7 +1699,7 @@ fn rewrite_pat_expr(
|
||||
} else {
|
||||
format!("{} ", matcher)
|
||||
};
|
||||
let pat_shape = try_opt!(try_opt!(shape.shrink_left(matcher.len())).sub_width(
|
||||
let pat_shape = try_opt!(try_opt!(shape.offset_left(matcher.len())).sub_width(
|
||||
connector.len(),
|
||||
));
|
||||
pat_string = try_opt!(pat.rewrite(context, pat_shape));
|
||||
@ -2143,19 +2145,29 @@ fn wrap_args_with_parens(
|
||||
|
||||
fn rewrite_paren(context: &RewriteContext, subexpr: &ast::Expr, shape: Shape) -> Option<String> {
|
||||
debug!("rewrite_paren, shape: {:?}", shape);
|
||||
// 1 is for opening paren, 2 is for opening+closing, we want to keep the closing
|
||||
// paren on the same line as the subexpr.
|
||||
let sub_shape = try_opt!(shape.sub_width(2)).visual_indent(1);
|
||||
let subexpr_str = subexpr.rewrite(context, sub_shape);
|
||||
debug!("rewrite_paren, subexpr_str: `{:?}`", subexpr_str);
|
||||
let paren_overhead = paren_overhead(context);
|
||||
let sub_shape = try_opt!(shape.sub_width(paren_overhead / 2)).visual_indent(paren_overhead / 2);
|
||||
|
||||
subexpr_str.map(|s| if context.config.spaces_within_parens() &&
|
||||
s.len() > 0
|
||||
{
|
||||
let paren_wrapper = |s: &str| if context.config.spaces_within_parens() && s.len() > 0 {
|
||||
format!("( {} )", s)
|
||||
} else {
|
||||
format!("({})", s)
|
||||
})
|
||||
};
|
||||
|
||||
let subexpr_str = try_opt!(subexpr.rewrite(context, sub_shape));
|
||||
debug!("rewrite_paren, subexpr_str: `{:?}`", subexpr_str);
|
||||
|
||||
if subexpr_str.contains('\n') {
|
||||
Some(paren_wrapper(&subexpr_str))
|
||||
} else {
|
||||
if subexpr_str.len() + paren_overhead <= shape.width {
|
||||
Some(paren_wrapper(&subexpr_str))
|
||||
} else {
|
||||
let sub_shape = try_opt!(shape.offset_left(2));
|
||||
let subexpr_str = try_opt!(subexpr.rewrite(context, sub_shape));
|
||||
Some(paren_wrapper(&subexpr_str))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn rewrite_index(
|
||||
@ -2540,21 +2552,10 @@ fn count_line_breaks(src: &str) -> usize {
|
||||
|
||||
// FIXME: DRY!
|
||||
match (rhs, new_rhs) {
|
||||
(Some(ref orig_rhs), Some(ref replacement_rhs)) if count_line_breaks(
|
||||
orig_rhs,
|
||||
) >
|
||||
count_line_breaks(
|
||||
replacement_rhs,
|
||||
) + 1 ||
|
||||
(orig_rhs
|
||||
.rewrite(context, shape)
|
||||
.is_none() &&
|
||||
replacement_rhs
|
||||
.rewrite(
|
||||
context,
|
||||
new_shape,
|
||||
)
|
||||
.is_some()) => {
|
||||
(Some(ref orig_rhs), Some(ref replacement_rhs))
|
||||
if count_line_breaks(orig_rhs) > count_line_breaks(replacement_rhs) + 1 ||
|
||||
(orig_rhs.rewrite(context, shape).is_none() &&
|
||||
replacement_rhs.rewrite(context, new_shape).is_some()) => {
|
||||
result.push_str(&format!("\n{}", new_shape.indent.to_string(context.config)));
|
||||
result.push_str(replacement_rhs);
|
||||
}
|
||||
|
37
src/items.rs
37
src/items.rs
@ -685,12 +685,12 @@ fn format_impl_ref_and_type(
|
||||
offset: Indent,
|
||||
) -> Option<String> {
|
||||
if let ast::ItemKind::Impl(unsafety,
|
||||
polarity,
|
||||
_,
|
||||
ref generics,
|
||||
ref trait_ref,
|
||||
ref self_ty,
|
||||
_) = item.node
|
||||
polarity,
|
||||
_,
|
||||
ref generics,
|
||||
ref trait_ref,
|
||||
ref self_ty,
|
||||
_) = item.node
|
||||
{
|
||||
let mut result = String::new();
|
||||
|
||||
@ -942,8 +942,8 @@ pub fn format_trait(context: &RewriteContext, item: &ast::Item, offset: Indent)
|
||||
let has_body = !trait_items.is_empty();
|
||||
|
||||
let where_density = if (context.config.where_density() == Density::Compressed &&
|
||||
(!result.contains('\n') ||
|
||||
context.config.fn_args_layout() == IndentStyle::Block)) ||
|
||||
(!result.contains('\n') ||
|
||||
context.config.fn_args_layout() == IndentStyle::Block)) ||
|
||||
(context.config.fn_args_layout() == IndentStyle::Block && result.is_empty()) ||
|
||||
(context.config.where_density() == Density::CompressedIfEmpty && !has_body &&
|
||||
!result.contains('\n'))
|
||||
@ -1468,9 +1468,9 @@ fn rewrite(&self, context: &RewriteContext, shape: Shape) -> Option<String> {
|
||||
Some(ref ty) if ty.contains('\n') => {
|
||||
let new_ty = rewrite_type_in_next_line();
|
||||
match new_ty {
|
||||
Some(ref new_ty) if !new_ty.contains('\n') &&
|
||||
new_ty.len() + type_offset.width() <=
|
||||
context.config.max_width() => {
|
||||
Some(ref new_ty)
|
||||
if !new_ty.contains('\n') &&
|
||||
new_ty.len() + type_offset.width() <= context.config.max_width() => {
|
||||
Some(format!(
|
||||
"{}\n{}{}",
|
||||
result,
|
||||
@ -1831,7 +1831,17 @@ fn rewrite_fn_base(
|
||||
result.push_str(&ident.to_string());
|
||||
|
||||
// Generics.
|
||||
let shape = Shape::indented(indent + last_line_width(&result), context.config);
|
||||
let overhead = if has_braces && !newline_brace {
|
||||
// 4 = `() {`
|
||||
4
|
||||
} else {
|
||||
// 2 = `()`
|
||||
2
|
||||
};
|
||||
let shape = try_opt!(
|
||||
Shape::indented(indent + last_line_width(&result), context.config)
|
||||
.sub_width(overhead)
|
||||
);
|
||||
let g_span = mk_sp(span.lo, span_for_return(&fd.output).lo);
|
||||
let generics_str = try_opt!(rewrite_generics(context, generics, shape, g_span));
|
||||
result.push_str(&generics_str);
|
||||
@ -2678,7 +2688,8 @@ fn format_generics(
|
||||
let same_line_brace = force_same_line_brace ||
|
||||
(generics.where_clause.predicates.is_empty() && trimmed_last_line_width(&result) == 1);
|
||||
if !same_line_brace &&
|
||||
(brace_style == BraceStyle::SameLineWhere || brace_style == BraceStyle::AlwaysNextLine)
|
||||
(brace_style == BraceStyle::SameLineWhere ||
|
||||
brace_style == BraceStyle::AlwaysNextLine)
|
||||
{
|
||||
result.push('\n');
|
||||
result.push_str(&offset.block_only().to_string(context.config));
|
||||
|
@ -30,7 +30,7 @@
|
||||
use Shape;
|
||||
use codemap::SpanUtils;
|
||||
use rewrite::{Rewrite, RewriteContext};
|
||||
use expr::{rewrite_call, rewrite_array, rewrite_pair};
|
||||
use expr::{rewrite_call, rewrite_array};
|
||||
use comment::{FindUncommented, contains_comment};
|
||||
use utils::mk_sp;
|
||||
|
||||
@ -192,15 +192,28 @@ pub fn rewrite_macro(
|
||||
} else {
|
||||
("[", "]")
|
||||
};
|
||||
rewrite_pair(
|
||||
&*expr_vec[0],
|
||||
&*expr_vec[1],
|
||||
lbr,
|
||||
"; ",
|
||||
rbr,
|
||||
context,
|
||||
mac_shape,
|
||||
).map(|s| format!("{}{}", macro_name, s))
|
||||
// 6 = `vec!` + `; `
|
||||
let total_overhead = lbr.len() + rbr.len() + 6;
|
||||
let lhs = try_opt!(expr_vec[0].rewrite(context, mac_shape));
|
||||
let rhs = try_opt!(expr_vec[1].rewrite(context, mac_shape));
|
||||
if !lhs.contains('\n') && !rhs.contains('\n') &&
|
||||
lhs.len() + rhs.len() + total_overhead <= shape.width
|
||||
{
|
||||
Some(format!("{}{}{}; {}{}", macro_name, lbr, lhs, rhs, rbr))
|
||||
} else {
|
||||
let nested_indent = shape.indent.block_indent(context.config);
|
||||
Some(format!(
|
||||
"{}{}\n{}{};\n{}{}\n{}{}",
|
||||
macro_name,
|
||||
lbr,
|
||||
nested_indent.to_string(context.config),
|
||||
lhs,
|
||||
nested_indent.to_string(context.config),
|
||||
rhs,
|
||||
shape.indent.to_string(context.config),
|
||||
rbr
|
||||
))
|
||||
}
|
||||
} else {
|
||||
// Format macro invocation as array literal.
|
||||
let rewrite = try_opt!(rewrite_array(
|
||||
|
@ -81,7 +81,7 @@ pub fn rewrite_string<'a>(orig: &str, fmt: &StringFormat<'a>) -> Option<String>
|
||||
if cur_end < cur_start + MIN_STRING {
|
||||
cur_end = cur_start + max_chars;
|
||||
while !(punctuation.contains(graphemes[cur_end - 1]) ||
|
||||
graphemes[cur_end - 1].trim().is_empty())
|
||||
graphemes[cur_end - 1].trim().is_empty())
|
||||
{
|
||||
if cur_end >= graphemes.len() {
|
||||
let line = &graphemes[cur_start..].join("");
|
||||
|
@ -206,9 +206,9 @@ fn rewrite_segment(
|
||||
|
||||
let params = if let Some(ref params) = segment.parameters {
|
||||
match **params {
|
||||
ast::PathParameters::AngleBracketed(ref data) if !data.lifetimes.is_empty() ||
|
||||
!data.types.is_empty() ||
|
||||
!data.bindings.is_empty() => {
|
||||
ast::PathParameters::AngleBracketed(ref data)
|
||||
if !data.lifetimes.is_empty() || !data.types.is_empty() ||
|
||||
!data.bindings.is_empty() => {
|
||||
let param_list = data.lifetimes
|
||||
.iter()
|
||||
.map(SegmentParam::LifeTime)
|
||||
|
@ -546,10 +546,11 @@ fn visit_mac(&mut self, mac: &ast::Mac, ident: Option<ast::Ident>, pos: MacroPos
|
||||
fn push_rewrite(&mut self, span: Span, rewrite: Option<String>) {
|
||||
self.format_missing_with_indent(source!(self, span).lo);
|
||||
self.failed = match rewrite {
|
||||
Some(ref s) if s.rewrite(
|
||||
&self.get_context(),
|
||||
Shape::indented(self.block_indent, self.config),
|
||||
).is_none() => true,
|
||||
Some(ref s)
|
||||
if s.rewrite(
|
||||
&self.get_context(),
|
||||
Shape::indented(self.block_indent, self.config),
|
||||
).is_none() => true,
|
||||
None => true,
|
||||
_ => self.failed,
|
||||
};
|
||||
|
@ -5,7 +5,7 @@ fn main() {
|
||||
loop {
|
||||
if foo {
|
||||
if ((right_paddle_speed < 0.) &&
|
||||
(right_paddle.position().y - paddle_size.y / 2. > 5.)) ||
|
||||
(right_paddle.position().y - paddle_size.y / 2. > 5.)) ||
|
||||
((right_paddle_speed > 0.) &&
|
||||
(right_paddle.position().y + paddle_size.y / 2. < game_height as f32 - 5.))
|
||||
{
|
||||
|
@ -14,10 +14,10 @@ fn main() {
|
||||
|
||||
// #1544
|
||||
if let VrMsg::ClientReply {
|
||||
request_num: reply_req_num,
|
||||
value,
|
||||
..
|
||||
} = msg
|
||||
request_num: reply_req_num,
|
||||
value,
|
||||
..
|
||||
} = msg
|
||||
{
|
||||
let _ = safe_assert_eq!(reply_req_num, request_num, op);
|
||||
return Ok((request_num, op, value));
|
||||
|
@ -7,8 +7,8 @@ fn foo() -> bool {
|
||||
let referenced = &5;
|
||||
|
||||
let very_long_variable_name = (a + first + simple + test);
|
||||
let very_long_variable_name =
|
||||
(a + first + simple + test + AAAAAAAAAAAAA + BBBBBBBBBBBBBBBBB + b + c);
|
||||
let very_long_variable_name = (a + first + simple + test + AAAAAAAAAAAAA +
|
||||
BBBBBBBBBBBBBBBBB + b + c);
|
||||
|
||||
let is_internalxxxx = self.codemap.span_to_filename(s) ==
|
||||
self.codemap.span_to_filename(m.inner);
|
||||
@ -20,8 +20,10 @@ fn foo() -> bool {
|
||||
10000 * 30000000000 + 40000 / 1002200000000 - 50000 * sqrt(-1),
|
||||
trivial_value,
|
||||
);
|
||||
(((((((((aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + a +
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaa))))))))) ;
|
||||
(((((((((aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
|
||||
a +
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
|
||||
aaaaa)))))))));
|
||||
|
||||
{
|
||||
for _ in 0..10 {}
|
||||
@ -47,21 +49,21 @@ fn foo() -> bool {
|
||||
}
|
||||
|
||||
if let Some(x) = (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
|
||||
{}
|
||||
|
||||
if let (some_very_large,
|
||||
tuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuple) = 1 + 2 + 3
|
||||
tuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuple) = 1 + 2 + 3
|
||||
{
|
||||
}
|
||||
|
||||
if let (some_very_large,
|
||||
tuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuple) =
|
||||
tuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuple) =
|
||||
1111 + 2222
|
||||
{}
|
||||
|
||||
if let (some_very_large,
|
||||
tuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuple) = 1 + 2 + 3
|
||||
tuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuple) = 1 + 2 + 3
|
||||
{}
|
||||
|
||||
let test = if true { 5 } else { 3 };
|
||||
|
@ -101,7 +101,12 @@ fn foo<g: G>() {
|
||||
foo();
|
||||
}
|
||||
|
||||
fn foo<L: Loooooooooooooooooooooong, G: Geeeeeeeeeeeneric, I: iiiiiiiiis, L: Looooooooooooooooong>() {
|
||||
fn foo<
|
||||
L: Loooooooooooooooooooooong,
|
||||
G: Geeeeeeeeeeeneric,
|
||||
I: iiiiiiiiis,
|
||||
L: Looooooooooooooooong,
|
||||
>() {
|
||||
foo();
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ fn foo(a: i32, a: i32, a: i32, a: i32, a: i32, a: i32, a: i32, a: i32, a: i32, a
|
||||
let str = "AAAAAAAAAAAAAAaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAa";
|
||||
|
||||
if let (some_very_large,
|
||||
tuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuple) = 1 + 2 + 3
|
||||
tuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuple) = 1 + 2 + 3
|
||||
{}
|
||||
|
||||
if cond() {
|
||||
|
@ -12,8 +12,8 @@ fn baz(p: Packet) {
|
||||
loop {
|
||||
loop {
|
||||
if let Packet::Transaction {
|
||||
state: TransactionState::Committed(ts, ..), ..
|
||||
} = p
|
||||
state: TransactionState::Committed(ts, ..), ..
|
||||
} = p
|
||||
{
|
||||
unreachable!()
|
||||
}
|
||||
|
@ -67,13 +67,18 @@ fn main() {
|
||||
vec![a, b; c];
|
||||
vec![a; b, c];
|
||||
|
||||
vec![a;
|
||||
(|x| {
|
||||
let y = x + 1;
|
||||
let z = y + 1;
|
||||
z
|
||||
})(2)];
|
||||
vec![a; xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx];
|
||||
vec![
|
||||
a;
|
||||
(|x| {
|
||||
let y = x + 1;
|
||||
let z = y + 1;
|
||||
z
|
||||
})(2)
|
||||
];
|
||||
vec![
|
||||
a;
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
];
|
||||
vec![a; unsafe { x + 1 }];
|
||||
|
||||
unknown_bracket_macro__comma_should_not_be_stripped![
|
||||
|
@ -37,10 +37,8 @@ fn foo() {
|
||||
Patternnnnnnnnnnnnnnnnnnnnnnnnn if loooooooooooooooooooooooooooooooooooooooooong_guard => {}
|
||||
|
||||
_ => {}
|
||||
ast::PathParameters::AngleBracketedParameters(ref data) if data.lifetimes.len() >
|
||||
0 ||
|
||||
data.types.len() > 0 ||
|
||||
data.bindings.len() > 0 => {}
|
||||
ast::PathParameters::AngleBracketedParameters(ref data)
|
||||
if data.lifetimes.len() > 0 || data.types.len() > 0 || data.bindings.len() > 0 => {}
|
||||
}
|
||||
|
||||
let whatever = match something {
|
||||
@ -316,16 +314,15 @@ fn issue386() {
|
||||
|
||||
fn guards() {
|
||||
match foo {
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa if foooooooooooooo &&
|
||||
barrrrrrrrrrrr => {}
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
if foooooooooooooo && barrrrrrrrrrrr => {}
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa if foooooooooooooo &&
|
||||
barrrrrrrrrrrr => {}
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
if foooooooooooooo && barrrrrrrrrrrr => {}
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
if fooooooooooooooooooooo &&
|
||||
(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb || cccccccccccccccccccccccccccccccccccccccc) => {
|
||||
{}
|
||||
}
|
||||
(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ||
|
||||
cccccccccccccccccccccccccccccccccccccccc) => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user