about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/print/pretty.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-09-09 08:36:50 +0200
committerRalf Jung <post@ralfj.de>2023-09-21 22:20:58 +0200
commitc4ec12f4b701d9be95143f3fa77b1f1af07de18c (patch)
tree79e8dc343b1a469ed677ae06e0952cea76ce57cf /compiler/rustc_middle/src/ty/print/pretty.rs
parente4a361a48a59ead52b302aaa2e1d9d345264935a (diff)
downloadrust-c4ec12f4b701d9be95143f3fa77b1f1af07de18c.tar.gz
rust-c4ec12f4b701d9be95143f3fa77b1f1af07de18c.zip
adjust how closure/generator types and rvalues are printed
Diffstat (limited to 'compiler/rustc_middle/src/ty/print/pretty.rs')
-rw-r--r--compiler/rustc_middle/src/ty/print/pretty.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs
index 0ee63e92848..5b833dde92c 100644
--- a/compiler/rustc_middle/src/ty/print/pretty.rs
+++ b/compiler/rustc_middle/src/ty/print/pretty.rs
@@ -795,7 +795,7 @@ pub trait PrettyPrinter<'tcx>:
             }
             ty::Str => p!("str"),
             ty::Generator(did, args, movability) => {
-                p!(write("["));
+                p!(write("{{"));
                 let generator_kind = self.tcx().generator_kind(did).unwrap();
                 let should_print_movability =
                     self.should_print_verbose() || generator_kind == hir::GeneratorKind::Gen;
@@ -836,13 +836,13 @@ pub trait PrettyPrinter<'tcx>:
                     }
                 }
 
-                p!("]")
+                p!("}}")
             }
             ty::GeneratorWitness(types) => {
                 p!(in_binder(&types));
             }
             ty::GeneratorWitnessMIR(did, args) => {
-                p!(write("["));
+                p!(write("{{"));
                 if !self.tcx().sess.verbose() {
                     p!("generator witness");
                     // FIXME(eddyb) should use `def_span`.
@@ -861,10 +861,10 @@ pub trait PrettyPrinter<'tcx>:
                     p!(print_def_path(did, args));
                 }
 
-                p!("]")
+                p!("}}")
             }
             ty::Closure(did, args) => {
-                p!(write("["));
+                p!(write("{{"));
                 if !self.should_print_verbose() {
                     p!(write("closure"));
                     // FIXME(eddyb) should use `def_span`.
@@ -904,7 +904,7 @@ pub trait PrettyPrinter<'tcx>:
                         p!(")");
                     }
                 }
-                p!("]");
+                p!("}}");
             }
             ty::Array(ty, sz) => p!("[", print(ty), "; ", print(sz), "]"),
             ty::Slice(ty) => p!("[", print(ty), "]"),
@@ -1061,7 +1061,7 @@ pub trait PrettyPrinter<'tcx>:
                     }
 
                     for (assoc_item_def_id, term) in assoc_items {
-                        // Skip printing `<[generator@] as Generator<_>>::Return` from async blocks,
+                        // Skip printing `<{generator@} as Generator<_>>::Return` from async blocks,
                         // unless we can find out what generator return type it comes from.
                         let term = if let Some(ty) = term.skip_binder().ty()
                             && let ty::Alias(ty::Projection, proj) = ty.kind()