]> git.lizzy.rs Git - rust.git/blob - tests/source/file-lines-3.rs
Merge pull request #1162 from sinkuu/fix1040
[rust.git] / tests / source / 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().method_call();
9
10     let y = if cond {
11                 val1
12             } else {
13                 val2
14             }
15                 .method_call();
16
17     {
18         match x {
19             PushParam => {
20                 stack.push(mparams[match cur.to_digit(10) {
21                                             Some(d) => d as usize - 1,
22                                             None => return Err("bad param number".to_owned()),
23                                         }]
24                                .clone());
25             }
26         }
27     }
28 }