Merge pull request #3470 from topecongiro/issue-3051
Do not add a space after empty impl
This commit is contained in:
commit
f910afde85
10
src/types.rs
10
src/types.rs
@ -667,9 +667,13 @@ fn rewrite(&self, context: &RewriteContext<'_>, shape: Shape) -> Option<String>
|
||||
rewrite_macro(mac, None, context, shape, MacroPosition::Expression)
|
||||
}
|
||||
ast::TyKind::ImplicitSelf => Some(String::from("")),
|
||||
ast::TyKind::ImplTrait(_, ref it) => it
|
||||
.rewrite(context, shape)
|
||||
.map(|it_str| format!("impl {}", it_str)),
|
||||
ast::TyKind::ImplTrait(_, ref it) => {
|
||||
// Empty trait is not a parser error.
|
||||
it.rewrite(context, shape).map(|it_str| {
|
||||
let space = if it_str.is_empty() { "" } else { " " };
|
||||
format!("impl{}{}", space, it_str)
|
||||
})
|
||||
}
|
||||
ast::TyKind::CVarArgs => Some("...".to_owned()),
|
||||
ast::TyKind::Err | ast::TyKind::Typeof(..) => unreachable!(),
|
||||
}
|
||||
|
@ -83,6 +83,10 @@ impl Future<Item = (), Error = SomeError> + 'a,
|
||||
'c {
|
||||
}
|
||||
|
||||
// #3051
|
||||
token![impl];
|
||||
token![ impl ];
|
||||
|
||||
// #3060
|
||||
macro_rules! foo {
|
||||
($foo_api: ty) => {
|
||||
|
@ -82,6 +82,10 @@ impl Future<Item = (), Error = SomeError> + 'a,
|
||||
> + 'a + 'b + 'c {
|
||||
}
|
||||
|
||||
// #3051
|
||||
token![impl];
|
||||
token![impl];
|
||||
|
||||
// #3060
|
||||
macro_rules! foo {
|
||||
($foo_api: ty) => {
|
||||
|
Loading…
Reference in New Issue
Block a user