]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/file-lines-4.rs
Auto merge of #95315 - compiler-errors:pointee-fix, r=pnkfelix
[rust.git] / src / tools / rustfmt / tests / target / file-lines-4.rs
1 // rustfmt-file_lines: []
2 // (Test that nothing is formatted if an empty array is specified.)
3
4 fn floaters() {
5     let x = Foo {
6                 field1: val1,
7                 field2: val2,
8             }
9             .method_call().method_call();
10
11     let y = if cond {
12                 val1
13             } else {
14                 val2    
15             }
16                 .method_call();
17                                                                                               // aaaaaaaaaaaaa
18     {
19         match x {
20             PushParam => {
21                 // comment
22                 stack.push(mparams[match cur.to_digit(10) {
23                                             Some(d) => d as usize - 1,
24                                             None => return Err("bad param number".to_owned()),
25                                         }]
26                                .clone());
27             }
28         }    
29     }
30 }