Implement RTN support in rustfmt
This commit is contained in:
parent
51df533d06
commit
88f98c2929
@ -484,7 +484,10 @@ fn rewrite_generic_args(
|
||||
span: Span,
|
||||
) -> Option<String> {
|
||||
match gen_args {
|
||||
ast::GenericArgs::AngleBracketed(ref data) if !data.args.is_empty() => {
|
||||
ast::GenericArgs::AngleBracketed(ref data) => {
|
||||
if data.args.is_empty() {
|
||||
Some("".to_owned())
|
||||
} else {
|
||||
let args = data
|
||||
.args
|
||||
.iter()
|
||||
@ -500,6 +503,7 @@ fn rewrite_generic_args(
|
||||
|
||||
overflow::rewrite_with_angle_brackets(context, "", args.iter(), shape, span)
|
||||
}
|
||||
}
|
||||
ast::GenericArgs::Parenthesized(ref data) => format_function_type(
|
||||
data.inputs.iter().map(|x| &**x),
|
||||
&data.output,
|
||||
@ -508,7 +512,7 @@ fn rewrite_generic_args(
|
||||
context,
|
||||
shape,
|
||||
),
|
||||
_ => Some("".to_owned()),
|
||||
ast::GenericArgs::ParenthesizedElided(..) => Some("(..)".to_owned()),
|
||||
}
|
||||
}
|
||||
|
||||
|
10
tests/target/return-type-notation.rs
Normal file
10
tests/target/return-type-notation.rs
Normal file
@ -0,0 +1,10 @@
|
||||
fn rtn()
|
||||
where
|
||||
T: Trait<method(..): Send + 'static>,
|
||||
T::method(..): Send + 'static,
|
||||
{
|
||||
}
|
||||
|
||||
fn test() {
|
||||
let x: T::method(..);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user