mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Fix a bug with overlong function calls
This commit is contained in:
parent
a7183766b9
commit
ee9daade35
13
src/expr.rs
13
src/expr.rs
@ -1715,10 +1715,19 @@ fn rewrite_call_inner<R>(context: &RewriteContext,
|
||||
}
|
||||
}
|
||||
|
||||
let one_line_width = shape.width.checked_sub(used_width + 2);
|
||||
let one_line_width = match one_line_width {
|
||||
Some(olw) => olw,
|
||||
None => return Err(Ordering::Greater),
|
||||
};
|
||||
let one_line_shape = Shape {
|
||||
width: one_line_width,
|
||||
..nested_shape
|
||||
};
|
||||
let tactic =
|
||||
definitive_tactic(&item_vec,
|
||||
ListTactic::LimitedHorizontalVertical(context.config.fn_call_width),
|
||||
nested_shape.width);
|
||||
one_line_width);
|
||||
|
||||
// Replace the stub with the full overflowing last argument if the rewrite
|
||||
// succeeded and its first line fits with the other arguments.
|
||||
@ -1741,7 +1750,7 @@ fn rewrite_call_inner<R>(context: &RewriteContext,
|
||||
} else {
|
||||
context.config.trailing_comma
|
||||
},
|
||||
shape: nested_shape,
|
||||
shape: one_line_shape,
|
||||
ends_with_newline: false,
|
||||
config: context.config,
|
||||
};
|
||||
|
@ -44,3 +44,12 @@ unsafe fn generic_call(cx: *mut JSContext, argc: libc::c_uint, vp: *mut JSVal,
|
||||
}
|
||||
|
||||
pub fn start_export_thread<C: CryptoSchemee + 'static>(database: &Database, crypto_scheme: &C, block_size: usize, source_path: &Path) -> BonzoResult<mpsc::Consumer<'static, FileInstruction>> {}
|
||||
|
||||
pub fn waltz(cwd: &Path) -> CliAssert {
|
||||
{
|
||||
{
|
||||
formatted_comment = rewrite_comment(comment, block_style, width, offset, formatting_fig);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -73,3 +73,13 @@ pub fn start_export_thread<C: CryptoSchemee + 'static>
|
||||
source_path: &Path)
|
||||
-> BonzoResult<mpsc::Consumer<'static, FileInstruction>> {
|
||||
}
|
||||
|
||||
pub fn waltz(cwd: &Path) -> CliAssert {
|
||||
{
|
||||
{
|
||||
formatted_comment =
|
||||
rewrite_comment(comment, block_style, width, offset, formatting_fig);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user