Reformat tests

This commit is contained in:
Nick Cameron 2017-06-12 16:01:41 +12:00
parent 1f512948a0
commit 6f30d9e7c9
105 changed files with 1642 additions and 1134 deletions

View File

@ -177,13 +177,11 @@ impl Rewrite for ast::ViewPath {
let prefix_shape = try_opt!(shape.sub_width(ident_str.len() + 4));
let path_str = try_opt!(rewrite_view_path_prefix(path, context, prefix_shape));
Some(
if path.segments.last().unwrap().identifier == ident {
path_str
} else {
format!("{} as {}", path_str, ident_str)
},
)
Some(if path.segments.last().unwrap().identifier == ident {
path_str
} else {
format!("{} as {}", path_str, ident_str)
})
}
}
}
@ -392,13 +390,11 @@ pub fn rewrite_use_list(
};
let list_str = try_opt!(write_list(&items[first_index..], &fmt));
Some(
if path_str.is_empty() {
format!("{{{}}}", list_str)
} else {
format!("{}::{{{}}}", path_str, list_str)
},
)
Some(if path_str.is_empty() {
format!("{{{}}}", list_str)
} else {
format!("{}::{{{}}}", path_str, list_str)
})
}
// Returns true when self item was found.

View File

@ -1990,13 +1990,11 @@ fn rewrite_fn_base(
});
let snippet = snippet.trim();
if !snippet.is_empty() {
result.push(
if original_starts_with_newline {
'\n'
} else {
' '
},
);
result.push(if original_starts_with_newline {
'\n'
} else {
' '
});
result.push_str(snippet);
if original_ends_with_newline {
force_new_line_for_brace = true;

View File

@ -336,23 +336,19 @@ fn rewrite_tuple_pat(
match path_str {
Some(path_str) => {
Some(
if context.config.spaces_within_parens() {
format!("{}( {} )", path_str, list)
} else {
format!("{}({})", path_str, list)
},
)
Some(if context.config.spaces_within_parens() {
format!("{}( {} )", path_str, list)
} else {
format!("{}({})", path_str, list)
})
}
None => {
let comma = if add_comma { "," } else { "" };
Some(
if context.config.spaces_within_parens() {
format!("( {}{} )", list, comma)
} else {
format!("({}{})", list, comma)
},
)
Some(if context.config.spaces_within_parens() {
format!("( {}{} )", list, comma)
} else {
format!("({}{})", list, comma)
})
}
}
}

View File

@ -348,13 +348,11 @@ where
String::new()
};
Some(
if context.config.spaces_within_parens() {
format!("( {} ){}{}", list_str, infix, output)
} else {
format!("({}){}{}", list_str, infix, output)
},
)
Some(if context.config.spaces_within_parens() {
format!("( {} ){}{}", list_str, infix, output)
} else {
format!("({}){}{}", list_str, infix, output)
})
}
fn type_bound_colon(context: &RewriteContext) -> &'static str {
@ -588,13 +586,13 @@ impl Rewrite for ast::PolyTraitRef {
),
));
Some(
if context.config.spaces_within_angle_brackets() && lifetime_str.len() > 0 {
format!("for< {} > {}", lifetime_str, path_str)
} else {
format!("for<{}> {}", lifetime_str, path_str)
},
)
Some(if context.config.spaces_within_angle_brackets() &&
lifetime_str.len() > 0
{
format!("for< {} > {}", lifetime_str, path_str)
} else {
format!("for<{}> {}", lifetime_str, path_str)
})
} else {
self.trait_ref.rewrite(context, shape)
}

View File

@ -84,9 +84,9 @@ fn assert_output(source: &str, expected_filename: &str) {
let mut expected_file = fs::File::open(&expected_filename).expect("Couldn't open target");
let mut expected_text = String::new();
expected_file
.read_to_string(&mut expected_text)
.expect("Failed reading target");
expected_file.read_to_string(&mut expected_text).expect(
"Failed reading target",
);
let compare = make_diff(&expected_text, &output, DIFF_CONTEXT_SIZE);
if compare.len() > 0 {
@ -136,9 +136,11 @@ fn self_tests() {
warnings += format_report.warning_count();
}
assert!(warnings == 0,
"Rustfmt's code generated {} warnings",
warnings);
assert!(
warnings == 0,
"Rustfmt's code generated {} warnings",
warnings
);
}
#[test]
@ -170,7 +172,8 @@ fn format_lines_errors_are_reported() {
// For each file, run rustfmt and collect the output.
// Returns the number of files checked and the number of failures.
fn check_files<I>(files: I) -> (Vec<FormatReport>, u32, u32)
where I: Iterator<Item = String>
where
I: Iterator<Item = String>,
{
let mut count = 0;
let mut fails = 0;
@ -217,10 +220,12 @@ fn read_config(filename: &str) -> Config {
let mut config = if !sig_comments.is_empty() {
get_config(sig_comments.get("config").map(|x| &(*x)[..]))
} else {
get_config(Path::new(filename)
.with_extension("toml")
.file_name()
.and_then(std::ffi::OsStr::to_str))
get_config(
Path::new(filename)
.with_extension("toml")
.file_name()
.and_then(std::ffi::OsStr::to_str),
)
};
for (key, val) in &sig_comments {
@ -280,9 +285,9 @@ fn get_config(config_file: Option<&str>) -> Config {
let mut def_config_file = fs::File::open(config_file_name).expect("Couldn't open config");
let mut def_config = String::new();
def_config_file
.read_to_string(&mut def_config)
.expect("Couldn't read config");
def_config_file.read_to_string(&mut def_config).expect(
"Couldn't read config",
);
Config::from_toml(&def_config).expect("Invalid toml")
}
@ -305,16 +310,18 @@ fn read_significant_comments(file_name: &str) -> HashMap<String, String> {
.take_while(|line| line_regex.is_match(&line))
.filter_map(|line| {
regex.captures_iter(&line).next().map(|capture| {
(capture
.get(1)
.expect("Couldn't unwrap capture")
.as_str()
.to_owned(),
capture
.get(2)
.expect("Couldn't unwrap capture")
.as_str()
.to_owned())
(
capture
.get(1)
.expect("Couldn't unwrap capture")
.as_str()
.to_owned(),
capture
.get(2)
.expect("Couldn't unwrap capture")
.as_str()
.to_owned(),
)
})
})
.collect()
@ -322,9 +329,10 @@ fn read_significant_comments(file_name: &str) -> HashMap<String, String> {
// Compare output to input.
// TODO: needs a better name, more explanation.
fn handle_result(result: HashMap<String, String>,
target: Option<&str>)
-> Result<(), HashMap<String, Vec<Mismatch>>> {
fn handle_result(
result: HashMap<String, String>,
target: Option<&str>,
) -> Result<(), HashMap<String, Vec<Mismatch>>> {
let mut failures = HashMap::new();
for (file_name, fmt_text) in result {
@ -339,8 +347,10 @@ fn handle_result(result: HashMap<String, String>,
if fmt_text != text {
let diff = make_diff(&text, &fmt_text, DIFF_CONTEXT_SIZE);
assert!(!diff.is_empty(),
"Empty diff? Maybe due to a missing a newline at the end of a file?");
assert!(
!diff.is_empty(),
"Empty diff? Maybe due to a missing a newline at the end of a file?"
);
failures.insert(file_name, diff);
}
}
@ -374,15 +384,21 @@ fn get_target(file_name: &str, target: Option<&str>) -> String {
#[test]
fn rustfmt_diff_make_diff_tests() {
let diff = make_diff("a\nb\nc\nd", "a\ne\nc\nd", 3);
assert_eq!(diff,
vec![Mismatch {
line_number: 1,
lines: vec![DiffLine::Context("a".into()),
DiffLine::Resulting("b".into()),
DiffLine::Expected("e".into()),
DiffLine::Context("c".into()),
DiffLine::Context("d".into())],
}]);
assert_eq!(
diff,
vec![
Mismatch {
line_number: 1,
lines: vec![
DiffLine::Context("a".into()),
DiffLine::Resulting("b".into()),
DiffLine::Expected("e".into()),
DiffLine::Context("c".into()),
DiffLine::Context("d".into()),
],
},
]
);
}
#[test]

View File

@ -19,10 +19,14 @@ fn main() {
fn break_meee() {
{
(block_start, block_size, margin_block_start, margin_block_end) =
match (block_start, block_end, block_size) {
x => 1,
_ => 2,
};
(
block_start,
block_size,
margin_block_start,
margin_block_end,
) = match (block_start, block_end, block_size) {
x => 1,
_ => 2,
};
}
}

View File

@ -17,15 +17,15 @@ fn main() {
// Test case where first chain element isn't a path, but is shorter than
// the size of a tab.
x().y(|| match cond() {
true => (),
false => (),
});
true => (),
false => (),
});
loong_func().quux(move || if true {
1
} else {
2
});
1
} else {
2
});
some_fuuuuuuuuunction().method_call_a(aaaaa, bbbbb, |c| {
let x = c;
@ -47,14 +47,15 @@ fn main() {
});
let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum =
xxxxxxx.map(|x| x + 5)
.map(|x| x / 2)
.fold(0, |acc, x| acc + x);
xxxxxxx.map(|x| x + 5).map(|x| x / 2).fold(
0,
|acc, x| acc + x,
);
aaaaaaaaaaaaaaaa.map(|x| {
x += 1;
x
})
x += 1;
x
})
.filter(some_mod::some_filter)
}
@ -82,11 +83,13 @@ fn floaters() {
match x {
PushParam => {
// params are 1-indexed
stack.push(mparams[match cur.to_digit(10) {
Some(d) => d as usize - 1,
None => return Err("bad param number".to_owned()),
}]
.clone());
stack.push(
mparams[match cur.to_digit(10) {
Some(d) => d as usize - 1,
None => return Err("bad param number".to_owned()),
}]
.clone(),
);
}
}
}
@ -101,9 +104,9 @@ fn floaters() {
Foo { x: val }
.baz(|| {
force();
multiline();
})
force();
multiline();
})
.quux();
Foo {
@ -111,17 +114,17 @@ fn floaters() {
z: ok,
}
.baz(|| {
force();
multiline();
})
force();
multiline();
})
.quux();
a +
match x {
true => "yay!",
false => "boo!",
}
.bar()
match x {
true => "yay!",
false => "boo!",
}
.bar()
}
fn is_replaced_content() -> bool {
@ -163,8 +166,10 @@ fn issue1434() {
for _ in 0..100 {
let prototype_id = PrototypeIdData::from_reader::<_, B>(&mut self.file_cursor)
.chain_err(|| {
format!("could not read prototype ID at offset {:#010x}",
current_offset)
})?;
format!(
"could not read prototype ID at offset {:#010x}",
current_offset
)
})?;
}
}

View File

@ -19,15 +19,15 @@ fn main() {
// Test case where first chain element isn't a path, but is shorter than
// the size of a tab.
x().y(|| match cond() {
true => (),
false => (),
});
true => (),
false => (),
});
loong_func().quux(move || if true {
1
} else {
2
});
1
} else {
2
});
some_fuuuuuuuuunction().method_call_a(aaaaa, bbbbb, |c| {
let x = c;
@ -53,9 +53,9 @@ fn main() {
aaaaaaaaaaaaaaaa
.map(|x| {
x += 1;
x
})
x += 1;
x
})
.filter(some_mod::some_filter)
}
@ -81,10 +81,12 @@ fn floaters() {
match x {
PushParam => {
// params are 1-indexed
stack.push(mparams[match cur.to_digit(10) {
Some(d) => d as usize - 1,
None => return Err("bad param number".to_owned()),
}].clone());
stack.push(
mparams[match cur.to_digit(10) {
Some(d) => d as usize - 1,
None => return Err("bad param number".to_owned()),
}].clone(),
);
}
}
}
@ -98,25 +100,25 @@ fn floaters() {
Foo { x: val }
.baz(|| {
force();
multiline();
})
force();
multiline();
})
.quux();
Foo {
y: i_am_multi_line,
z: ok,
}.baz(|| {
force();
multiline();
})
force();
multiline();
})
.quux();
a +
match x {
true => "yay!",
false => "boo!",
}.bar()
match x {
true => "yay!",
false => "boo!",
}.bar()
}
fn is_replaced_content() -> bool {
@ -163,7 +165,7 @@ fn issue_1004() {
}?;
ty::tls::with(|tcx| {
let tap = ty::Binder(TraitAndProjections(principal, projections));
in_binder(f, tcx, &ty::Binder(""), Some(tap))
})?;
let tap = ty::Binder(TraitAndProjections(principal, projections));
in_binder(f, tcx, &ty::Binder(""), Some(tap))
})?;
}

View File

@ -4,13 +4,17 @@
fn main() {
let square = (|i: i32| i * i);
let commented =
|// first
a, // argument
// second
b: WithType, // argument
// ignored
_| (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
let commented = |// first
a, // argument
// second
b: WithType, // argument
// ignored
_| {
(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
)
};
let block_body = move |xxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
ref yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy| {
@ -91,9 +95,9 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
match (&left.node, &right.node) {
(&ExprBinary(l_op, ref ll, ref lr), &ExprBinary(r_op, ref rl, ref rr)) => {
l_op.node == r_op.node && self.eq_expr(ll, rl) && self.eq_expr(lr, rr) ||
swap_binop(l_op.node, ll, lr).map_or(false, |(l_op, ll, lr)| {
l_op == r_op.node && self.eq_expr(ll, rl) && self.eq_expr(lr, rr)
})
swap_binop(l_op.node, ll, lr).map_or(false, |(l_op, ll, lr)| {
l_op == r_op.node && self.eq_expr(ll, rl) && self.eq_expr(lr, rr)
})
}
}
}
@ -101,10 +105,10 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
fn foo() {
lifetimes_iter___map(|lasdfasfd| {
let hi = if l.bounds.is_empty() {
l.lifetime.span.hi
};
});
let hi = if l.bounds.is_empty() {
l.lifetime.span.hi
};
});
}
fn issue1405() {
@ -124,17 +128,18 @@ fn issue470() {
{
{
{
let explicit_arg_decls = explicit_arguments
.into_iter()
.enumerate()
.map(|(index, (ty, pattern))| {
let lvalue = Lvalue::Arg(index as u32);
block = this.pattern(block,
argument_extent,
hair::PatternRef::Hair(pattern),
&lvalue);
ArgDecl { ty: ty }
});
let explicit_arg_decls = explicit_arguments.into_iter().enumerate().map(|(index,
(ty,
pattern))| {
let lvalue = Lvalue::Arg(index as u32);
block = this.pattern(
block,
argument_extent,
hair::PatternRef::Hair(pattern),
&lvalue,
);
ArgDecl { ty: ty }
});
}
}
}
@ -144,19 +149,17 @@ fn issue470() {
impl Foo {
pub fn bar(&self) {
Some(SomeType {
push_closure_out_to_100_chars: iter(otherwise_it_works_ok
.into_iter()
.map(|f| Ok(f))),
})
push_closure_out_to_100_chars: iter(otherwise_it_works_ok.into_iter().map(|f| Ok(f))),
})
}
}
fn issue1329() {
aaaaaaaaaaaaaaaa
.map(|x| {
x += 1;
x
})
x += 1;
x
})
.filter
}

View File

@ -37,9 +37,11 @@ fn test() {
// #1388
const EXCEPTION_PATHS: &'static [&'static str] =
&[// std crates
"src/libstd/sys/", // Platform-specific code for std lives here.
"src/bootstrap"];
&[
// std crates
"src/libstd/sys/", // Platform-specific code for std lives here.
"src/bootstrap",
];
}
/// test123
@ -47,10 +49,10 @@ fn doc_comment() {}
fn chains() {
foo.bar(|| {
let x = 10;
// comment
x
})
let x = 10;
// comment
x
})
}
fn issue_1086() {

View File

@ -1,17 +1,19 @@
// Test comments on functions are preserved.
// Comment on foo.
fn foo<F, G>(a: aaaaaaaaaaaaa, // A comment
b: bbbbbbbbbbbbb, // a second comment
c: ccccccccccccc,
// Newline comment
d: ddddddddddddd,
// A multi line comment
// between args.
e: eeeeeeeeeeeee /* comment before paren */)
-> bar
where F: Foo, // COmment after where clause
G: Goo // final comment
fn foo<F, G>(
a: aaaaaaaaaaaaa, // A comment
b: bbbbbbbbbbbbb, // a second comment
c: ccccccccccccc,
// Newline comment
d: ddddddddddddd,
// A multi line comment
// between args.
e: eeeeeeeeeeeee, /* comment before paren */
) -> bar
where
F: Foo, // COmment after where clause
G: Goo, // final comment
{
}
@ -20,6 +22,8 @@ fn bar<F /* comment on F */, G /* comment on G */>() {}
fn baz() -> Baz /* Comment after return type */ {}
fn some_fn<T>() where T: Eq // some comment
fn some_fn<T>()
where
T: Eq, // some comment
{
}

View File

@ -2,11 +2,13 @@
// Array width
fn main() {
let lorem = vec!["ipsum",
"dolor",
"sit",
"amet",
"consectetur",
"adipiscing",
"elit"];
let lorem = vec![
"ipsum",
"dolor",
"sit",
"amet",
"consectetur",
"adipiscing",
"elit",
];
}

View File

@ -1,6 +1,7 @@
// rustfmt-chain_split_single_child: true
fn main() {
let files = fs::read_dir("tests/source")
.expect("Couldn't read source dir");
let files = fs::read_dir("tests/source").expect(
"Couldn't read source dir",
);
}

View File

@ -3,10 +3,10 @@
fn main() {
lorem_ipsum(|| {
println!("lorem");
println!("ipsum");
println!("dolor");
println!("sit");
println!("amet");
});
println!("lorem");
println!("ipsum");
println!("dolor");
println!("sit");
println!("amet");
});
}

View File

@ -8,11 +8,15 @@ trait Lorem {
// body
}
fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur,
adipiscing: Adipiscing, elit: Elit);
fn lorem(
ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur,
adipiscing: Adipiscing, elit: Elit
);
fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur,
adipiscing: Adipiscing, elit: Elit) {
fn lorem(
ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur,
adipiscing: Adipiscing, elit: Elit
) {
// body
}
}

View File

@ -8,25 +8,29 @@ trait Lorem {
// body
}
fn lorem(ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
consectetur: onsectetur,
adipiscing: Adipiscing,
elit: Elit);
fn lorem(
ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
consectetur: onsectetur,
adipiscing: Adipiscing,
elit: Elit,
);
// FIXME: Previous line should be formatted like this:
// fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur,
// adipiscing: Adipiscing, elit: Elit);
fn lorem(ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
consectetur: onsectetur,
adipiscing: Adipiscing,
elit: Elit) {
fn lorem(
ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
consectetur: onsectetur,
adipiscing: Adipiscing,
elit: Elit,
) {
// body
}
}

View File

@ -8,21 +8,25 @@ trait Lorem {
// body
}
fn lorem(ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
consectetur: onsectetur,
adipiscing: Adipiscing,
elit: Elit);
fn lorem(
ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
consectetur: onsectetur,
adipiscing: Adipiscing,
elit: Elit,
);
fn lorem(ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
consectetur: onsectetur,
adipiscing: Adipiscing,
elit: Elit) {
fn lorem(
ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
consectetur: onsectetur,
adipiscing: Adipiscing,
elit: Elit,
) {
// body
}
}

View File

@ -2,33 +2,41 @@
// Function arguments density
trait Lorem {
fn lorem(ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet);
fn lorem(
ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
);
fn lorem(ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet) {
fn lorem(
ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
) {
// body
}
fn lorem(ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
consectetur: onsectetur,
adipiscing: Adipiscing,
elit: Elit);
fn lorem(
ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
consectetur: onsectetur,
adipiscing: Adipiscing,
elit: Elit,
);
fn lorem(ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
consectetur: onsectetur,
adipiscing: Adipiscing,
elit: Elit) {
fn lorem(
ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
consectetur: onsectetur,
adipiscing: Adipiscing,
elit: Elit,
) {
// body
}
}

View File

@ -5,7 +5,7 @@ fn lorem(
ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet)
-> DolorSitAmetConsecteturAdipiscingElitLoremIpsumDolorSitAmetConsecteturAdipiscingElit {
amet: Amet,
) -> DolorSitAmetConsecteturAdipiscingElitLoremIpsumDolorSitAmetConsecteturAdipiscingElit {
// body
}

View File

@ -2,10 +2,11 @@
// Function arguments parenthesis on a newline
fn lorem
(ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet)
-> DolorSitAmetConsecteturAdipiscingElitLoremIpsumDolorSitAmetConsecteturAdipiscingElit {
(
ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
) -> DolorSitAmetConsecteturAdipiscingElitLoremIpsumDolorSitAmetConsecteturAdipiscingElit {
// body
}

View File

@ -12,7 +12,8 @@ fn lorem(ipsum: usize)
}
fn lorem<T>(ipsum: T)
where T: Add + Sub + Mul + Div
where
T: Add + Sub + Mul + Div,
{
// body
}

View File

@ -10,6 +10,7 @@ fn lorem(ipsum: usize) {
}
fn lorem<T>(ipsum: T)
where T: Add + Sub + Mul + Div {
where
T: Add + Sub + Mul + Div, {
// body
}

View File

@ -10,7 +10,8 @@ fn lorem(ipsum: usize) {
}
fn lorem<T>(ipsum: T)
where T: Add + Sub + Mul + Div
where
T: Add + Sub + Mul + Div,
{
// body
}

View File

@ -2,12 +2,14 @@
// Function call width
fn main() {
lorem("lorem",
"ipsum",
"dolor",
"sit",
"amet",
"consectetur",
"adipiscing",
"elit");
lorem(
"lorem",
"ipsum",
"dolor",
"sit",
"amet",
"consectetur",
"adipiscing",
"elit",
);
}

View File

@ -1,14 +1,16 @@
// rustfmt-fn_return_indent: WithArgs
// Function return type indent
fn lorem(ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
consectetur: Consectetur,
adipiscing: Adipiscing)
-> Elit
where Ipsum: Eq
fn lorem(
ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
consectetur: Consectetur,
adipiscing: Adipiscing,
) -> Elit
where
Ipsum: Eq,
{
// body
}

View File

@ -1,14 +1,16 @@
// rustfmt-fn_return_indent: WithWhereClause
// Function return type indent
fn lorem(ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
consectetur: Consectetur,
adipiscing: Adipiscing)
-> Elit
where Ipsum: Eq
fn lorem(
ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
consectetur: Consectetur,
adipiscing: Adipiscing,
) -> Elit
where
Ipsum: Eq,
{
// body
}

View File

@ -15,7 +15,7 @@ fn lorem<
amet: Amet,
adipiscing: Adipiscing,
consectetur: Consectetur,
elit: Elit)
-> T {
elit: Elit,
) -> T {
// body
}

View File

@ -7,14 +7,14 @@ fn lorem<Ipsum: Eq = usize,
Amet: Eq = usize,
Adipiscing: Eq = usize,
Consectetur: Eq = usize,
Elit: Eq = usize>
(ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
adipiscing: Adipiscing,
consectetur: Consectetur,
elit: Elit)
-> T {
Elit: Eq = usize>(
ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
adipiscing: Adipiscing,
consectetur: Consectetur,
elit: Elit,
) -> T {
// body
}

View File

@ -7,7 +7,8 @@ struct Lorem
}
struct Dolor<T>
where T: Eq
where
T: Eq,
{
sit: T,
}

View File

@ -6,6 +6,7 @@ struct Lorem {
}
struct Dolor<T>
where T: Eq {
where
T: Eq, {
sit: T,
}

View File

@ -6,7 +6,8 @@ struct Lorem {
}
struct Dolor<T>
where T: Eq
where
T: Eq,
{
sit: T,
}

View File

@ -14,10 +14,11 @@ 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));
}

View File

@ -2,9 +2,14 @@
// Where density
trait Lorem {
fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq;
fn ipsum<Dolor>(dolor: Dolor) -> Sit
where
Dolor: Eq;
fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq {
fn ipsum<Dolor>(dolor: Dolor) -> Sit
where
Dolor: Eq,
{
// body
}
}

View File

@ -2,10 +2,13 @@
// Where density
trait Lorem {
fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq;
fn ipsum<Dolor>(dolor: Dolor) -> Sit
where
Dolor: Eq;
fn ipsum<Dolor>(dolor: Dolor) -> Sit
where Dolor: Eq
where
Dolor: Eq,
{
// body
}

View File

@ -3,10 +3,12 @@
trait Lorem {
fn ipsum<Dolor>(dolor: Dolor) -> Sit
where Dolor: Eq;
where
Dolor: Eq;
fn ipsum<Dolor>(dolor: Dolor) -> Sit
where Dolor: Eq
where
Dolor: Eq,
{
// body
}

View File

@ -3,10 +3,12 @@
trait Lorem {
fn ipsum<Dolor>(dolor: Dolor) -> Sit
where Dolor: Eq;
where
Dolor: Eq;
fn ipsum<Dolor>(dolor: Dolor) -> Sit
where Dolor: Eq
where
Dolor: Eq,
{
// body
}

View File

@ -3,13 +3,19 @@
// Where layout
fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
where
Ipsum: IpsumDolorSitAmet,
Dolor: DolorSitAmetConsectetur,
{
// body
}
fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur, Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
where
Ipsum: IpsumDolorSitAmet,
Dolor: DolorSitAmetConsectetur,
Sit: SitAmetConsecteturAdipiscing,
Amet: AmetConsecteturAdipiscingElit,
{
// body
}

View File

@ -2,16 +2,19 @@
// Where layout
fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
where
Ipsum: IpsumDolorSitAmet,
Dolor: DolorSitAmetConsectetur,
{
// body
}
fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
where Ipsum: IpsumDolorSitAmet,
Dolor: DolorSitAmetConsectetur,
Sit: SitAmetConsecteturAdipiscing,
Amet: AmetConsecteturAdipiscingElit
where
Ipsum: IpsumDolorSitAmet,
Dolor: DolorSitAmetConsectetur,
Sit: SitAmetConsecteturAdipiscing,
Amet: AmetConsecteturAdipiscingElit,
{
// body
}

View File

@ -2,14 +2,19 @@
// Where layout
fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
where
Ipsum: IpsumDolorSitAmet,
Dolor: DolorSitAmetConsectetur,
{
// body
}
fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur,
Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
where
Ipsum: IpsumDolorSitAmet,
Dolor: DolorSitAmetConsectetur,
Sit: SitAmetConsecteturAdipiscing,
Amet: AmetConsecteturAdipiscingElit,
{
// body
}

View File

@ -2,17 +2,19 @@
// Where layout
fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
where Ipsum: IpsumDolorSitAmet,
Dolor: DolorSitAmetConsectetur
where
Ipsum: IpsumDolorSitAmet,
Dolor: DolorSitAmetConsectetur,
{
// body
}
fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
where Ipsum: IpsumDolorSitAmet,
Dolor: DolorSitAmetConsectetur,
Sit: SitAmetConsecteturAdipiscing,
Amet: AmetConsecteturAdipiscingElit
where
Ipsum: IpsumDolorSitAmet,
Dolor: DolorSitAmetConsectetur,
Sit: SitAmetConsecteturAdipiscing,
Amet: AmetConsecteturAdipiscingElit,
{
// body
}

View File

@ -2,10 +2,11 @@
// Where predicate indent
fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
where Ipsum: Eq,
Dolor: Eq,
Sit: Eq,
Amet: Eq
where
Ipsum: Eq,
Dolor: Eq,
Sit: Eq,
Amet: Eq,
{
// body
}

View File

@ -2,10 +2,11 @@
// Where predicate indent
fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
where Ipsum: Eq,
Dolor: Eq,
Sit: Eq,
Amet: Eq
where
Ipsum: Eq,
Dolor: Eq,
Sit: Eq,
Amet: Eq,
{
// body
}

View File

@ -11,7 +11,8 @@ pub enum Test {
}
pub enum Foo<'a, Y: Baz>
where X: Whatever
where
X: Whatever,
{
A,
}
@ -29,8 +30,10 @@ enum Bar {
}
enum LongVariants {
First(LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONG, // comment
VARIANT),
First(
LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONG, // comment
VARIANT
),
// This is the second variant
Second,
}
@ -47,9 +50,11 @@ enum StructLikeVariants {
}
enum X {
CreateWebGLPaintTask(Size2D<i32>,
GLContextAttributes,
IpcSender<Result<(IpcSender<CanvasMsg>, usize), String>>), /* This is a post comment */
CreateWebGLPaintTask(
Size2D<i32>,
GLContextAttributes,
IpcSender<Result<(IpcSender<CanvasMsg>, usize), String>>
), // This is a post comment
}
pub enum EnumWithAttributes {
@ -79,7 +84,8 @@ pub enum SingleStruct {
}
pub enum GenericEnum<I, T>
where I: Iterator<Item = T>
where
I: Iterator<Item = T>,
{
// Pre Comment
Left { list: I, root: T }, // Post-comment
@ -98,7 +104,7 @@ enum TestFormatFails {
fn nested_enum_test() {
if true {
enum TestEnum {
One(usize,
One(
usize,
usize,
usize,
@ -113,8 +119,10 @@ fn nested_enum_test() {
usize,
usize,
usize,
usize), /* AAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAA
* AAAAAAAAAAAAAAAAAAAAAA */
usize,
usize
), /* AAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAA
* AAAAAAAAAAAAAAAAAAAAAA */
Two, /* AAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
* AAAAAAAAAAAAAAAAAA */
}
@ -142,9 +150,11 @@ pub enum Bencoding<'i> {
// #1261
pub enum CoreResourceMsg {
SetCookieForUrl(ServoUrl,
#[serde(deserialize_with = "::hyper_serde::deserialize",
serialize_with = "::hyper_serde::serialize")]
Cookie,
CookieSource),
SetCookieForUrl(
ServoUrl,
#[serde(deserialize_with = "::hyper_serde::deserialize",
serialize_with = "::hyper_serde::serialize")]
Cookie,
CookieSource
),
}

View File

@ -7,23 +7,21 @@ 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);
self.codemap.span_to_filename(m.inner);
let some_val = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * bbbb /
(bbbbbb - function_call(x, *very_long_pointer, y)) + 1000;
(bbbbbb - function_call(x, *very_long_pointer, y)) + 1000;
some_ridiculously_loooooooooooooooooooooong_function(10000 * 30000000000 +
40000 / 1002200000000 -
50000 * sqrt(-1),
trivial_value);
(((((((((aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
a +
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
aaaaa)))))))));
some_ridiculously_loooooooooooooooooooooong_function(
10000 * 30000000000 + 40000 / 1002200000000 - 50000 * sqrt(-1),
trivial_value,
);
(((((((((aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + a +
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaa))))))))) ;
{
for _ in 0..10 {}
@ -49,18 +47,22 @@ 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) =
1111 + 2222 {}
tuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuple) =
1111 + 2222
{}
if let (some_very_large,
tuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuple) = 1 + 2 + 3 {}
tuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuple) = 1 + 2 + 3
{}
let test = if true { 5 } else { 3 };
@ -71,13 +73,13 @@ fn foo() -> bool {
} else {
// Check subformatting
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
}
}
fn bar() {
let range = (111111111 + 333333333333333333 + 1111 + 400000000000000000)..
(2222 + 2333333333333333);
(2222 + 2333333333333333);
let another_range = 5..some_func(a, b /* comment */);
@ -85,10 +87,12 @@ fn bar() {
call_forever();
}
syntactically_correct(loop {
sup('?');
},
if cond { 0 } else { 1 });
syntactically_correct(
loop {
sup('?');
},
if cond { 0 } else { 1 },
);
let third = ..10;
let infi_range = ..;
@ -102,8 +106,10 @@ fn bar() {
}
}
let x = (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
a);
let x = (
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
a,
);
}
fn baz() {
@ -144,8 +150,8 @@ fn qux() {
fn issue227() {
{
let handler = box DocumentProgressHandler::new(addr,
DocumentProgressTask::DOMContentLoaded);
let handler =
box DocumentProgressHandler::new(addr, DocumentProgressTask::DOMContentLoaded);
}
}
@ -158,59 +164,104 @@ fn issue184(source: &str) {
}
fn arrays() {
let x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 7, 8, 9, 0, 1, 2, 3,
4, 5, 6, 7, 8, 9, 0];
let x = [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
0,
7,
8,
9,
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
0,
];
let y = [// comment
1,
2, // post comment
3];
let y = [
// comment
1,
2, // post comment
3,
];
let xy = [strukt {
test123: value_one_two_three_four,
turbo: coolio(),
},
// comment
1];
let xy = [
strukt {
test123: value_one_two_three_four,
turbo: coolio(),
},
// comment
1,
];
let a = WeightedChoice::new(&mut [Weighted {
weightweight: x,
item: 0,
},
Weighted {
weightweight: 1,
item: 1,
},
Weighted {
weightweight: x,
item: 2,
},
Weighted {
weightweight: 1,
item: 3,
}]);
let a = WeightedChoice::new(
&mut [
Weighted {
weightweight: x,
item: 0,
},
Weighted {
weightweight: 1,
item: 1,
},
Weighted {
weightweight: x,
item: 2,
},
Weighted {
weightweight: 1,
item: 3,
},
],
);
let z = [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
yyyyyyyyyyyyyyyyyyyyyyyyyyy,
zzzzzzzzzzzzzzzzzz,
q];
let z = [
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
yyyyyyyyyyyyyyyyyyyyyyyyyyy,
zzzzzzzzzzzzzzzzzz,
q,
];
[1 + 3, 4, 5, 6, 7, 7, fncall::<Vec<_>>(3 - 1)]
}
fn returns() {
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&
return;
return;
return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
}
fn addrof() {
&mut (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
&(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
}
fn casts() {
@ -220,7 +271,7 @@ fn casts() {
let some_trait_xxx = xxxxxxxxxxx + xxxxxxxxxxxxx as SomeTraitXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX;
let slightly_longer_trait = yyyyyyyyy +
yyyyyyyyyyy as SomeTraitYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY;
yyyyyyyyyyy as SomeTraitYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY;
}
fn indices() {
@ -232,9 +283,9 @@ fn indices() {
fn repeats() {
let x = [aaaaaaaaaaaaaaaaaaaaaaaaaaaa + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + cccccccccccccccc;
x + y + z];
x + y + z];
let y = [aaaaaaaaaaaaaaaaaaaaaaaaaaaa + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + cccccccccccccccc;
xxxxx + yyyyy + zzzzz];
xxxxx + yyyyy + zzzzz];
}
fn blocks() {
@ -257,7 +308,7 @@ fn issue767() {
fn ranges() {
let x = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
let y = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
let z = ...x;
a...b
@ -279,10 +330,12 @@ fn complex_if_else() {
} else if xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxx {
yo();
} else if let Some(x) =
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx {
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
{
ha();
} else if xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +
xxxxxxxxx {
xxxxxxxxx
{
yo();
}
}
@ -290,10 +343,12 @@ fn complex_if_else() {
fn issue1106() {
{
if let hir::ItemEnum(ref enum_def, ref generics) =
self.ast_map.expect_item(enum_node_id).node {}
self.ast_map.expect_item(enum_node_id).node
{}
}
for entry in WalkDir::new(path)
.into_iter()
.filter_entry(|entry| exclusions.filter_entry(entry)) {}
for entry in WalkDir::new(path).into_iter().filter_entry(|entry| {
exclusions.filter_entry(entry)
})
{}
}

View File

@ -3,8 +3,10 @@
extern "C" {
fn c_func(x: *mut *mut libc::c_void);
fn c_func(x: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,
y: YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY);
fn c_func(
x: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,
y: YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY,
);
#[test123]
fn foo() -> uint64_t;
@ -13,12 +15,13 @@ extern "C" {
}
extern "C" {
fn DMR_GetDevice(pHDev: *mut HDEV,
searchMode: DeviceSearchMode,
pSearchString: *const c_char,
devNr: c_uint,
wildcard: c_char)
-> TDMR_ERROR;
fn DMR_GetDevice(
pHDev: *mut HDEV,
searchMode: DeviceSearchMode,
pSearchString: *const c_char,
devNr: c_uint,
wildcard: c_char,
) -> TDMR_ERROR;
fn quux() -> (); // Post comment
}
@ -30,21 +33,23 @@ extern "Rust" {
}
extern "C" {
fn syscall(number: libc::c_long, // comment 1
// comm 2
... /* sup? */)
-> libc::c_long;
fn syscall(
number: libc::c_long, // comment 1
// comm 2
... // sup?
) -> libc::c_long;
fn foo(x: *const c_char, ...) -> libc::c_long;
}
extern "C" {
pub fn freopen(filename: *const c_char,
mode: *const c_char,
mode2: *const c_char,
mode3: *const c_char,
file: *mut FILE)
-> *mut FILE;
pub fn freopen(
filename: *const c_char,
mode: *const c_char,
mode2: *const c_char,
mode3: *const c_char,
file: *mut FILE,
) -> *mut FILE;
}
extern "C" {}

View File

@ -1,22 +1,24 @@
// #1587
pub trait X {
fn a(&self) -> &'static str;
fn bcd(&self,
c: &str, // comment on this arg
d: u16, // comment on this arg
e: &Vec<String>, // comment on this arg
) -> Box<Q>;
fn bcd(
&self,
c: &str, // comment on this arg
d: u16, // comment on this arg
e: &Vec<String>, // comment on this arg
) -> Box<Q>;
}
// #1595
fn foo(arg1: LongTypeName,
arg2: LongTypeName,
arg3: LongTypeName,
arg4: LongTypeName,
arg5: LongTypeName,
arg6: LongTypeName,
arg7: LongTypeName,
fn foo(
arg1: LongTypeName,
arg2: LongTypeName,
arg3: LongTypeName,
arg4: LongTypeName,
arg5: LongTypeName,
arg6: LongTypeName,
arg7: LongTypeName,
//arg8: LongTypeName,
) {
) {
// do stuff
}

View File

@ -24,14 +24,18 @@ fn bar<
}
fn baz()
where X: TTTTTTTT
where
X: TTTTTTTT,
{
baz();
}
fn qux()
where X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT, X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT, X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT
where
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
{
baz();
}
@ -59,7 +63,8 @@ impl Foo {
}
fn baz()
where X: TTTTTTTT
where
X: TTTTTTTT,
{
baz();
}

View File

@ -24,16 +24,19 @@ fn bar<
}
fn qux()
where X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT, X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT
where
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
{
baz();
}
fn qux()
where X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT
where
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
{
baz();
}

View File

@ -3,21 +3,26 @@
// Test different indents.
fn qux()
where X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT
where
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
{
baz();
}
fn qux() where X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT {
fn qux()
where
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
{
baz();
}
fn qux(a: Aaaaaaaaaaaaaaaaa)
where X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT
where
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
X: TTTTTTTTTTTTTTTTTTTTTTTTTTTT,
{
baz();
}

View File

@ -31,7 +31,8 @@ fn bar(
}
fn foo(a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb)
where T: UUUUUUUUUUU {
where
T: UUUUUUUUUUU, {
foo();
}
@ -41,12 +42,14 @@ fn bar(
c: Cccccccccccccccccc,
d: Dddddddddddddddd,
e: Eeeeeeeeeeeeeee,
) where T: UUUUUUUUUUU {
) where
T: UUUUUUUUUUU, {
bar();
}
fn foo(a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb) -> String
where T: UUUUUUUUUUU {
where
T: UUUUUUUUUUU, {
foo();
}
@ -57,7 +60,8 @@ fn bar(
d: Dddddddddddddddd,
e: Eeeeeeeeeeeeeee,
) -> String
where T: UUUUUUUUUUU {
where
T: UUUUUUUUUUU, {
bar();
}

View File

@ -31,7 +31,8 @@ fn bar(
}
fn foo(a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb)
where T: UUUUUUUUUUU {
where
T: UUUUUUUUUUU, {
foo();
}
@ -41,12 +42,14 @@ fn bar(
c: Cccccccccccccccccc,
d: Dddddddddddddddd,
e: Eeeeeeeeeeeeeee,
) where T: UUUUUUUUUUU {
) where
T: UUUUUUUUUUU, {
bar();
}
fn foo(a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb) -> String
where T: UUUUUUUUUUU {
where
T: UUUUUUUUUUU, {
foo();
}
@ -57,7 +60,8 @@ fn bar(
d: Dddddddddddddddd,
e: Eeeeeeeeeeeeeee,
) -> String
where T: UUUUUUUUUUU {
where
T: UUUUUUUUUUU, {
bar();
}
@ -67,7 +71,8 @@ trait Test {
fn bar(a: u8) -> String {}
fn bar(a: u8) -> String
where Foo: foooo,
Bar: barrr {
where
Foo: foooo,
Bar: barrr, {
}
}

View File

@ -2,14 +2,18 @@
// Test some of the ways function signatures can be customised.
// Test compressed layout of args.
fn foo(a: Aaaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbbbb, c: Ccccccccccccccccc,
d: Ddddddddddddddddddddddddd, e: Eeeeeeeeeeeeeeeeeee) {
fn foo(
a: Aaaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbbbb, c: Ccccccccccccccccc, d: Ddddddddddddddddddddddddd,
e: Eeeeeeeeeeeeeeeeeee
) {
foo();
}
impl Foo {
fn foo(self, a: Aaaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbbbb, c: Ccccccccccccccccc,
d: Ddddddddddddddddddddddddd, e: Eeeeeeeeeeeeeeeeeee) {
fn foo(
self, a: Aaaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbbbb, c: Ccccccccccccccccc,
d: Ddddddddddddddddddddddddd, e: Eeeeeeeeeeeeeeeeeee
) {
foo();
}
}

View File

@ -1,77 +1,88 @@
// rustfmt-normalize_comments: true
fn simple(// pre-comment on a function!?
i: i32, // yes, it's possible!
response: NoWay /* hose */) {
fn op(x: Typ,
key: &[u8],
upd: Box<Fn(Option<&memcache::Item>)
-> (memcache::Status, Result<memcache::Item, Option<String>>)>)
-> MapResult {
fn simple(
// pre-comment on a function!?
i: i32, // yes, it's possible!
response: NoWay, // hose
) {
fn op(
x: Typ,
key: &[u8],
upd: Box<Fn(Option<&memcache::Item>)
-> (memcache::Status, Result<memcache::Item, Option<String>>)>,
) -> MapResult {
}
"cool"
}
fn weird_comment(// /*/ double level */ comment
x: Hello, // /*/* tripple, even */*/
// Does this work?
y: World) {
simple(// does this preserve comments now?
42,
NoWay)
fn weird_comment(
// /*/ double level */ comment
x: Hello, // /*/* tripple, even */*/
// Does this work?
y: World,
) {
simple(
// does this preserve comments now?
42,
NoWay,
)
}
fn generic<T>(arg: T) -> &SomeType
where T: Fn(// First arg
A,
// Second argument
B,
C,
D,
// pre comment
E /* last comment */)
-> &SomeType
where
T: Fn(// First arg
A,
// Second argument
B,
C,
D,
// pre comment
E /* last comment */)
-> &SomeType,
{
arg(a, b, c, d, e)
}
fn foo() -> ! {}
pub fn http_fetch_async(listener: Box<AsyncCORSResponseListener + Send>,
script_chan: Box<ScriptChan + Send>) {
pub fn http_fetch_async(
listener: Box<AsyncCORSResponseListener + Send>,
script_chan: Box<ScriptChan + Send>,
) {
}
fn some_func<T: Box<Trait + Bound>>(val: T) {}
fn zzzzzzzzzzzzzzzzzzzz<Type, NodeType>(selff: Type,
mut handle: node::Handle<IdRef<'id, Node<K, V>>,
Type,
NodeType>)
-> SearchStack<'a, K, V, Type, NodeType> {
fn zzzzzzzzzzzzzzzzzzzz<Type, NodeType>(
selff: Type,
mut handle: node::Handle<IdRef<'id, Node<K, V>>, Type, NodeType>,
) -> SearchStack<'a, K, V, Type, NodeType> {
}
unsafe fn generic_call(cx: *mut JSContext,
argc: libc::c_uint,
vp: *mut JSVal,
is_lenient: bool,
call: unsafe extern "C" fn(*const JSJitInfo,
*mut JSContext,
HandleObject,
*mut libc::c_void,
u32,
*mut JSVal)
-> u8) {
unsafe fn generic_call(
cx: *mut JSContext,
argc: libc::c_uint,
vp: *mut JSVal,
is_lenient: bool,
call: unsafe extern "C" fn(*const JSJitInfo,
*mut JSContext,
HandleObject,
*mut libc::c_void,
u32,
*mut JSVal)
-> u8,
) {
let f: fn(_, _) -> _ = panic!();
}
pub fn start_export_thread<C: CryptoSchemee + 'static>
(database: &Database,
crypto_scheme: &C,
block_size: usize,
source_path: &Path)
-> BonzoResult<mpsc::Consumer<'static, FileInstruction>> {
pub fn start_export_thread<C: CryptoSchemee + 'static>(
database: &Database,
crypto_scheme: &C,
block_size: usize,
source_path: &Path,
) -> BonzoResult<mpsc::Consumer<'static, FileInstruction>> {
}
pub fn waltz(cwd: &Path) -> CliAssert {

View File

@ -14,7 +14,8 @@ fn empty() {}
fn foo_return() -> String { "yay" }
fn foo_where() -> T
where T: Sync
where
T: Sync,
{
let x = 2;
}
@ -62,4 +63,8 @@ trait CoolerTypes {
fn dummy(&self) {}
}
fn Foo<T>() where T: Bar {}
fn Foo<T>()
where
T: Bar,
{
}

View File

@ -1,12 +1,14 @@
fn f(xxxxxxxxxxxxxxxxxx: fn(a, b, b) -> a,
xxxxxxxxxxxxxxxxxx: fn() -> a,
xxxxxxxxxxxxxxxxxx: fn(a, b, b),
xxxxxxxxxxxxxxxxxx: fn(),
xxxxxxxxxxxxxxxxxx: fn(a, b, b) -> !,
xxxxxxxxxxxxxxxxxx: fn() -> !)
where F1: Fn(a, b, b) -> a,
F2: Fn(a, b, b),
F3: Fn(),
F4: Fn() -> u32
fn f(
xxxxxxxxxxxxxxxxxx: fn(a, b, b) -> a,
xxxxxxxxxxxxxxxxxx: fn() -> a,
xxxxxxxxxxxxxxxxxx: fn(a, b, b),
xxxxxxxxxxxxxxxxxx: fn(),
xxxxxxxxxxxxxxxxxx: fn(a, b, b) -> !,
xxxxxxxxxxxxxxxxxx: fn() -> !,
) where
F1: Fn(a, b, b) -> a,
F2: Fn(a, b, b),
F3: Fn(),
F4: Fn() -> u32,
{
}

View File

@ -2,24 +2,36 @@
fn foo(a: AAAA, b: BBB, c: CCC) -> RetType {}
fn foo(a: AAAA, b: BBB /* some, weird, inline comment */, c: CCC) -> RetType where T: Blah {}
fn foo(a: AAAA, b: BBB /* some, weird, inline comment */, c: CCC) -> RetType
where
T: Blah,
{
}
fn foo(a: AAA /* (comment) */) where T: Blah {}
fn foo(a: AAA /* (comment) */)
where
T: Blah,
{
}
fn foo(a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB)
-> RetType
where T: Blah
fn foo(
a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
) -> RetType
where
T: Blah,
{
}
fn foo<U, T>(a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB)
-> RetType
where T: Blah,
U: dsfasdfasdfasd
fn foo<U, T>(
a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
) -> RetType
where
T: Blah,
U: dsfasdfasdfasd,
{
}
@ -27,21 +39,27 @@ fn foo<U, T>(a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
fn foo<U: Fn(A) -> B /* paren inside generics */>() {}
impl Foo {
fn with_no_errors<T, F>(&mut self, f: F) -> T where F: FnOnce(&mut Resolver) -> T {}
fn with_no_errors<T, F>(&mut self, f: F) -> T
where
F: FnOnce(&mut Resolver) -> T,
{
}
fn foo(mut self, mut bar: u32) {}
fn bar(self, mut bazz: u32) {}
}
pub fn render<'a,
N: Clone + 'a,
E: Clone + 'a,
G: Labeller<'a, N, E> + GraphWalk<'a, N, E>,
W: Write>
(g: &'a G,
w: &mut W)
-> io::Result<()> {
pub fn render<
'a,
N: Clone + 'a,
E: Clone + 'a,
G: Labeller<'a, N, E> + GraphWalk<'a, N, E>,
W: Write
>(
g: &'a G,
w: &mut W,
) -> io::Result<()> {
render_opts(g, w, &[])
}
@ -81,23 +99,23 @@ fn foo(a: i32) -> i32 {
if a > 0 { 1 } else { 2 }
}
fn ______________________baz
(a: i32)
-> *mut ::std::option::Option<extern "C" fn(arg1: i32, _____________________a: i32, arg3: i32)
-> ()> {
fn ______________________baz(
a: i32,
) -> *mut ::std::option::Option<extern "C" fn(arg1: i32, _____________________a: i32, arg3: i32) -> ()> {
}
pub fn check_path<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
path: &hir::Path,
id: ast::NodeId,
cb: &mut FnMut(DefId, Span, &Option<&Stability>, &Option<Depecation>)) {
pub fn check_path<'a, 'tcx>(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
path: &hir::Path,
id: ast::NodeId,
cb: &mut FnMut(DefId, Span, &Option<&Stability>, &Option<Depecation>),
) {
}
pub fn check_path<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
path: &hir::Path,
id: ast::NodeId,
cb: &mut FnMut(DefId,
Span,
&Option<&Stability>,
&Option<Deprecation>)) {
pub fn check_path<'a, 'tcx>(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
path: &hir::Path,
id: ast::NodeId,
cb: &mut FnMut(DefId, Span, &Option<&Stability>, &Option<Deprecation>),
) {
}

View File

@ -11,12 +11,13 @@ fn do_bar(a: u8) -> u8 {
}
// Multiple arguments should each get their own line.
fn do_bar(a: u8,
mut b: u8,
c: &u8,
d: &mut u8,
closure: &Fn(i32) -> i32)
-> i32 {
fn do_bar(
a: u8,
mut b: u8,
c: &u8,
d: &mut u8,
closure: &Fn(i32) -> i32,
) -> i32 {
// This feature should not affect closures.
let bar = |x: i32, y: i32| -> i32 { x + y };
bar(a, b)
@ -26,10 +27,12 @@ fn do_bar(a: u8,
// the whole list should probably be pushed to the next line with hanging
// indent. That's not what happens though, so check current behaviour instead.
// In any case, it should maintain single argument per line.
fn do_this_that_and_the_other_thing(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: u8,
b: u8,
c: u8,
d: u8) {
fn do_this_that_and_the_other_thing(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: u8,
b: u8,
c: u8,
d: u8,
) {
this();
that();
the_other_thing();

View File

@ -54,8 +54,9 @@ fn bar(
d: Dddddddddddddddd,
e: Eeeeeeeeeeeeeee,
) -> String
where X: Fooooo,
Y: Baaar
where
X: Fooooo,
Y: Baaar,
{
bar();
}
@ -65,22 +66,27 @@ fn foo() -> T {
}
fn foo() -> T
where X: Foooo,
Y: Baaar
where
X: Foooo,
Y: Baaar,
{
foo();
}
fn foo() where X: Foooo {}
fn foo()
where X: Foooo,
Y: Baaar
where
X: Foooo,
{
}
fn foo
()
fn foo()
where
X: Foooo,
Y: Baaar,
{
}
fn foo()
-> (Loooooooooooooooooooooong, Reeeeeeeeeeeeeeeeeeeeeeeeturn, iiiiiiiiis, Looooooooooooooooong)
{
foo();
@ -90,8 +96,7 @@ 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();
}

View File

@ -22,7 +22,8 @@ fn main() {
let str = "AAAAAAAAAAAAAAaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAa";
if let (some_very_large,
tuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuple) = 1 + 2 + 3 {}
tuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuple) = 1 + 2 + 3
{}
if cond() {
something();
@ -30,7 +31,7 @@ fn main() {
something_else();
} else {
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
}
unsafe /* very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
@ -47,21 +48,24 @@ fn main() {
.go_to_next_line_with_tab()
.go_to_next_line_with_tab();
let z = [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
yyyyyyyyyyyyyyyyyyyyyyyyyyy,
zzzzzzzzzzzzzzzzzz,
q];
let z = [
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
yyyyyyyyyyyyyyyyyyyyyyyyyyy,
zzzzzzzzzzzzzzzzzz,
q,
];
fn generic<T>(arg: T) -> &SomeType
where T: Fn(// First arg
A,
// Second argument
B,
C,
D,
// pre comment
E /* last comment */)
-> &SomeType
where
T: Fn(// First arg
A,
// Second argument
B,
C,
D,
// pre comment
E /* last comment */)
-> &SomeType,
{
arg(a, b, c, d, e)
}

View File

@ -7,7 +7,8 @@ impl<K, V, NodeRef: Deref<Target = Node<K, V>>> Handle<NodeRef, handle::Edge, ha
}
impl<V> Test<V>
where V: Clone // This comment is NOT removed by formating!
where
V: Clone, // This comment is NOT removed by formating!
{
pub fn new(value: V) -> Self {
Test {

View File

@ -22,7 +22,8 @@ pub impl Foo for Bar {
}
pub unsafe impl<'a, 'b, X, Y: Foo<Bar>> !Foo<'a, X> for Bar<'b, Y>
where X: Foo<'a, Z>
where
X: Foo<'a, Z>,
{
fn foo() {
"hi"
@ -30,7 +31,8 @@ pub unsafe impl<'a, 'b, X, Y: Foo<Bar>> !Foo<'a, X> for Bar<'b, Y>
}
impl<'a, 'b, X, Y: Foo<Bar>> Foo<'a, X> for Bar<'b, Y>
where X: Fooooooooooooooooooooooooooooo<'a, Z>
where
X: Fooooooooooooooooooooooooooooo<'a, Z>,
{
fn foo() {
"hi"
@ -38,17 +40,23 @@ impl<'a, 'b, X, Y: Foo<Bar>> Foo<'a, X> for Bar<'b, Y>
}
impl<'a, 'b, X, Y: Foo<Bar>> Foo<'a, X> for Bar<'b, Y>
where X: Foooooooooooooooooooooooooooo<'a, Z>
where
X: Foooooooooooooooooooooooooooo<'a, Z>,
{
fn foo() {
"hi"
}
}
impl<T> Foo for Bar<T> where T: Baz {}
impl<T> Foo for Bar<T>
where T: Baz
where
T: Baz,
{
}
impl<T> Foo for Bar<T>
where
T: Baz,
{
// Comment
}
@ -101,7 +109,8 @@ impl Y5000 {
}
pub impl<T> Foo for Bar<T>
where T: Foo
where
T: Foo,
{
fn foo() {
"hi"
@ -109,21 +118,27 @@ pub impl<T> Foo for Bar<T>
}
pub impl<T, Z> Foo for Bar<T, Z>
where T: Foo,
Z: Baz
where
T: Foo,
Z: Baz,
{
}
mod m {
impl<T> PartialEq for S<T>
where T: PartialEq
where
T: PartialEq,
{
fn eq(&self, other: &Self) {
true
}
}
impl<T> PartialEq for S<T> where T: PartialEq {}
impl<T> PartialEq for S<T>
where
T: PartialEq,
{
}
}
impl<BorrowType, K, V, NodeType, HandleType>
@ -136,10 +151,11 @@ impl<BorrowType, K, V, NodeType, HandleType> PartialEq
mod x {
impl<A, B, C, D> Foo
where A: 'static,
B: 'static,
C: 'static,
D: 'static
where
A: 'static,
B: 'static,
C: 'static,
D: 'static,
{
}
}

View File

@ -1,15 +1,18 @@
// Test overlong function signature
pub unsafe fn reborrow_mut(&mut X: Abcde)
-> Handle<NodeRef<marker::Mut, K, V, NodeType>, HandleType> {
pub unsafe fn reborrow_mut(
&mut X: Abcde,
) -> Handle<NodeRef<marker::Mut, K, V, NodeType>, HandleType> {
}
pub fn merge(mut X: Abcdef)
-> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::Edge> {
pub fn merge(
mut X: Abcdef,
) -> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::Edge> {
}
impl Handle {
pub fn merge(a: Abcd)
-> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::Edge> {
pub fn merge(
a: Abcd,
) -> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::Edge> {
}
}
@ -19,6 +22,8 @@ fn veeeeeeeeeeeeeeeeeeeeery_long_name(a: FirstTypeeeeeeeeee, b: SecondTypeeeeeee
fn veeeeeeeeeeeeeeeeeeeeeery_long_name(a: FirstTypeeeeeeeeee, b: SecondTypeeeeeeeeeeeeeeeeeeeeeee) {
}
fn veeeeeeeeeeeeeeeeeeeeeeery_long_name(a: FirstTypeeeeeeeeee,
b: SecondTypeeeeeeeeeeeeeeeeeeeeeee) {
fn veeeeeeeeeeeeeeeeeeeeeeery_long_name(
a: FirstTypeeeeeeeeee,
b: SecondTypeeeeeeeeeeeeeeeeeeeeeee,
) {
}

View File

@ -1,9 +1,11 @@
fn foo() {
let with_alignment = if condition__uses_alignment_for_first_if__0 ||
condition__uses_alignment_for_first_if__1 ||
condition__uses_alignment_for_first_if__2 {
condition__uses_alignment_for_first_if__1 ||
condition__uses_alignment_for_first_if__2
{
} else if condition__no_alignment_for_later_else__0 ||
condition__no_alignment_for_later_else__1 ||
condition__no_alignment_for_later_else__2 {
condition__no_alignment_for_later_else__1 ||
condition__no_alignment_for_later_else__2
{
};
}

View File

@ -1,7 +1,8 @@
// rustfmt-max_width: 80
fn foo() {
polyfill::slice::fill(&mut self.pending[padding_pos..
(self.algorithm.block_len - 8)],
0);
polyfill::slice::fill(
&mut self.pending[padding_pos..(self.algorithm.block_len - 8)],
0,
);
}

View File

@ -4,10 +4,10 @@ fn main() {
.map(|s| s)
.map(|s| s.to_string())
.map(|res| match Some(res) {
Some(ref s) if s == "" => 41,
Some(_) => 42,
_ => 43,
})
Some(ref s) if s == "" => 41,
Some(_) => 42,
_ => 43,
})
}
println!("{:?}", f())
}

View File

@ -12,8 +12,9 @@ fn baz(p: Packet) {
loop {
loop {
if let Packet::Transaction {
state: TransactionState::Committed(ts, ..), ..
} = p {
state: TransactionState::Committed(ts, ..), ..
} = p
{
unreachable!()
}
}

View File

@ -1,27 +1,29 @@
fn issue1468() {
euc_jp_decoder_functions!({
let trail_minus_offset = byte.wrapping_sub(0xA1);
// Fast-track Hiragana (60% according to Lunde)
// and Katakana (10% acconding to Lunde).
if jis0208_lead_minus_offset == 0x03 &&
trail_minus_offset < 0x53 {
// Hiragana
handle.write_upper_bmp(0x3041 + trail_minus_offset as u16)
} else if jis0208_lead_minus_offset == 0x04 &&
trail_minus_offset < 0x56 {
// Katakana
handle.write_upper_bmp(0x30A1 + trail_minus_offset as u16)
} else if trail_minus_offset > (0xFE - 0xA1) {
if byte < 0x80 {
return (DecoderResult::Malformed(1, 0),
unread_handle_trail.unread(),
handle.written());
}
return (DecoderResult::Malformed(2, 0),
unread_handle_trail.consumed(),
handle.written());
} else {
unreachable!();
}
});
let trail_minus_offset = byte.wrapping_sub(0xA1);
// Fast-track Hiragana (60% according to Lunde)
// and Katakana (10% acconding to Lunde).
if jis0208_lead_minus_offset == 0x03 && trail_minus_offset < 0x53 {
// Hiragana
handle.write_upper_bmp(0x3041 + trail_minus_offset as u16)
} else if jis0208_lead_minus_offset == 0x04 && trail_minus_offset < 0x56 {
// Katakana
handle.write_upper_bmp(0x30A1 + trail_minus_offset as u16)
} else if trail_minus_offset > (0xFE - 0xA1) {
if byte < 0x80 {
return (
DecoderResult::Malformed(1, 0),
unread_handle_trail.unread(),
handle.written(),
);
}
return (
DecoderResult::Malformed(2, 0),
unread_handle_trail.consumed(),
handle.written(),
);
} else {
unreachable!();
}
});
}

View File

@ -1,12 +1,15 @@
impl ISizeAndMarginsComputer for AbsoluteNonReplaced {
fn solve_inline_size_constraints(&self,
block: &mut BlockFlow,
input: &ISizeConstraintInput)
-> ISizeConstraintSolution {
fn solve_inline_size_constraints(
&self,
block: &mut BlockFlow,
input: &ISizeConstraintInput,
) -> ISizeConstraintSolution {
let (inline_start, inline_size, margin_inline_start, margin_inline_end) =
match (inline_startssssssxxxxxxsssssxxxxxxxxxssssssxxx,
inline_startssssssxxxxxxsssssxxxxxxxxxssssssxxx) {
match (
inline_startssssssxxxxxxsssssxxxxxxxxxssssssxxx,
inline_startssssssxxxxxxsssssxxxxxxxxxssssssxxx,
) {
(MaybeAuto::Auto, MaybeAuto::Auto, MaybeAuto::Auto) => {
let margin_start = inline_start_margin.specified_or_zero();
let margin_end = inline_end_margin.specified_or_zero();
@ -14,9 +17,9 @@ impl ISizeAndMarginsComputer for AbsoluteNonReplaced {
// and inline-size Auto.
//
// Set inline-end to zero to calculate inline-size.
let inline_size =
block.get_shrink_to_fit_inline_size(available_inline_size -
(margin_start + margin_end));
let inline_size = block.get_shrink_to_fit_inline_size(
available_inline_size - (margin_start + margin_end),
);
(Au(0), inline_size, margin_start, margin_end)
}
};
@ -30,9 +33,9 @@ impl ISizeAndMarginsComputer for AbsoluteNonReplaced {
// and inline-size Auto.
//
// Set inline-end to zero to calculate inline-size.
let inline_size =
block.get_shrink_to_fit_inline_size(available_inline_size -
(margin_start + margin_end));
let inline_size = block.get_shrink_to_fit_inline_size(
available_inline_size - (margin_start + margin_end),
);
(Au(0), inline_size, margin_start, margin_end)
}
};

View File

@ -17,21 +17,25 @@ mod M {
struct D {}
enum A<T>
where T: Copy
where
T: Copy,
{
A,
}
struct B<T>
where T: Copy
where
T: Copy,
{
b: i32,
}
// For empty enums and structs, the brace remains on the same line.
enum C<T>
where T: Copy {}
where
T: Copy, {}
struct D<T>
where T: Copy {}
where
T: Copy, {}
}

View File

@ -14,18 +14,22 @@ mod M {
struct D {}
enum A<T>
where T: Copy {
where
T: Copy, {
A,
}
struct B<T>
where T: Copy {
where
T: Copy, {
b: i32,
}
enum C<T>
where T: Copy {}
where
T: Copy, {}
struct D<T>
where T: Copy {}
where
T: Copy, {}
}

View File

@ -15,21 +15,25 @@ mod M {
struct D {}
enum A<T>
where T: Copy
where
T: Copy,
{
A,
}
struct B<T>
where T: Copy
where
T: Copy,
{
b: i32,
}
// For empty enums and structs, the brace remains on the same line.
enum C<T>
where T: Copy {}
where
T: Copy, {}
struct D<T>
where T: Copy {}
where
T: Copy, {}
}

View File

@ -3,27 +3,40 @@
impl Environment {
pub fn new_root() -> Rc<RefCell<Environment>> {
let mut env = Environment::new();
let builtin_functions =
&[("println",
Function::NativeVoid(CallSign {
num_params: 0,
variadic: true,
param_types: vec![],
},
native_println)),
("run_http_server",
Function::NativeVoid(CallSign {
num_params: 1,
variadic: false,
param_types: vec![Some(ConstraintType::Function)],
},
native_run_http_server)),
("len",
Function::NativeReturning(CallSign {
num_params: 1,
variadic: false,
param_types: vec![None],
},
native_len))];
let builtin_functions = &[
(
"println",
Function::NativeVoid(
CallSign {
num_params: 0,
variadic: true,
param_types: vec![],
},
native_println,
),
),
(
"run_http_server",
Function::NativeVoid(
CallSign {
num_params: 1,
variadic: false,
param_types: vec![Some(ConstraintType::Function)],
},
native_run_http_server,
),
),
(
"len",
Function::NativeReturning(
CallSign {
num_params: 1,
variadic: false,
param_types: vec![None],
},
native_len,
),
),
];
}
}

View File

@ -2,10 +2,11 @@
// formatted correctly.
impl Foo {
fn some_input(&mut self,
input: Input,
input_path: Option<PathBuf>)
-> (Input, Option<PathBuf>) {
fn some_input(
&mut self,
input: Input,
input_path: Option<PathBuf>,
) -> (Input, Option<PathBuf>) {
}
fn some_inpu(&mut self, input: Input, input_path: Option<PathBuf>) -> (Input, Option<PathBuf>) {

View File

@ -6,8 +6,8 @@ fn main() {
match x
{
aaaaaaaa::Bbbbb::Ccccccccccccc(_, Some(ref x)) if x ==
"aaaaaaaaaaa \
aaaaaaa aaaaaa" =>
"aaaaaaaaaaa \
aaaaaaa aaaaaa" =>
{
Ok(())
}

View File

@ -13,7 +13,8 @@ fn main() {
}
'a: while loooooooooooooooooooooooooooooooooong_variable_name + another_value >
some_other_value {}
some_other_value
{}
while aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb {
}
@ -22,7 +23,8 @@ fn main() {
}
'b: for xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx in
some_iter(arg1, arg2) {
some_iter(arg1, arg2)
{
// do smth
}

View File

@ -1,10 +1,12 @@
// rustfmt-normalize_comments: true
itemmacro!(this, is.now().formatted(yay));
itemmacro!(really,
long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb()
.is
.formatted());
itemmacro!(
really,
long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb()
.is
.formatted()
);
itemmacro!{this, is.bracket().formatted()}
@ -17,12 +19,16 @@ fn main() {
baz!(1 + 2 + 3, quux.kaas());
quux!(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB);
quux!(
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
);
kaas!(// comments
a, // post macro
b /* another */);
kaas!(
// comments
a, // post macro
b /* another */
);
trailingcomma!( a , b , c , );
@ -30,8 +36,24 @@ fn main() {
vec![a, b, c];
vec![AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, BBBBB, 5,
100 - 30, 1.33, b, b, b];
vec![
AAAAAA,
AAAAAA,
AAAAAA,
AAAAAA,
AAAAAA,
AAAAAA,
AAAAAA,
AAAAAA,
AAAAAA,
BBBBB,
5,
100 - 30,
1.33,
b,
b,
b,
];
vec![a /* comment */];
@ -46,13 +68,12 @@ fn main() {
vec![a; b, c];
vec![a;
(|x| {
let y = x + 1;
let z = y + 1;
z
})(2)];
vec![a;
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx];
(|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![

View File

@ -8,9 +8,9 @@ fn foo() {
"line1";
"line2"
},
b => {
(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb)
},
b => (
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
),
}
}

View File

@ -9,7 +9,9 @@ fn foo() {
"line1";
"line2"
},
b => (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb),
b => (
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
),
}
}

View File

@ -7,7 +7,9 @@ fn foo() {
a => {
foo()
}
b => (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb),
b => (
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
),
}
}

View File

@ -37,9 +37,10 @@ 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 {
@ -66,15 +67,31 @@ fn main() {
// Test that one-line bodies align.
fn main() {
match r {
Variableeeeeeeeeeeeeeeeee => {
("variable", vec!["id", "name", "qualname", "value", "type", "scopeid"], true, true)
}
Enummmmmmmmmmmmmmmmmmmmm => {
("enum", vec!["id", "qualname", "scopeid", "value"], true, true)
}
Variantttttttttttttttttttttttt => {
("variant", vec!["id", "name", "qualname", "type", "value", "scopeid"], true, true)
}
Variableeeeeeeeeeeeeeeeee => (
"variable",
vec!["id", "name", "qualname", "value", "type", "scopeid"],
true,
true,
),
Enummmmmmmmmmmmmmmmmmmmm => (
"enum",
vec!["id", "qualname", "scopeid", "value"],
true,
true,
),
Variantttttttttttttttttttttttt => (
"variant",
vec![
"id",
"name",
"qualname",
"type",
"value",
"scopeid",
],
true,
true,
),
};
match x {
@ -209,10 +226,12 @@ fn issue355() {
xc => vec![1, 2], // comment
yc => vec![3; 4], // comment
yd => {
looooooooooooooooooooooooooooooooooooooooooooooooooooooooong_func(aaaaaaaaaa,
bbbbbbbbbb,
cccccccccc,
dddddddddd)
looooooooooooooooooooooooooooooooooooooooooooooooooooooooong_func(
aaaaaaaaaa,
bbbbbbbbbb,
cccccccccc,
dddddddddd,
)
}
}
}
@ -276,14 +295,12 @@ fn issue494() {
hir::StmtExpr(ref expr, id) |
hir::StmtSemi(ref expr, id) => {
result.push(StmtRef::Mirror(Box::new(Stmt {
span: stmt.span,
kind: StmtKind::Expr {
scope: cx.tcx
.region_maps
.node_extent(id),
expr: expr.to_ref(),
},
})))
span: stmt.span,
kind: StmtKind::Expr {
scope: cx.tcx.region_maps.node_extent(id),
expr: expr.to_ref(),
},
})))
}
}
}
@ -300,10 +317,10 @@ fn issue386() {
fn guards() {
match foo {
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa if foooooooooooooo &&
barrrrrrrrrrrr => {}
barrrrrrrrrrrr => {}
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa if foooooooooooooo &&
barrrrrrrrrrrr => {}
barrrrrrrrrrrr => {}
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
if fooooooooooooooooooooo &&
(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb || cccccccccccccccccccccccccccccccccccccccc) => {
@ -313,48 +330,48 @@ fn guards() {
fn issue1371() {
Some(match type_ {
sfEvtClosed => Closed,
sfEvtResized => {
let e = unsafe { *event.size.as_ref() };
sfEvtClosed => Closed,
sfEvtResized => {
let e = unsafe { *event.size.as_ref() };
Resized {
width: e.width,
height: e.height,
}
}
sfEvtLostFocus => LostFocus,
sfEvtGainedFocus => GainedFocus,
sfEvtTextEntered => {
TextEntered {
unicode: unsafe {
::std::char::from_u32((*event.text.as_ref()).unicode)
.expect("Invalid unicode encountered on TextEntered event")
},
}
}
sfEvtKeyPressed => {
let e = unsafe { event.key.as_ref() };
Resized {
width: e.width,
height: e.height,
}
}
sfEvtLostFocus => LostFocus,
sfEvtGainedFocus => GainedFocus,
sfEvtTextEntered => {
TextEntered {
unicode: unsafe {
::std::char::from_u32((*event.text.as_ref()).unicode)
.expect("Invalid unicode encountered on TextEntered event")
},
}
}
sfEvtKeyPressed => {
let e = unsafe { event.key.as_ref() };
KeyPressed {
code: unsafe { ::std::mem::transmute(e.code) },
alt: e.alt.to_bool(),
ctrl: e.control.to_bool(),
shift: e.shift.to_bool(),
system: e.system.to_bool(),
}
}
sfEvtKeyReleased => {
let e = unsafe { event.key.as_ref() };
KeyPressed {
code: unsafe { ::std::mem::transmute(e.code) },
alt: e.alt.to_bool(),
ctrl: e.control.to_bool(),
shift: e.shift.to_bool(),
system: e.system.to_bool(),
}
}
sfEvtKeyReleased => {
let e = unsafe { event.key.as_ref() };
KeyReleased {
code: unsafe { ::std::mem::transmute(e.code) },
alt: e.alt.to_bool(),
ctrl: e.control.to_bool(),
shift: e.shift.to_bool(),
system: e.system.to_bool(),
}
}
})
KeyReleased {
code: unsafe { ::std::mem::transmute(e.code) },
alt: e.alt.to_bool(),
ctrl: e.control.to_bool(),
shift: e.shift.to_bool(),
system: e.system.to_bool(),
}
}
})
}
fn issue1395() {
@ -362,31 +379,31 @@ fn issue1395() {
let foo = Some(true);
let mut x = false;
bar.and_then(|_| match foo {
None => None,
Some(b) => {
x = true;
Some(b)
}
});
None => None,
Some(b) => {
x = true;
Some(b)
}
});
}
fn issue1456() {
Ok(Recording {
artists: match reader
.evaluate(".//mb:recording/mb:artist-credit/mb:name-credit")? {
Nodeset(nodeset) => {
let res: Result<Vec<ArtistRef>, ReadError> = nodeset
.iter()
.map(|node| {
XPathNodeReader::new(node, &context)
.and_then(|r| ArtistRef::from_xml(&r))
})
.collect();
res?
}
_ => Vec::new(),
},
})
artists: match reader.evaluate(
".//mb:recording/mb:artist-credit/mb:name-credit",
)? {
Nodeset(nodeset) => {
let res: Result<Vec<ArtistRef>, ReadError> = nodeset
.iter()
.map(|node| {
XPathNodeReader::new(node, &context).and_then(|r| ArtistRef::from_xml(&r))
})
.collect();
res?
}
_ => Vec::new(),
},
})
}
fn issue1460() {
@ -399,9 +416,13 @@ fn issue1460() {
}
fn issue525() {
foobar(f, "{}", match *self {
TaskState::Started => "started",
TaskState::Success => "success",
TaskState::Failed => "failed",
});
foobar(
f,
"{}",
match *self {
TaskState::Started => "started",
TaskState::Success => "success",
TaskState::Failed => "failed",
},
);
}

View File

@ -23,12 +23,13 @@ mod boxed {
}
pub mod x {
pub fn freopen(filename: *const c_char,
mode: *const c_char,
mode2: *const c_char,
mode3: *const c_char,
file: *mut FILE)
-> *mut FILE {
pub fn freopen(
filename: *const c_char,
mode: *const c_char,
mode2: *const c_char,
mode3: *const c_char,
file: *mut FILE,
) -> *mut FILE {
}
}

View File

@ -31,18 +31,21 @@ mod other;
fn foo(a: isize, b: u32 /* blah blah */, c: f64) {}
fn foo() -> Box<Write + 'static>
where 'a: 'b,
for<'a> D<'b>: 'a
where
'a: 'b,
for<'a> D<'b>: 'a,
{
hello!()
}
fn baz<'a: 'b, // comment on 'a
T: SomsssssssssssssssssssssssssssssssssssssssssssssssssssssseType /* comment on T */>
(a: A,
b: B, // comment on b
c: C)
-> Bob {
fn baz<
'a: 'b, // comment on 'a
T: SomsssssssssssssssssssssssssssssssssssssssssssssssssssssseType /* comment on T */
>(
a: A,
b: B, // comment on b
c: C,
) -> Bob {
#[attr1]
extern crate foo;
#[attr2]
@ -65,10 +68,11 @@ fn qux(a: dadsfa, // Comment 1
/// Blah blah blah.
impl Bar {
fn foo(&mut self,
a: sdfsdfcccccccccccccccccccccccccccccccccccccccccccccccccc, // comment on a
b: sdfasdfsdfasfs /* closing comment */)
-> isize {
fn foo(
&mut self,
a: sdfsdfcccccccccccccccccccccccccccccccccccccccccccccccccc, // comment on a
b: sdfasdfsdfasfs, // closing comment
) -> isize {
}
/// Blah blah blah.
@ -112,7 +116,8 @@ struct Bar;
// With a where clause and generics.
pub struct Foo<'a, Y: Baz>
where X: Whatever
where
X: Whatever,
{
f: SomeType, // Comment beside a field
}
@ -129,11 +134,15 @@ fn main() {
hello();
}
let rc = Cell::new(42usize,
42usize,
Cell::new(42usize,
remaining_widthremaining_widthremaining_widthremaining_width),
42usize);
let rc = Cell::new(
42usize,
42usize,
Cell::new(
42usize,
remaining_widthremaining_widthremaining_widthremaining_width,
),
42usize,
);
let rc = RefCell::new(42usize, remaining_width, remaining_width); // a comment
let x = "Hello!!!!!!!!! abcd abcd abcd abcd abcd abcd\n abcd abcd abcd abcd abcd abcd abcd \
abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd \
@ -152,13 +161,14 @@ fn deconstruct()
{
}
fn deconstruct(foo: Bar)
-> (SocketAddr,
Method,
Headers,
RequestUri,
HttpVersion,
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) {
fn deconstruct(
foo: Bar,
) -> (SocketAddr,
Method,
Headers,
RequestUri,
HttpVersion,
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) {
}
#[rustfmt_skip]

View File

@ -1,11 +1,11 @@
fn issue1518() {
Some(Object {
field: if a {
a_thing
} else if b {
b_thing
} else {
c_thing
},
})
field: if a {
a_thing
} else if b {
b_thing
} else {
c_thing
},
})
}

View File

@ -20,15 +20,18 @@ fn main() {
|item| {
match *item {
StructLitField::Regular(ref field) => {
rewrite_field(inner_context,
&field,
&Constraints::new(v_budget.checked_sub(1).unwrap_or(0), indent))
rewrite_field(
inner_context,
&field,
&Constraints::new(v_budget.checked_sub(1).unwrap_or(0), indent),
)
}
StructLitField::Base(ref expr) => {
// 2 = ..
expr.rewrite(inner_context,
&Constraints::new(try_opt!(v_budget.checked_sub(2)), indent + 2))
.map(|s| format!("..{}", s))
expr.rewrite(
inner_context,
&Constraints::new(try_opt!(v_budget.checked_sub(2)), indent + 2),
).map(|s| format!("..{}", s))
}
}
},
@ -45,16 +48,14 @@ fn main() {
});
// #1581
bootstrap
.checks
.register("PERSISTED_LOCATIONS", move || if locations2
.0
.inner_mut
.lock()
.poisoned {
Check::new(State::Error,
"Persisted location storage is poisoned due to a write failure")
bootstrap.checks.register("PERSISTED_LOCATIONS", move || {
if locations2.0.inner_mut.lock().poisoned {
Check::new(
State::Error,
"Persisted location storage is poisoned due to a write failure",
)
} else {
Check::new(State::Healthy, "Persisted location storage is healthy")
});
}
});
}

View File

@ -1,3 +1,3 @@
fn ugly() {
92;
92;
}

View File

@ -1,17 +1,18 @@
// rustfmt-normalize_comments: true
fn main() {
let constellation_chan =
Constellation::<layout::layout_task::LayoutTask,
script::script_task::ScriptTask>::start(compositor_proxy,
resource_task,
image_cache_task,
font_cache_task,
time_profiler_chan,
mem_profiler_chan,
devtools_chan,
storage_task,
supports_clipboard);
let constellation_chan = Constellation::<layout::layout_task::LayoutTask,
script::script_task::ScriptTask>::start(
compositor_proxy,
resource_task,
image_cache_task,
font_cache_task,
time_profiler_chan,
mem_profiler_chan,
devtools_chan,
storage_task,
supports_clipboard,
);
Quux::<ParamOne /* Comment 1 */, ParamTwo /* Comment 2 */>::some_func();

View File

@ -2,10 +2,21 @@
trait Trait {}
trait Trait2 {}
fn f<'a, 'b : 'a, T : Trait, U>() where U : Trait2 {}
fn f<'a, 'b : 'a, T : Trait, U>()
where
U : Trait2,
{
}
// should fit on the line
fn f2<'a, 'b : 'a, Ttttttttttttttttttttttttttttttttttttttttttttttt : Trait, U>() where U : Trait2 {}
// should be wrapped
fn f2<'a, 'b : 'a, Tttttttttttttttttttttttttttttttttttttttttttttttt : Trait, U>() where U : Trait2 {
fn f2<'a, 'b : 'a, Ttttttttttttttttttttttttttttttttttttttttttttttt : Trait, U>()
where
U : Trait2,
{
}
// should be wrapped
fn f2<'a, 'b : 'a, Tttttttttttttttttttttttttttttttttttttttttttttttt : Trait, U>()
where
U : Trait2,
{
}

View File

@ -55,4 +55,8 @@ impl Foo {
trait MyTrait< A, D > {}
impl< A: Send, D: Send > MyTrait< A, D > for Foo {}
fn foo() where for< 'a > u32: 'a {}
fn foo()
where
for< 'a > u32: 'a,
{
}

View File

@ -13,22 +13,22 @@ fn main() {
let slice = &arr[ 1..2 ];
let line100_________________________________________________________________________ = [ 1, 2 ];
let line101__________________________________________________________________________ = [ 1,
2 ];
let line102___________________________________________________________________________ = [ 1,
2 ];
let line103____________________________________________________________________________ = [ 1,
2 ];
let line101__________________________________________________________________________ =
[ 1, 2 ];
let line102___________________________________________________________________________ =
[ 1, 2 ];
let line103____________________________________________________________________________ =
[ 1, 2 ];
let line104_____________________________________________________________________________ =
[ 1, 2 ];
let line100_____________________________________________________________________ = vec![ 1, 2 ];
let line101______________________________________________________________________ = vec![ 1,
2 ];
let line102_______________________________________________________________________ = vec![ 1,
2 ];
let line103________________________________________________________________________ = vec![ 1,
2 ];
let line101______________________________________________________________________ =
vec![ 1, 2 ];
let line102_______________________________________________________________________ =
vec![ 1, 2 ];
let line103________________________________________________________________________ =
vec![ 1, 2 ];
let line104_________________________________________________________________________ =
vec![ 1, 2 ];
}

View File

@ -1,11 +1,52 @@
const FILE_GENERIC_READ: DWORD = STANDARD_RIGHTS_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES |
FILE_READ_EA | SYNCHRONIZE;
FILE_READ_EA | SYNCHRONIZE;
static boolnames: &'static [&'static str] =
&["bw", "am", "xsb", "xhp", "xenl", "eo", "gn", "hc", "km", "hs", "in", "db", "da", "mir",
"msgr", "os", "eslok", "xt", "hz", "ul", "xon", "nxon", "mc5i", "chts", "nrrmc", "npc",
"ndscr", "ccc", "bce", "hls", "xhpa", "crxm", "daisy", "xvpa", "sam", "cpix", "lpix",
"OTbs", "OTns", "OTnc", "OTMT", "OTNL", "OTpt", "OTxr"];
static boolnames: &'static [&'static str] = &[
"bw",
"am",
"xsb",
"xhp",
"xenl",
"eo",
"gn",
"hc",
"km",
"hs",
"in",
"db",
"da",
"mir",
"msgr",
"os",
"eslok",
"xt",
"hz",
"ul",
"xon",
"nxon",
"mc5i",
"chts",
"nrrmc",
"npc",
"ndscr",
"ccc",
"bce",
"hls",
"xhpa",
"crxm",
"daisy",
"xvpa",
"sam",
"cpix",
"lpix",
"OTbs",
"OTns",
"OTnc",
"OTMT",
"OTNL",
"OTpt",
"OTxr",
];
static mut name: SomeType =
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;

View File

@ -26,7 +26,9 @@ formatting"#;
filename.replace(" ", "\\");
let xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx =
funktion("yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy");
funktion(
"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
);
let unicode = "a̐éö̲\r\n";
let unicode2 = "Löwe 老虎 Léopard";
@ -42,8 +44,10 @@ fn issue682() {
}
fn issue716() {
println!("forall x. mult(e(), x) = x /\\
forall x. mult(x, x) = e()");
println!(
"forall x. mult(e(), x) = x /\\
forall x. mult(x, x) = e()"
);
}
fn issue_1282() {

View File

@ -2,10 +2,14 @@
// rustfmt-error_on_line_overflow: false
fn main() {
println!("ThisIsAReallyLongStringWithNoSpaces.It_should_prefer_to_break_onpunctuation:\
Likethisssssssssssss");
println!(
"ThisIsAReallyLongStringWithNoSpaces.It_should_prefer_to_break_onpunctuation:\
Likethisssssssssssss"
);
format!("{}__{}__{}ItShouldOnlyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyNoticeSemicolonsPeriodsColonsAndCommasAndResortToMid-CharBreaksAfterPunctuation{}{}",x,y,z,a,b);
println!("aaaaaaaaaaaaaaaaaaaaaaaaaaaaalhijalfhiigjapdighjapdigjapdighdapighapdighpaidhg;\
adopgihadoguaadbadgad,qeoihapethae8t0aet8haetadbjtaeg;\
ooeouthaoeutgadlgajduabgoiuadogabudogubaodugbadgadgadga;adoughaoeugbaouea");
println!(
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaalhijalfhiigjapdighjapdigjapdighdapighapdighpaidhg;\
adopgihadoguaadbadgad,qeoihapethae8t0aet8haetadbjtaeg;\
ooeouthaoeutgadlgajduabgoiuadogabudogubaodugbadgadgadga;adoughaoeugbaouea"
);
}

View File

@ -50,11 +50,11 @@ fn main() {
};
Some(Data::MethodCallData(MethodCallData {
span: sub_span.unwrap(),
scope: self.enclosing_scope(id),
ref_id: def_id,
decl_id: Some(decl_id),
}));
span: sub_span.unwrap(),
scope: self.enclosing_scope(id),
ref_id: def_id,
decl_id: Some(decl_id),
}));
Diagram {
// o This graph demonstrates how

View File

@ -59,11 +59,11 @@ fn main() {
};
Some(Data::MethodCallData(MethodCallData {
span: sub_span.unwrap(),
scope: self.enclosing_scope(id),
ref_id: def_id,
decl_id: Some(decl_id),
}));
span: sub_span.unwrap(),
scope: self.enclosing_scope(id),
ref_id: def_id,
decl_id: Some(decl_id),
}));
Diagram {
// o This graph demonstrates how

View File

@ -6,34 +6,44 @@ fn foo() {
Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(f(), b());
Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(// Comment
foo(), /* Comment */
// Comment
bar() /* Comment */);
Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(
// Comment
foo(), // Comment
// Comment
bar(), /* Comment */
);
Foo(Bar, f());
Quux(if cond {
bar();
},
baz());
Quux(
if cond {
bar();
},
baz(),
);
Baz(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
zzzzz /* test */);
Baz(
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
zzzzz, /* test */
);
A(// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit
// amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante
// hendrerit. Donec et mollis dolor.
item(),
// Praesent et diam eget libero egestas mattis sit amet vitae augue.
// Nam tincidunt congue enim, ut porta lorem lacinia consectetur.
Item);
A(
// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit
// amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante
// hendrerit. Donec et mollis dolor.
item(),
// Praesent et diam eget libero egestas mattis sit amet vitae augue.
// Nam tincidunt congue enim, ut porta lorem lacinia consectetur.
Item,
);
Diagram(// o This graph demonstrates how
// / \ significant whitespace is
// o o preserved.
// /|\ \
// o o o o
G)
Diagram(
// o This graph demonstrates how
// / \ significant whitespace is
// o o preserved.
// /|\ \
// o o o o
G,
)
}

View File

@ -59,14 +59,17 @@ struct Qux<'a,
pub W,
);
struct Tuple(// Comment 1
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
// Comment 2
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB);
struct Tuple(
// Comment 1
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
// Comment 2
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
);
// With a where clause and generics.
pub struct Foo<'a, Y: Baz>
where X: Whatever
where
X: Whatever,
{
f: SomeType, // Comment beside a field
}
@ -145,38 +148,52 @@ struct Deep {
struct Foo<T>(T);
struct Foo<T>(T)
where T: Copy,
T: Eq;
struct Foo<T>(TTTTTTTTTTTTTTTTT,
UUUUUUUUUUUUUUUUUUUUUUUU,
TTTTTTTTTTTTTTTTTTT,
UUUUUUUUUUUUUUUUUUU);
struct Foo<T>(TTTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTT) where T: PartialEq;
where
T: Copy,
T: Eq;
struct Foo<T>(
TTTTTTTTTTTTTTTTT,
UUUUUUUUUUUUUUUUUUUUUUUU,
TTTTTTTTTTTTTTTTTTT,
UUUUUUUUUUUUUUUUUUU
);
struct Foo<T>(TTTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTT)
where
T: PartialEq;
struct Foo<T>(TTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTTTT)
where T: PartialEq;
struct Foo<T>(TTTTTTTTTTTTTTTTT,
UUUUUUUUUUUUUUUUUUUUUUUU,
TTTTTTTTTTTTTTTTTTT,
UUUUUUUUUUUUUUUUUUU)
where T: PartialEq;
struct Foo<T>(TTTTTTTTTTTTTTTTT, // Foo
UUUUUUUUUUUUUUUUUUUUUUUU, // Bar
// Baz
TTTTTTTTTTTTTTTTTTT,
// Qux (FIXME #572 - doc comment)
UUUUUUUUUUUUUUUUUUU);
where
T: PartialEq;
struct Foo<T>(
TTTTTTTTTTTTTTTTT,
UUUUUUUUUUUUUUUUUUUUUUUU,
TTTTTTTTTTTTTTTTTTT,
UUUUUUUUUUUUUUUUUUU
)
where
T: PartialEq;
struct Foo<T>(
TTTTTTTTTTTTTTTTT, // Foo
UUUUUUUUUUUUUUUUUUUUUUUU, // Bar
// Baz
TTTTTTTTTTTTTTTTTTT,
// Qux (FIXME #572 - doc comment)
UUUUUUUUUUUUUUUUUUU
);
mod m {
struct X<T>
where T: Sized
where
T: Sized,
{
a: T,
}
}
struct Foo<T>(TTTTTTTTTTTTTTTTTTT,
/// Qux
UUUUUUUUUUUUUUUUUUU);
struct Foo<T>(
TTTTTTTTTTTTTTTTTTT,
/// Qux
UUUUUUUUUUUUUUUUUUU
);
struct Issue677 {
pub ptr: *const libc::c_void,

View File

@ -12,56 +12,65 @@ fn main() {
}
fn f<S, T>(x: T, y: S) -> T
where T: P,
S: Q,
where
T: P,
S: Q,
{
x
}
impl Trait for T
where T: P,
where
T: P,
{
fn f(x: T) -> T
where T: Q + R,
where
T: Q + R,
{
x
}
}
struct Pair<S, T>
where T: P,
S: P + Q,
where
T: P,
S: P + Q,
{
a: T,
b: S,
}
struct TupPair<S, T>(S, T)
where T: P,
S: P + Q;
where
T: P,
S: P + Q;
enum E<S, T>
where S: P,
T: P,
where
S: P,
T: P,
{
A { a: T, },
}
type Double<T>
where T: P,
T: Q = Pair<T, T>;
type Double<T> where
T: P,
T: Q = Pair<T, T>;
extern "C" {
fn f<S, T>(x: T, y: S) -> T
where T: P,
S: Q;
where
T: P,
S: Q;
}
trait Q<S, T>
where T: P,
S: R,
where
T: P,
S: R,
{
fn f<U, V>(self, x: T, y: S, z: U) -> Self
where U: P,
V: P;
where
U: P,
V: P;
}

View File

@ -7,15 +7,18 @@ trait Foo {
fn baz(a: AAAAAAAAAAAAAAAAAAAAAA, b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB) -> RetType;
fn foo(a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, // Another comment
b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB)
-> RetType; // Some comment
fn foo(
a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, // Another comment
b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
) -> RetType; // Some comment
fn baz(&mut self) -> i32;
fn increment(&mut self, x: i32);
fn read(&mut self, x: BufReader<R> /* Used to be MemReader */) where R: Read;
fn read(&mut self, x: BufReader<R> /* Used to be MemReader */)
where
R: Read;
}
pub trait WriteMessage {
@ -32,7 +35,8 @@ trait TraitWithExpr {
trait Test {
fn read_struct<T, F>(&mut self, s_name: &str, len: usize, f: F) -> Result<T, Self::Error>
where F: FnOnce(&mut Self) -> Result<T, Self::Error>;
where
F: FnOnce(&mut Self) -> Result<T, Self::Error>;
}
trait T {}
@ -42,27 +46,35 @@ trait Foo {
}
trait ConstCheck<T>: Foo
where T: Baz
where
T: Baz,
{
const J: i32;
}
trait Tttttttttttttttttttttttttttttttttttttttttttttttttttttttttt<T> where T: Foo {}
trait Tttttttttttttttttttttttttttttttttttttttttttttttttttttttttt<T>
where
T: Foo
{
}
trait Ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt<T>
where T: Foo
where
T: Foo
{
}
trait FooBar<T>
: Tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
where J: Bar
where
J: Bar,
{
fn test();
}
trait WhereList<T, J>
where T: Foo,
J: Bar
where
T: Foo,
J: Bar
{
}

View File

@ -18,9 +18,10 @@ fn test() {
}
fn issue1291() {
fs::create_dir_all(&gitfiledir)
.chain_err(|| {
format!("failed to create the {} submodule directory for the workarea",
name)
})?;
fs::create_dir_all(&gitfiledir).chain_err(|| {
format!(
"failed to create the {} submodule directory for the workarea",
name
)
})?;
}

View File

@ -2,52 +2,74 @@
fn foo() {
let a = (a, a, a, a, a);
let aaaaaaaaaaaaaaaa = (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaa, aaaaaaaaaaaaaa);
let aaaaaaaaaaaaaaaaaaaaaa = (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaa,
aaaa);
let aaaaaaaaaaaaaaaa = (
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaa,
aaaaaaaaaaaaaa,
);
let aaaaaaaaaaaaaaaaaaaaaa = (
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaa,
aaaa,
);
let a = (a,);
let b = (// This is a comment
b, // Comment
b /* Trailing comment */);
let b = (
// This is a comment
b, // Comment
b, /* Trailing comment */
);
// #1063
foo(x.0 .0);
}
fn a() {
((aaaaaaaa,
aaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaa),)
((
aaaaaaaa,
aaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaa,
),)
}
fn b() {
((bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb),
bbbbbbbbbbbbbbbbbb)
(
(
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
),
bbbbbbbbbbbbbbbbbb,
)
}
fn issue550() {
self.visitor.visit_volume(self.level.sector_id(sector),
(floor_y,
if is_sky_flat(ceil_tex) {
from_wad_height(self.height_range.1)
} else {
ceil_y
}));
self.visitor.visit_volume(self.level.sector_id(sector), (
floor_y,
if is_sky_flat(ceil_tex) {
from_wad_height(self.height_range.1)
} else {
ceil_y
},
));
}
fn issue775() {
if indent {
let a = mk_object(&[("a".to_string(), Boolean(true)),
("b".to_string(),
Array(vec![mk_object(&[("c".to_string(),
String("\x0c\r".to_string()))]),
mk_object(&[("d".to_string(),
String("".to_string()))])]))]);
let a = mk_object(
&[
("a".to_string(), Boolean(true)),
(
"b".to_string(),
Array(vec![
mk_object(&[("c".to_string(), String("\x0c\r".to_string()))]),
mk_object(&[("d".to_string(), String("".to_string()))]),
]),
),
],
);
}
}

Some files were not shown because too many files have changed in this diff Show More