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