]> git.lizzy.rs Git - rust.git/commit
Make logging for drop-tracking easier to read.
authorJoshua Nelson <jnelson@cloudflare.com>
Fri, 1 Jul 2022 05:11:39 +0000 (00:11 -0500)
committerJoshua Nelson <jnelson@cloudflare.com>
Fri, 1 Jul 2022 05:19:10 +0000 (00:19 -0500)
commit3164c2aa15a17ddbc4378b375ac822b6fef154b5
tree6edd13e6dffef81ee7268c0a943724df743a0968
parent483ee1f14770343122e9fadfffc054a119587dbf
Make logging for drop-tracking easier to read.

Some of these are a little questionable because the output is so much longer, but I would really love to keep the bit that adds the pretty-printed expression to the generated CFG .dot file.

Before:
```
DEBUG rustc_typeck::check::generator_interior::drop_ranges::record_consumed_borrow consume PlaceWithHirId { hir_id: HirId { owner: DefId(0:7 ~ default_struct_update[79f9]::foo), local_id: 15 }, place: Place { base_ty: impl std::future::Future<Output = ()>, base: Rvalue, projections: [] } }; diag_expr_id=HirId { owner: DefId(0:7 ~ default_struct_update[79f9]::foo), local_id: 15 }, using parent expr HirId { owner: DefId(0:7 ~ default_struct_update[79f9]::foo), local_id: 49 }
```

After:
```
DEBUG rustc_typeck::check::generator_interior::drop_ranges::record_consumed_borrow consume PlaceWithHirId { hir_id: HirId { owner: DefId(0:7 ~ default_struct_update[79f9]::foo), local_id: 15 }, place: Place { base_ty: impl std::future::Future<Output = ()>, base: Rvalue, projections: [] } }; diag_expr_id=expr from_config(Config {
        nickname: None,
        ..Default::default()
    }) (hir_id=HirId { owner: DefId(0:7 ~ default_struct_update[79f9]::foo), local_id: 15 }), using parent expr
    .await (hir_id=HirId { owner: DefId(0:7 ~ default_struct_update[79f9]::foo), local_id: 49 })
```
compiler/rustc_typeck/src/check/generator_interior/drop_ranges.rs
compiler/rustc_typeck/src/check/generator_interior/drop_ranges/cfg_build.rs
compiler/rustc_typeck/src/check/generator_interior/drop_ranges/cfg_visualize.rs
compiler/rustc_typeck/src/check/generator_interior/drop_ranges/record_consumed_borrow.rs