Skip to content

Spooky action-at-a-distance causing missed linewraps #3654

Closed as not planned
Closed as not planned
@cramertj

Description

@cramertj

rustfmt output:

fn get_in_params() {
    m.in_params
        .iter()
        .map(|| {
            let direction = arg_types.get_arg(name); // removing this line causes formatting ?!?!?!
            match ty {
                Some(_) => {
                    if some_bool {
                    }
                    match size {
                        _ => {
                            if some_bool { // removing any of these lines causes formatting
                            } else { // the following line must be long or else formatting will happen
                                panic!("missing 'arg_type' attribute: string direction must be specified")
                            }
                        }
                    }
                }
                None => {
                    if some_bool {
                        let resolved_type = format!("ptr[{}, array[{}]]", to_c_name(&direction), ty_to_syzkaller_str(ast, ty).unwrap());
                    }
                }
            }
        })
        .collect() // removing this line causes formatting ?!?!?!
}

Removing or significantly editing basically any line causes the let resolved_type = ... line (which is too long and should be wrapped) to be reformatted.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions