diff options
| author | Michael Goulet <michael@errs.io> | 2024-06-05 16:18:52 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-06-17 22:35:25 -0400 |
| commit | b1efe1ab5d10c5dc0462445273ca4e42dea3c5e3 (patch) | |
| tree | 88d5d68eaba69cf8e65e87f38b6dcd04bd9c3f46 /compiler/rustc_ast_pretty/src | |
| parent | 68bd001c00e37a6c6854482138d27a76428efdff (diff) | |
| download | rust-b1efe1ab5d10c5dc0462445273ca4e42dea3c5e3.tar.gz rust-b1efe1ab5d10c5dc0462445273ca4e42dea3c5e3.zip | |
Rework precise capturing syntax
Diffstat (limited to 'compiler/rustc_ast_pretty/src')
| -rw-r--r-- | compiler/rustc_ast_pretty/src/pprust/state.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index 4eb2a103fd8..0225c95dca8 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -1187,17 +1187,8 @@ impl<'a> State<'a> { } self.print_type_bounds(bounds); } - ast::TyKind::ImplTrait(_, bounds, precise_capturing_args) => { + ast::TyKind::ImplTrait(_, bounds) => { self.word_nbsp("impl"); - if let Some((precise_capturing_args, ..)) = precise_capturing_args.as_deref() { - self.word("use"); - self.word("<"); - self.commasep(Inconsistent, precise_capturing_args, |s, arg| match arg { - ast::PreciseCapturingArg::Arg(p, _) => s.print_path(p, false, 0), - ast::PreciseCapturingArg::Lifetime(lt) => s.print_lifetime(*lt), - }); - self.word(">") - } self.print_type_bounds(bounds); } ast::TyKind::Array(ty, length) => { @@ -1800,6 +1791,15 @@ impl<'a> State<'a> { self.print_poly_trait_ref(tref); } GenericBound::Outlives(lt) => self.print_lifetime(*lt), + GenericBound::Use(args, _) => { + self.word("use"); + self.word("<"); + self.commasep(Inconsistent, args, |s, arg| match arg { + ast::PreciseCapturingArg::Arg(p, _) => s.print_path(p, false, 0), + ast::PreciseCapturingArg::Lifetime(lt) => s.print_lifetime(*lt), + }); + self.word(">") + } } } } |
