diff options
| author | bors <bors@rust-lang.org> | 2024-04-17 09:08:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-17 09:08:55 +0000 |
| commit | 14701efcaf7db2406e4cbd54b4dcac632f830b87 (patch) | |
| tree | 66ea9a34daadc90de7f2a43fe186f19300365eb0 /src/tools/rustfmt | |
| parent | 8ad72b24f3b7b09cd18ad21c8bf0876f23ec24fb (diff) | |
| parent | 2cb03ef7394bbcbdefea6dfb13a4d7c0458992fe (diff) | |
| download | rust-14701efcaf7db2406e4cbd54b4dcac632f830b87.tar.gz rust-14701efcaf7db2406e4cbd54b4dcac632f830b87.zip | |
Auto merge of #3479 - rust-lang:rustup-2024-04-17, r=RalfJung
Automatic Rustup
Diffstat (limited to 'src/tools/rustfmt')
| -rw-r--r-- | src/tools/rustfmt/src/macros.rs | 2 | ||||
| -rw-r--r-- | src/tools/rustfmt/src/types.rs | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/tools/rustfmt/src/macros.rs b/src/tools/rustfmt/src/macros.rs index 8d77d2b3254..6b24b1aec5d 100644 --- a/src/tools/rustfmt/src/macros.rs +++ b/src/tools/rustfmt/src/macros.rs @@ -1091,7 +1091,7 @@ fn next_space(tok: &TokenKind) -> SpaceState { | TokenKind::DotDotEq | TokenKind::Question => SpaceState::Punctuation, - TokenKind::ModSep + TokenKind::PathSep | TokenKind::Pound | TokenKind::Dollar | TokenKind::OpenDelim(_) diff --git a/src/tools/rustfmt/src/types.rs b/src/tools/rustfmt/src/types.rs index 10a87f6e698..fe2d28ae1b9 100644 --- a/src/tools/rustfmt/src/types.rs +++ b/src/tools/rustfmt/src/types.rs @@ -843,7 +843,11 @@ impl Rewrite for ast::Ty { rewrite_macro(mac, None, context, shape, MacroPosition::Expression) } ast::TyKind::ImplicitSelf => Some(String::from("")), - ast::TyKind::ImplTrait(_, ref it) => { + ast::TyKind::ImplTrait(_, ref it, ref captures) => { + // FIXME(precise_capturing): Implement formatting. + if captures.is_some() { + return None; + } // Empty trait is not a parser error. if it.is_empty() { return Some("impl".to_owned()); @@ -1106,7 +1110,8 @@ fn join_bounds_inner( pub(crate) fn opaque_ty(ty: &Option<ptr::P<ast::Ty>>) -> Option<&ast::GenericBounds> { ty.as_ref().and_then(|t| match &t.kind { - ast::TyKind::ImplTrait(_, bounds) => Some(bounds), + // FIXME(precise_capturing): Implement support here + ast::TyKind::ImplTrait(_, bounds, _) => Some(bounds), _ => None, }) } |
