]> git.lizzy.rs Git - rust.git/commitdiff
pretty.rs: Update Closure and Generator print
authorAman Arora <me@aman-arora.com>
Tue, 8 Sep 2020 14:43:06 +0000 (10:43 -0400)
committerAman Arora <me@aman-arora.com>
Mon, 28 Sep 2020 05:27:19 +0000 (01:27 -0400)
Co-authored-by: Dhruv Jauhar <dhruvjhr@gmail.com>
Co-authored-by: Logan Mosier <logmosier@gmail.com>
23 files changed:
compiler/rustc_middle/src/ty/print/pretty.rs
src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir
src/test/ui/async-await/issue-68112.stderr
src/test/ui/block-result/issue-20862.stderr
src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.stderr
src/test/ui/closures/closure-move-sync.stderr
src/test/ui/closures/closure-no-fn-1.stderr
src/test/ui/closures/closure-no-fn-2.stderr
src/test/ui/closures/closure-no-fn-3.stderr
src/test/ui/closures/closure-reform-bad.stderr
src/test/ui/closures/closure_cap_coerce_many_fail.stderr
src/test/ui/generator/issue-68112.stderr
src/test/ui/generator/not-send-sync.stderr
src/test/ui/impl-trait/auto-trait-leak2.stderr
src/test/ui/impl-trait/recursive-impl-trait-type-indirect.stderr
src/test/ui/interior-mutability/interior-mutability.stderr
src/test/ui/issues/issue-12127.stderr
src/test/ui/issues/issue-31173.stderr
src/test/ui/kindck/kindck-nonsendable-1.stderr
src/test/ui/no-send-res-ports.stderr
src/test/ui/not-clone-closure.stderr
src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr
src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr

index cfc4b062885b8e864378397c8d05c005efff5c09..7b5cf681f38fb60efde2996f0eca594d81707319 100644 (file)
@@ -641,42 +641,35 @@ fn pretty_print_type(mut self, ty: Ty<'tcx>) -> Result<Self::Type, Self::Error>
             }
             ty::Str => p!(write("str")),
             ty::Generator(did, substs, movability) => {
+                p!(write("["));
                 match movability {
-                    hir::Movability::Movable => p!(write("[generator")),
-                    hir::Movability::Static => p!(write("[static generator")),
+                    hir::Movability::Movable => {}
+                    hir::Movability::Static => p!(write("static ")),
                 }
 
-                // FIXME(eddyb) should use `def_span`.
-                if let Some(did) = did.as_local() {
-                    let hir_id = self.tcx().hir().local_def_id_to_hir_id(did);
-                    let span = self.tcx().hir().span(hir_id);
-                    p!(write("@{}", self.tcx().sess.source_map().span_to_string(span)));
-
-                    if substs.as_generator().is_valid() {
-                        let upvar_tys = substs.as_generator().upvar_tys();
-                        let mut sep = " ";
-                        for (&var_id, upvar_ty) in self
-                            .tcx()
-                            .upvars_mentioned(did)
-                            .as_ref()
-                            .iter()
-                            .flat_map(|v| v.keys())
-                            .zip(upvar_tys)
-                        {
-                            p!(write("{}{}:", sep, self.tcx().hir().name(var_id)), print(upvar_ty));
-                            sep = ", ";
-                        }
+                if !self.tcx().sess.verbose() {
+                    p!(write("generator"));
+                    // FIXME(eddyb) should use `def_span`.
+                    if let Some(did) = did.as_local() {
+                        let hir_id = self.tcx().hir().local_def_id_to_hir_id(did);
+                        let span = self.tcx().hir().span(hir_id);
+                        p!(write("@{}", self.tcx().sess.source_map().span_to_string(span)));
+                    } else {
+                        p!(write("@{}", self.tcx().def_path_str(did)));
                     }
                 } else {
-                    p!(write("@{}", self.tcx().def_path_str(did)));
-
+                    p!(print_def_path(did, substs));
                     if substs.as_generator().is_valid() {
-                        let upvar_tys = substs.as_generator().upvar_tys();
-                        let mut sep = " ";
-                        for (index, upvar_ty) in upvar_tys.enumerate() {
-                            p!(write("{}{}:", sep, index), print(upvar_ty));
-                            sep = ", ";
+                        // Search for the first inference variable
+                        p!(write(" upvar_tys=("));
+                        let mut uninferred_ty =
+                            substs.as_generator().upvar_tys().filter(|ty| ty.is_ty_infer());
+                        if uninferred_ty.next().is_some() {
+                            p!(write("unavailable"));
+                        } else {
+                            self = self.comma_sep(substs.as_generator().upvar_tys())?;
                         }
+                        p!(write(")"));
                     }
                 }
 
@@ -684,61 +677,50 @@ fn pretty_print_type(mut self, ty: Ty<'tcx>) -> Result<Self::Type, Self::Error>
                     p!(write(" "), print(substs.as_generator().witness()));
                 }
 
-                p!(write("]"))
+                p!(write("]"));
             }
             ty::GeneratorWitness(types) => {
                 p!(in_binder(&types));
             }
             ty::Closure(did, substs) => {
-                p!(write("[closure"));
-
-                // FIXME(eddyb) should use `def_span`.
-                if let Some(did) = did.as_local() {
-                    let hir_id = self.tcx().hir().local_def_id_to_hir_id(did);
-                    if self.tcx().sess.opts.debugging_opts.span_free_formats {
-                        p!(write("@"), print_def_path(did.to_def_id(), substs));
-                    } else {
-                        let span = self.tcx().hir().span(hir_id);
-                        p!(write("@{}", self.tcx().sess.source_map().span_to_string(span)));
-                    }
-
-                    if substs.as_closure().is_valid() {
-                        let upvar_tys = substs.as_closure().upvar_tys();
-                        let mut sep = " ";
-                        for (&var_id, upvar_ty) in self
-                            .tcx()
-                            .upvars_mentioned(did)
-                            .as_ref()
-                            .iter()
-                            .flat_map(|v| v.keys())
-                            .zip(upvar_tys)
-                        {
-                            p!(write("{}{}:", sep, self.tcx().hir().name(var_id)), print(upvar_ty));
-                            sep = ", ";
+                p!(write("["));
+                if !self.tcx().sess.verbose() {
+                    p!(write("closure"));
+                    // FIXME(eddyb) should use `def_span`.
+                    if let Some(did) = did.as_local() {
+                        let hir_id = self.tcx().hir().local_def_id_to_hir_id(did);
+                        if self.tcx().sess.opts.debugging_opts.span_free_formats {
+                            p!(write("@"), print_def_path(did.to_def_id(), substs));
+                        } else {
+                            let span = self.tcx().hir().span(hir_id);
+                            p!(write("@{}", self.tcx().sess.source_map().span_to_string(span)));
                         }
+                    } else {
+                        p!(write("@{}", self.tcx().def_path_str(did)));
                     }
                 } else {
-                    p!(write("@{}", self.tcx().def_path_str(did)));
-
+                    p!(print_def_path(did, substs));
                     if substs.as_closure().is_valid() {
-                        let upvar_tys = substs.as_closure().upvar_tys();
-                        let mut sep = " ";
-                        for (index, upvar_ty) in upvar_tys.enumerate() {
-                            p!(write("{}{}:", sep, index), print(upvar_ty));
-                            sep = ", ";
+                        // Search for the first inference variable
+                        let mut uninferred_ty =
+                            substs.as_closure().upvar_tys().filter(|ty| ty.is_ty_infer());
+                        if uninferred_ty.next().is_some() {
+                            // If the upvar substs contain an inference variable we haven't
+                            // finished capture analysis.
+                            p!(write(" closure_substs=(unavailable)"));
+                        } else {
+                            p!(write(" closure_kind_ty="), print(substs.as_closure().kind_ty()));
+                            p!(
+                                write(" closure_sig_as_fn_ptr_ty="),
+                                print(substs.as_closure().sig_as_fn_ptr_ty())
+                            );
+                            p!(write(" upvar_tys=("));
+                            self = self.comma_sep(substs.as_closure().upvar_tys())?;
+                            p!(write(")"));
                         }
                     }
                 }
-
-                if self.tcx().sess.verbose() && substs.as_closure().is_valid() {
-                    p!(write(" closure_kind_ty="), print(substs.as_closure().kind_ty()));
-                    p!(
-                        write(" closure_sig_as_fn_ptr_ty="),
-                        print(substs.as_closure().sig_as_fn_ptr_ty())
-                    );
-                }
-
-                p!(write("]"))
+                p!(write("]"));
             }
             ty::Array(ty, sz) => {
                 p!(write("["), print(ty), write("; "));
index cb222a997b6d9c99c63f2d3dc7bfedfc595e8f58..5138b50c9f0050fbd80cc97775c839c37e7331cd 100644 (file)
@@ -4,10 +4,10 @@ fn foo(_1: T, _2: i32) -> (i32, T) {
     debug t => _1;                       // in scope 0 at $DIR/inline-closure-captures.rs:10:17: 10:18
     debug q => _2;                       // in scope 0 at $DIR/inline-closure-captures.rs:10:23: 10:24
     let mut _0: (i32, T);                // return place in scope 0 at $DIR/inline-closure-captures.rs:10:34: 10:42
-    let _3: [closure@foo<T>::{closure#0} q:&i32, t:&T]; // in scope 0 at $DIR/inline-closure-captures.rs:11:9: 11:10
+    let _3: [closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure-captures.rs:11:9: 11:10
     let mut _4: &i32;                    // in scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
     let mut _5: &T;                      // in scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
-    let mut _6: &[closure@foo<T>::{closure#0} q:&i32, t:&T]; // in scope 0 at $DIR/inline-closure-captures.rs:12:5: 12:6
+    let mut _6: &[closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure-captures.rs:12:5: 12:6
     let mut _7: (i32,);                  // in scope 0 at $DIR/inline-closure-captures.rs:12:5: 12:9
     let mut _8: i32;                     // in scope 0 at $DIR/inline-closure-captures.rs:12:7: 12:8
     let mut _10: i32;                    // in scope 0 at $DIR/inline-closure-captures.rs:12:5: 12:9
index 07269f70f6bfc7afc28ad874ca4a13ab726061bb..e97d088cf3ed3d5a82897f0fa3727f05d63278ad 100644 (file)
@@ -41,8 +41,8 @@ LL |     require_send(send_fut);
    |
    = help: the trait `Sync` is not implemented for `RefCell<i32>`
    = note: required because of the requirements on the impl of `Send` for `Arc<RefCell<i32>>`
-   = note: required because it appears within the type `[static generator@$DIR/issue-68112.rs:47:31: 47:36 t:Arc<RefCell<i32>> {}]`
-   = note: required because it appears within the type `from_generator::GenFuture<[static generator@$DIR/issue-68112.rs:47:31: 47:36 t:Arc<RefCell<i32>> {}]>`
+   = note: required because it appears within the type `[static generator@$DIR/issue-68112.rs:47:31: 47:36 {}]`
+   = note: required because it appears within the type `from_generator::GenFuture<[static generator@$DIR/issue-68112.rs:47:31: 47:36 {}]>`
    = note: required because it appears within the type `impl Future`
    = note: required because it appears within the type `impl Future`
    = note: required because it appears within the type `impl Future`
index 560c9c2fbef4ff9c6ca6b3a7b6a7b3aa72aac907..09c06e8428d20bbd67229239cdc9600dfe7b2814 100644 (file)
@@ -7,7 +7,7 @@ LL |     |y| x + y
    |     ^^^^^^^^^ expected `()`, found closure
    |
    = note: expected unit type `()`
-                found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]`
+                found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14]`
 
 error[E0618]: expected function, found `()`
   --> $DIR/issue-20862.rs:7:13
index 3781691ff41dc76df0cc8e33108ed8e8a188c255..e8a026cfab92a79f4f1149c50dd6ea3f3df1acba 100644 (file)
@@ -4,7 +4,7 @@ error: lifetime may not live long enough
 LL |     let _action = move || {
    |                   -------
    |                   |     |
-   |                   |     return type of closure is [closure@$DIR/issue-53432-nested-closure-outlives-borrowed-value.rs:4:9: 4:15 f:&'2 [closure@$DIR/issue-53432-nested-closure-outlives-borrowed-value.rs:2:13: 2:23]]
+   |                   |     return type of closure is [closure@$DIR/issue-53432-nested-closure-outlives-borrowed-value.rs:4:9: 4:15]
    |                   lifetime `'1` represents this closure's body
 LL |         || f() // The `nested` closure
    |         ^^^^^^ returning this value requires that `'1` must outlive `'2`
index 505cae981b08ebcc1544abb12022e9418419bf50..da5e25c0d18fa7061a71e23b7a46dda98fc8cace 100644 (file)
@@ -11,7 +11,7 @@ LL |     F: Send + 'static,
    |
    = help: the trait `Sync` is not implemented for `std::sync::mpsc::Receiver<()>`
    = note: required because of the requirements on the impl of `Send` for `&std::sync::mpsc::Receiver<()>`
-   = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:6:27: 9:6 recv:&std::sync::mpsc::Receiver<()>]`
+   = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:6:27: 9:6]`
 
 error[E0277]: `Sender<()>` cannot be shared between threads safely
   --> $DIR/closure-move-sync.rs:18:5
@@ -26,7 +26,7 @@ LL |     F: Send + 'static,
    |
    = help: the trait `Sync` is not implemented for `Sender<()>`
    = note: required because of the requirements on the impl of `Send` for `&Sender<()>`
-   = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:18:19: 18:42 tx:&Sender<()>]`
+   = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:18:19: 18:42]`
 
 error: aborting due to 2 previous errors
 
index 5e76ee5a9a56dcc01897738bc2742a52696e22ba..76136315a1b8b4b205d49f7fbe76012aa9b1b3cb 100644 (file)
@@ -7,7 +7,7 @@ LL |     let foo: fn(u8) -> u8 = |v: u8| { a += v; a };
    |              expected due to this
    |
    = note: expected fn pointer `fn(u8) -> u8`
-                 found closure `[closure@$DIR/closure-no-fn-1.rs:6:29: 6:50 a:_]`
+                 found closure `[closure@$DIR/closure-no-fn-1.rs:6:29: 6:50]`
 
 error: aborting due to previous error
 
index 07ffd6e5c9931f0373903faf6f896c54996f3d9e..85cbdbe7c18e1aaf92970159dc760bd22944103e 100644 (file)
@@ -7,7 +7,7 @@ LL |     let bar: fn() -> u8 = || { b };
    |              expected due to this
    |
    = note: expected fn pointer `fn() -> u8`
-                 found closure `[closure@$DIR/closure-no-fn-2.rs:6:27: 6:35 b:_]`
+                 found closure `[closure@$DIR/closure-no-fn-2.rs:6:27: 6:35]`
 
 error: aborting due to previous error
 
index 4b3b4be798fc1e541a2f7b98df22ef6c737b8db3..95683a786ba6a278824b6d2b468e7170559a67f4 100644 (file)
@@ -1,4 +1,4 @@
-error[E0605]: non-primitive cast: `[closure@$DIR/closure-no-fn-3.rs:6:27: 6:37 b:_]` as `fn() -> u8`
+error[E0605]: non-primitive cast: `[closure@$DIR/closure-no-fn-3.rs:6:27: 6:37]` as `fn() -> u8`
   --> $DIR/closure-no-fn-3.rs:6:27
    |
 LL |     let baz: fn() -> u8 = (|| { b }) as fn() -> u8;
index 3c4ae450764dae72ccb5da2579b3c3e32c8705d4..77c8c7ab7948d387ef2f1d005356881fddb58cef 100644 (file)
@@ -7,7 +7,7 @@ LL |     call_bare(f)
    |               ^ expected fn pointer, found closure
    |
    = note: expected fn pointer `for<'r> fn(&'r str)`
-                 found closure `[closure@$DIR/closure-reform-bad.rs:10:13: 10:50 string:_]`
+                 found closure `[closure@$DIR/closure-reform-bad.rs:10:13: 10:50]`
 
 error: aborting due to previous error
 
index 63eb0bd8fabad3d4bc4ba84bb021832474f22088..bd2e31648cc5f910e0d250a4014e7937763b6752 100644 (file)
@@ -12,7 +12,7 @@ LL | |     };
    | |_____- `match` arms have incompatible types
    |
    = note: expected type `fn(i32, i32) -> i32 {add}`
-           found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:9:16: 9:43 cap:_]`
+           found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:9:16: 9:43]`
 
 error[E0308]: `match` arms have incompatible types
   --> $DIR/closure_cap_coerce_many_fail.rs:18:16
@@ -28,7 +28,7 @@ LL | |     };
    | |_____- `match` arms have incompatible types
    |
    = note: expected type `[closure@$DIR/closure_cap_coerce_many_fail.rs:17:16: 17:37]`
-           found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:18:16: 18:43 cap:_]`
+           found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:18:16: 18:43]`
    = note: no two closures, even if identical, have the same type
    = help: consider boxing your closure and/or using it as a trait object
 
@@ -38,14 +38,14 @@ error[E0308]: `match` arms have incompatible types
 LL |       let _ = match "+" {
    |  _____________-
 LL | |         "+" => |a, b| (a + b + cap) as i32,
-   | |                --------------------------- this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:43 cap:_]`
+   | |                --------------------------- this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:43]`
 LL | |         "-" => |a, b| (a - b) as i32,
    | |                ^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
 LL | |         _ => unimplemented!(),
 LL | |     };
    | |_____- `match` arms have incompatible types
    |
-   = note: expected type `[closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:43 cap:_]`
+   = note: expected type `[closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:43]`
            found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:27:16: 27:37]`
    = note: no two closures, even if identical, have the same type
    = help: consider boxing your closure and/or using it as a trait object
@@ -56,15 +56,15 @@ error[E0308]: `match` arms have incompatible types
 LL |       let _ = match "+" {
    |  _____________-
 LL | |         "+" => |a, b| (a + b + cap) as i32,
-   | |                --------------------------- this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:43 cap:_]`
+   | |                --------------------------- this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:43]`
 LL | |         "-" => |a, b| (a - b + cap) as i32,
    | |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
 LL | |         _ => unimplemented!(),
 LL | |     };
    | |_____- `match` arms have incompatible types
    |
-   = note: expected type `[closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:43 cap:_]`
-           found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:35:16: 35:43 cap:_]`
+   = note: expected type `[closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:43]`
+           found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:35:16: 35:43]`
    = note: no two closures, even if identical, have the same type
    = help: consider boxing your closure and/or using it as a trait object
 
index 84d2a854a4bcefe973b70a75d12282e6a08a3044..96a8d6d70e016affe934bbb195154e68a53d77ef 100644 (file)
@@ -29,7 +29,7 @@ LL |     require_send(send_gen);
    |
    = help: the trait `Sync` is not implemented for `RefCell<i32>`
    = note: required because of the requirements on the impl of `Send` for `Arc<RefCell<i32>>`
-   = note: required because it appears within the type `[generator@$DIR/issue-68112.rs:38:5: 41:6 t:Arc<RefCell<i32>> {()}]`
+   = note: required because it appears within the type `[generator@$DIR/issue-68112.rs:38:5: 41:6 {()}]`
    = note: required because it appears within the type `impl Generator`
    = note: required because it appears within the type `impl Generator`
    = note: required because it appears within the type `{impl Generator, ()}`
index 32527c45c359c9314c352af2367664047ac5f5cc..2384ed3d24972ad458192c03f22e80552aab79d6 100644 (file)
@@ -9,7 +9,7 @@ LL |     assert_send(|| {
    |
    = help: the trait `Sync` is not implemented for `Cell<i32>`
    = note: required because of the requirements on the impl of `Send` for `&Cell<i32>`
-   = note: required because it appears within the type `[generator@$DIR/not-send-sync.rs:16:17: 20:6 a:&Cell<i32> _]`
+   = note: required because it appears within the type `[generator@$DIR/not-send-sync.rs:16:17: 20:6 _]`
 
 error: generator cannot be shared between threads safely
   --> $DIR/not-send-sync.rs:9:5
index 8bb05c89e919ca8dde0f2e7583f4ddd310c5a29d..6b2b8248a4f21c71f3c15d9280fab58148ebd360 100644 (file)
@@ -11,7 +11,7 @@ LL |     send(before());
    |     ^^^^ `Rc<Cell<i32>>` cannot be sent between threads safely
    |
    = help: within `impl Fn<(i32,)>`, the trait `Send` is not implemented for `Rc<Cell<i32>>`
-   = note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:7:5: 7:22 p:Rc<Cell<i32>>]`
+   = note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:7:5: 7:22]`
    = note: required because it appears within the type `impl Fn<(i32,)>`
 
 error[E0277]: `Rc<Cell<i32>>` cannot be sent between threads safely
@@ -27,7 +27,7 @@ LL | fn after() -> impl Fn(i32) {
    |               ------------ within this `impl Fn<(i32,)>`
    |
    = help: within `impl Fn<(i32,)>`, the trait `Send` is not implemented for `Rc<Cell<i32>>`
-   = note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:24:5: 24:22 p:Rc<Cell<i32>>]`
+   = note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:24:5: 24:22]`
    = note: required because it appears within the type `impl Fn<(i32,)>`
 
 error: aborting due to 2 previous errors
index 42e13411bdab1bf2b426796e4bacf61da7fd9088..0f89ec2475ccb59b5aa94d2cb89a942a9b3217b1 100644 (file)
@@ -54,7 +54,7 @@ LL |   fn closure_capture() -> impl Sized {
 LL | /     move || {
 LL | |         x;
 LL | |     }
-   | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:35:5: 37:6 x:impl Sized]`
+   | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:35:5: 37:6]`
 
 error[E0720]: cannot resolve opaque type
   --> $DIR/recursive-impl-trait-type-indirect.rs:40:29
@@ -65,7 +65,7 @@ LL |   fn closure_ref_capture() -> impl Sized {
 LL | /     move || {
 LL | |         &x;
 LL | |     }
-   | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:43:5: 45:6 x:impl Sized]`
+   | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:43:5: 45:6]`
 
 error[E0720]: cannot resolve opaque type
   --> $DIR/recursive-impl-trait-type-indirect.rs:48:21
@@ -95,7 +95,7 @@ LL | /     move || {
 LL | |         yield;
 LL | |         x;
 LL | |     }
-   | |_____- returning here with type `[generator@$DIR/recursive-impl-trait-type-indirect.rs:61:5: 64:6 x:impl Sized {()}]`
+   | |_____- returning here with type `[generator@$DIR/recursive-impl-trait-type-indirect.rs:61:5: 64:6 {()}]`
 
 error[E0720]: cannot resolve opaque type
   --> $DIR/recursive-impl-trait-type-indirect.rs:67:35
index 3e19746cc5cb8d1230fe8d3ef9f6b9bef31b5159..dd43da11664453e0108bbac3f294459934adf965 100644 (file)
@@ -12,7 +12,7 @@ LL | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
    = help: within `Cell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
    = note: required because it appears within the type `Cell<i32>`
    = note: required because of the requirements on the impl of `UnwindSafe` for `&Cell<i32>`
-   = note: required because it appears within the type `[closure@$DIR/interior-mutability.rs:5:18: 5:35 x:&Cell<i32>]`
+   = note: required because it appears within the type `[closure@$DIR/interior-mutability.rs:5:18: 5:35]`
 
 error: aborting due to previous error
 
index e5ac85a10196e8a1401d922b5afdf8979ad3beb8..e1559ab2feaa7eccfa76648dce90d266d2662314 100644 (file)
@@ -11,7 +11,7 @@ note: this value implements `FnOnce`, which causes it to be moved when called
    |
 LL |         f();
    |         ^
-   = note: move occurs because `f` has type `[closure@$DIR/issue-12127.rs:8:24: 8:41 x:Box<isize>]`, which does not implement the `Copy` trait
+   = note: move occurs because `f` has type `[closure@$DIR/issue-12127.rs:8:24: 8:41]`, which does not implement the `Copy` trait
 
 error: aborting due to previous error
 
index a4f69a17cef3cb61c29a7bcaf400f81f7cde495c..818e004ffc8e6e471f75262ee3d2867464c68a7f 100644 (file)
@@ -1,4 +1,4 @@
-error[E0271]: type mismatch resolving `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]> as Iterator>::Item == &_`
+error[E0271]: type mismatch resolving `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]> as Iterator>::Item == &_`
   --> $DIR/issue-31173.rs:10:10
    |
 LL |         .cloned()
@@ -7,11 +7,11 @@ LL |         .cloned()
    = note:   expected type `u8`
            found reference `&_`
 
-error[E0599]: no method named `collect` found for struct `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>>` in the current scope
+error[E0599]: no method named `collect` found for struct `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>` in the current scope
   --> $DIR/issue-31173.rs:14:10
    |
 LL |         .collect();
-   |          ^^^^^^^ method not found in `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>>`
+   |          ^^^^^^^ method not found in `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>`
    | 
   ::: $SRC_DIR/core/src/iter/adapters/mod.rs:LL:COL
    |
@@ -22,10 +22,10 @@ LL | pub struct TakeWhile<I, P> {
    | -------------------------- doesn't satisfy `<_ as Iterator>::Item = &_`
    |
    = note: the method `collect` exists but the following trait bounds were not satisfied:
-           `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]> as Iterator>::Item = &_`
-           which is required by `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>>: Iterator`
-           `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>>: Iterator`
-           which is required by `&mut Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>>: Iterator`
+           `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]> as Iterator>::Item = &_`
+           which is required by `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>: Iterator`
+           `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>: Iterator`
+           which is required by `&mut Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>: Iterator`
 
 error: aborting due to 2 previous errors
 
index 45c767fbe6c5d6fcfc6e926db14069fea7271be0..c7d67a991bffc3164fdd28bab5e76b666268e195 100644 (file)
@@ -5,12 +5,12 @@ LL | fn bar<F:FnOnce() + Send>(_: F) { }
    |                     ---- required by this bound in `bar`
 ...
 LL |     bar(move|| foo(x));
-   |     ^^^ ------------- within this `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22 x:Rc<usize>]`
+   |     ^^^ ------------- within this `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22]`
    |     |
    |     `Rc<usize>` cannot be sent between threads safely
    |
-   = help: within `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22 x:Rc<usize>]`, the trait `Send` is not implemented for `Rc<usize>`
-   = note: required because it appears within the type `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22 x:Rc<usize>]`
+   = help: within `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22]`, the trait `Send` is not implemented for `Rc<usize>`
+   = note: required because it appears within the type `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22]`
 
 error: aborting due to previous error
 
index 6bd4537240c3c2b277cd549c70df5c2f6d067c8a..ef7fb4ad7b266ee7dbb26a1eadeaefdcb939b70a 100644 (file)
@@ -9,17 +9,17 @@ LL | |
 LL | |         let y = x;
 LL | |         println!("{:?}", y);
 LL | |     });
-   | |_____- within this `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6 x:Foo]`
+   | |_____- within this `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6]`
    | 
   ::: $SRC_DIR/std/src/thread/mod.rs:LL:COL
    |
 LL |       F: Send + 'static,
    |          ---- required by this bound in `spawn`
    |
-   = help: within `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6 x:Foo]`, the trait `Send` is not implemented for `Rc<()>`
+   = help: within `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6]`, the trait `Send` is not implemented for `Rc<()>`
    = note: required because it appears within the type `Port<()>`
    = note: required because it appears within the type `Foo`
-   = note: required because it appears within the type `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6 x:Foo]`
+   = note: required because it appears within the type `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6]`
 
 error: aborting due to previous error
 
index f54a69e1902b63c53de66a9dea2be74da04333b4..a62c21f2ee97168d4031711f53cb05f1c34e0478 100644 (file)
@@ -1,16 +1,16 @@
-error[E0277]: the trait bound `S: Clone` is not satisfied in `[closure@$DIR/not-clone-closure.rs:7:17: 9:6 a:S]`
+error[E0277]: the trait bound `S: Clone` is not satisfied in `[closure@$DIR/not-clone-closure.rs:7:17: 9:6]`
   --> $DIR/not-clone-closure.rs:11:23
    |
 LL |       let hello = move || {
    |  _________________-
 LL | |         println!("Hello {}", a.0);
 LL | |     };
-   | |_____- within this `[closure@$DIR/not-clone-closure.rs:7:17: 9:6 a:S]`
+   | |_____- within this `[closure@$DIR/not-clone-closure.rs:7:17: 9:6]`
 LL | 
 LL |       let hello = hello.clone();
-   |                         ^^^^^ within `[closure@$DIR/not-clone-closure.rs:7:17: 9:6 a:S]`, the trait `Clone` is not implemented for `S`
+   |                         ^^^^^ within `[closure@$DIR/not-clone-closure.rs:7:17: 9:6]`, the trait `Clone` is not implemented for `S`
    |
-   = note: required because it appears within the type `[closure@$DIR/not-clone-closure.rs:7:17: 9:6 a:S]`
+   = note: required because it appears within the type `[closure@$DIR/not-clone-closure.rs:7:17: 9:6]`
 
 error: aborting due to previous error
 
index 2a7dda7b2618b0e924e1901017f0dfdc19f484e3..ab1fa2a4d87656b6702a1308258016f1d46cb5a6 100644 (file)
@@ -33,7 +33,7 @@ LL |     let mut f = move |g: Box<dyn FnMut(isize)>, b: isize| {
    |         ----- captured outer variable
 ...
 LL |         foo(f);
-   |             ^ move occurs because `f` has type `[closure@$DIR/borrowck-call-is-borrow-issue-12224.rs:52:17: 54:6 s:String]`, which does not implement the `Copy` trait
+   |             ^ move occurs because `f` has type `[closure@$DIR/borrowck-call-is-borrow-issue-12224.rs:52:17: 54:6]`, which does not implement the `Copy` trait
 
 error[E0505]: cannot move out of `f` because it is borrowed
   --> $DIR/borrowck-call-is-borrow-issue-12224.rs:55:16
index cec01fefca8bda94e429c92001f7871985ff3c34..69e95efa72d5043a426e72903445dec62f505cb1 100644 (file)
@@ -41,7 +41,7 @@ LL | |
 LL | | where
 LL | |     G: Get<T>
    | |_____________^
-note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:30:5: 32:6 g:G, dest:&mut T]` will meet its required lifetime bounds
+note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:30:5: 32:6]` will meet its required lifetime bounds
   --> $DIR/missing-lifetimes-in-signature.rs:25:37
    |
 LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
@@ -65,7 +65,7 @@ LL | |
 LL | | where
 LL | |     G: Get<T>
    | |_____________^
-note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:52:5: 54:6 g:G, dest:&mut T]` will meet its required lifetime bounds
+note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:52:5: 54:6]` will meet its required lifetime bounds
   --> $DIR/missing-lifetimes-in-signature.rs:47:45
    |
 LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
@@ -86,7 +86,7 @@ note: the parameter type `G` must be valid for the anonymous lifetime #1 defined
    |
 LL |     fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:61:9: 63:10 g:G, dest:&mut T]` will meet its required lifetime bounds
+note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:61:9: 63:10]` will meet its required lifetime bounds
   --> $DIR/missing-lifetimes-in-signature.rs:59:58
    |
 LL |     fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
@@ -108,7 +108,7 @@ error[E0309]: the parameter type `G` may not live long enough
   --> $DIR/missing-lifetimes-in-signature.rs:79:44
    |
 LL | fn bak<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
-   |            -                               ^^^^^^^^^^^^^^^^^^ ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:84:5: 86:6 g:G, dest:&mut T]` will meet its required lifetime bounds
+   |            -                               ^^^^^^^^^^^^^^^^^^ ...so that the type `[closure@$DIR/missing-lifetimes-in-signature.rs:84:5: 86:6]` will meet its required lifetime bounds
    |            |
    |            help: consider adding an explicit lifetime bound...: `G: 'a`