-
Notifications
You must be signed in to change notification settings - Fork 925
Spooky action-at-a-distance causing missed linewraps #3654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Possibly related to #3638 |
note when reproducing: you'll have to remove the comments |
version without comments: fn get_in_params() {
m.in_params
.iter()
.map(|| {
let direction = arg_types.get_arg(name);
match ty {
Some(_) => {
if some_bool {
}
match size {
_ => {
if some_bool {
} else {
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()
} |
reformatted after removing the fn get_in_params() {
m.in_params
.iter()
.map(|| match ty {
Some(_) => {
if some_bool {}
match size {
_ => {
if some_bool {
} else {
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()
} |
I think snippet at #3654 (comment) can be reformatted because the match is not wrapped in a block and therefore it is not indented. |
Maybe the match rewrite could allow for some branch to be unformatted, this would allow the |
I believe this is a duplicate of #3863 |
rustfmt output:
Removing or significantly editing basically any line causes the
let resolved_type = ...
line (which is too long and should be wrapped) to be reformatted.The text was updated successfully, but these errors were encountered: