]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/file-lines-2.rs
Merge commit '39683d8eb7a32a74bea96ecbf1e87675d3338506' into sync_cg_gcc-2022-03-26
[rust.git] / src / tools / rustfmt / tests / target / file-lines-2.rs
1 // rustfmt-file_lines: [{"file":"tests/source/file-lines-2.rs","range":[10,15]}]
2
3 fn floaters() {
4     let x = Foo {
5                 field1: val1,
6                 field2: val2,
7             }
8             .method_call().method_call();
9
10     let y = if cond { val1 } else { val2 }.method_call();
11
12     {
13         match x {
14             PushParam => {
15                 // comment
16                 stack.push(mparams[match cur.to_digit(10) {
17                                             Some(d) => d as usize - 1,
18                                             None => return Err("bad param number".to_owned()),
19                                         }]
20                                .clone());
21             }
22         }
23     }
24 }