summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/assignment.rs
blob: 1a70d84813d0118593c7ef088b1675eb88ea1655 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Test assignment

fn main() {
    let some_var: Type;

    let mut mutable;

    let variable =
        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA::BBBBBBBBBBBBBBBBBBBBBB::CCCCCCCCCCCCCCCCCCCCCC::EEEEEE;

    variable =
        LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONG;

    let single_line_fit = DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD;

    single_line_fit = 5;
    single_lit_fit >>= 10;

    // #2791
    let x = 2;
}

fn break_meee() {
    {
        (
            block_start,
            block_size,
            margin_block_start,
            margin_block_end,
        ) = match (block_start, block_end, block_size) {
            x => 1,
            _ => 2,
        };
    }
}

// #2018
pub const EXPLAIN_UNSIZED_TUPLE_COERCION: &'static str =
    "Unsized tuple coercion is not stable enough for use and is subject to change";