Skip to content

Commit 3532d6e

Browse files
committed
Modify as_local_hir_id to accept a LocalDefId instead of a DefId
1 parent 3e246bb commit 3532d6e

File tree

86 files changed

+588
-447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+588
-447
lines changed

src/librustc_codegen_llvm/callee.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ pub fn get_fn(cx: &CodegenCx<'ll, 'tcx>, instance: Instance<'tcx>) -> &'ll Value
116116
if cx.tcx.sess.opts.share_generics() {
117117
// We are in share_generics mode.
118118

119-
if instance_def_id.is_local() {
119+
if let Some(instance_def_id) = instance_def_id.as_local() {
120120
// This is a definition from the current crate. If the
121121
// definition is unreachable for downstream crates or
122122
// the current crate does not re-export generics, the

src/librustc_codegen_llvm/consts.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ impl CodegenCx<'ll, 'tcx> {
209209

210210
debug!("get_static: sym={} instance={:?}", sym, instance);
211211

212-
let g = if let Some(id) = self.tcx.hir().as_local_hir_id(def_id) {
212+
let g = if let Some(id) =
213+
def_id.as_local().map(|def_id| self.tcx.hir().as_local_hir_id(def_id).unwrap())
214+
{
213215
let llty = self.layout_of(ty).llvm_type(self);
214216
let (g, attrs) = match self.tcx.hir().get(id) {
215217
Node::Item(&hir::Item { attrs, span, kind: hir::ItemKind::Static(..), .. }) => {

src/librustc_codegen_ssa/back/symbol_export.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,8 @@ fn upstream_drop_glue_for_provider<'tcx>(
359359
}
360360

361361
fn is_unreachable_local_definition_provider(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
362-
if let Some(hir_id) = tcx.hir().as_local_hir_id(def_id) {
363-
!tcx.reachable_set(LOCAL_CRATE).contains(&hir_id)
362+
if let Some(def_id) = def_id.as_local() {
363+
!tcx.reachable_set(LOCAL_CRATE).contains(&tcx.hir().as_local_hir_id(def_id).unwrap())
364364
} else {
365365
bug!("is_unreachable_local_definition called with non-local DefId: {:?}", def_id)
366366
}

src/librustc_hir/definitions.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,8 @@ impl Definitions {
342342
}
343343

344344
#[inline]
345-
pub fn as_local_hir_id(&self, def_id: DefId) -> Option<hir::HirId> {
346-
if let Some(def_id) = def_id.as_local() {
347-
Some(self.local_def_id_to_hir_id(def_id))
348-
} else {
349-
None
350-
}
345+
pub fn as_local_hir_id(&self, def_id: LocalDefId) -> Option<hir::HirId> {
346+
Some(self.local_def_id_to_hir_id(def_id))
351347
}
352348

353349
#[inline]

src/librustc_infer/infer/error_reporting/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ fn msg_span_from_early_bound_and_free_regions(
191191
let sm = tcx.sess.source_map();
192192

193193
let scope = region.free_region_binding_scope(tcx);
194-
let node = tcx.hir().as_local_hir_id(scope).unwrap();
194+
let node = tcx.hir().as_local_hir_id(scope.expect_local()).unwrap();
195195
let tag = match tcx.hir().find(node) {
196196
Some(Node::Block(_)) | Some(Node::Expr(_)) => "body",
197197
Some(Node::Item(it)) => item_scope_tag(&it),
@@ -1780,10 +1780,11 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
17801780
if !(generics.has_self && param.index == 0) {
17811781
let type_param = generics.type_param(param, self.tcx);
17821782
let hir = &self.tcx.hir();
1783-
hir.as_local_hir_id(type_param.def_id).map(|id| {
1783+
type_param.def_id.as_local().map(|def_id| {
17841784
// Get the `hir::Param` to verify whether it already has any bounds.
17851785
// We do this to avoid suggesting code that ends up as `T: 'a'b`,
17861786
// instead we suggest `T: 'a + 'b` in that case.
1787+
let id = hir.as_local_hir_id(def_id).unwrap();
17871788
let mut has_bounds = false;
17881789
if let Node::GenericParam(param) = hir.get(id) {
17891790
has_bounds = !param.bounds.is_empty();

src/librustc_infer/infer/error_reporting/nice_region_error/find_anon_type.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
2929
) -> Option<(&hir::Ty<'_>, &hir::FnDecl<'_>)> {
3030
if let Some(anon_reg) = self.tcx().is_suitable_region(region) {
3131
let def_id = anon_reg.def_id;
32-
if let Some(hir_id) = self.tcx().hir().as_local_hir_id(def_id) {
32+
if let Some(hir_id) =
33+
def_id.as_local().map(|def_id| self.tcx().hir().as_local_hir_id(def_id).unwrap())
34+
{
3335
let fndecl = match self.tcx().hir().get(hir_id) {
3436
Node::Item(&hir::Item { kind: hir::ItemKind::Fn(ref m, ..), .. })
3537
| Node::TraitItem(&hir::TraitItem {

src/librustc_infer/infer/error_reporting/nice_region_error/outlives_closure.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
4646
) = (&sub_origin, sup_region)
4747
{
4848
let hir = &self.tcx().hir();
49-
if let Some(hir_id) = hir.as_local_hir_id(free_region.scope) {
49+
if let Some(hir_id) =
50+
free_region.scope.as_local().map(|def_id| hir.as_local_hir_id(def_id).unwrap())
51+
{
5052
if let Node::Expr(Expr { kind: Closure(_, _, _, closure_span, None), .. }) =
5153
hir.get(hir_id)
5254
{

src/librustc_infer/infer/error_reporting/nice_region_error/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
5151
};
5252

5353
let hir = &self.tcx().hir();
54-
let hir_id = hir.as_local_hir_id(id)?;
54+
let hir_id = hir.as_local_hir_id(id.as_local()?)?;
5555
let body_id = hir.maybe_body_owned_by(hir_id)?;
5656
let body = hir.body(body_id);
5757
let owner_id = hir.body_owner(body_id);

src/librustc_lint/builtin.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
436436
// If the trait is private, add the impl items to `private_traits` so they don't get
437437
// reported for missing docs.
438438
let real_trait = trait_ref.path.res.def_id();
439-
if let Some(hir_id) = cx.tcx.hir().as_local_hir_id(real_trait) {
439+
if let Some(hir_id) = real_trait
440+
.as_local()
441+
.map(|def_id| cx.tcx.hir().as_local_hir_id(def_id).unwrap())
442+
{
440443
if let Some(Node::Item(item)) = cx.tcx.hir().find(hir_id) {
441444
if let hir::VisibilityKind::Inherited = item.vis.node {
442445
for impl_item_ref in items {
@@ -609,7 +612,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDebugImplementations {
609612
let mut impls = HirIdSet::default();
610613
cx.tcx.for_each_impl(debug, |d| {
611614
if let Some(ty_def) = cx.tcx.type_of(d).ty_adt_def() {
612-
if let Some(hir_id) = cx.tcx.hir().as_local_hir_id(ty_def.did) {
615+
if let Some(hir_id) = ty_def
616+
.did
617+
.as_local()
618+
.map(|def_id| cx.tcx.hir().as_local_hir_id(def_id).unwrap())
619+
{
613620
impls.insert(hir_id);
614621
}
615622
}

src/librustc_lint/late.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use rustc_ast::ast;
1919
use rustc_ast::walk_list;
2020
use rustc_data_structures::sync::{join, par_iter, ParallelIterator};
2121
use rustc_hir as hir;
22-
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
22+
use rustc_hir::def_id::{LocalDefId, LOCAL_CRATE};
2323
use rustc_hir::intravisit as hir_visit;
2424
use rustc_hir::intravisit::Visitor;
2525
use rustc_middle::hir::map::Map;
@@ -353,7 +353,7 @@ crate::late_lint_methods!(late_lint_pass_impl, [], ['tcx]);
353353

354354
fn late_lint_mod_pass<'tcx, T: for<'a> LateLintPass<'a, 'tcx>>(
355355
tcx: TyCtxt<'tcx>,
356-
module_def_id: DefId,
356+
module_def_id: LocalDefId,
357357
pass: T,
358358
) {
359359
let access_levels = &tcx.privacy_access_levels(LOCAL_CRATE);
@@ -382,7 +382,7 @@ fn late_lint_mod_pass<'tcx, T: for<'a> LateLintPass<'a, 'tcx>>(
382382

383383
pub fn late_lint_mod<'tcx, T: for<'a> LateLintPass<'a, 'tcx>>(
384384
tcx: TyCtxt<'tcx>,
385-
module_def_id: DefId,
385+
module_def_id: LocalDefId,
386386
builtin_lints: T,
387387
) {
388388
if tcx.sess.opts.debugging_opts.no_interleave_lints {

src/librustc_lint/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ pub fn provide(providers: &mut Providers<'_>) {
8989
}
9090

9191
fn lint_mod(tcx: TyCtxt<'_>, module_def_id: DefId) {
92-
late::late_lint_mod(tcx, module_def_id, BuiltinCombinedModuleLateLintPass::new());
92+
late::late_lint_mod(
93+
tcx,
94+
module_def_id.expect_local(),
95+
BuiltinCombinedModuleLateLintPass::new(),
96+
);
9397
}
9498

9599
macro_rules! pre_expansion_lint_passes {

src/librustc_metadata/rmeta/encoder.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ impl EncodeContext<'tcx> {
616616
ctor: variant.ctor_def_id.map(|did| did.index),
617617
};
618618

619-
let enum_id = tcx.hir().as_local_hir_id(def.did).unwrap();
619+
let enum_id = tcx.hir().as_local_hir_id(def.did.expect_local()).unwrap();
620620
let enum_vis = &tcx.hir().expect_item(enum_id).vis;
621621

622622
record!(self.tables.kind[def_id] <- EntryKind::Variant(self.lazy(data)));
@@ -662,7 +662,7 @@ impl EncodeContext<'tcx> {
662662

663663
// Variant constructors have the same visibility as the parent enums, unless marked as
664664
// non-exhaustive, in which case they are lowered to `pub(crate)`.
665-
let enum_id = tcx.hir().as_local_hir_id(def.did).unwrap();
665+
let enum_id = tcx.hir().as_local_hir_id(def.did.expect_local()).unwrap();
666666
let enum_vis = &tcx.hir().expect_item(enum_id).vis;
667667
let mut ctor_vis = ty::Visibility::from_hir(enum_vis, enum_id, tcx);
668668
if variant.is_field_list_non_exhaustive() && ctor_vis == ty::Visibility::Public {
@@ -728,7 +728,7 @@ impl EncodeContext<'tcx> {
728728
let def_id = field.did;
729729
debug!("EncodeContext::encode_field({:?})", def_id);
730730

731-
let variant_id = tcx.hir().as_local_hir_id(variant.def_id).unwrap();
731+
let variant_id = tcx.hir().as_local_hir_id(variant.def_id.expect_local()).unwrap();
732732
let variant_data = tcx.hir().expect_variant_data(variant_id);
733733

734734
record!(self.tables.kind[def_id] <- EntryKind::Field);
@@ -755,7 +755,7 @@ impl EncodeContext<'tcx> {
755755
ctor: Some(def_id.index),
756756
};
757757

758-
let struct_id = tcx.hir().as_local_hir_id(adt_def.did).unwrap();
758+
let struct_id = tcx.hir().as_local_hir_id(adt_def.did.expect_local()).unwrap();
759759
let struct_vis = &tcx.hir().expect_item(struct_id).vis;
760760
let mut ctor_vis = ty::Visibility::from_hir(struct_vis, struct_id, tcx);
761761
for field in &variant.fields {
@@ -817,7 +817,7 @@ impl EncodeContext<'tcx> {
817817
debug!("EncodeContext::encode_info_for_trait_item({:?})", def_id);
818818
let tcx = self.tcx;
819819

820-
let hir_id = tcx.hir().as_local_hir_id(def_id).unwrap();
820+
let hir_id = tcx.hir().as_local_hir_id(def_id.expect_local()).unwrap();
821821
let ast_item = tcx.hir().expect_trait_item(hir_id);
822822
let trait_item = tcx.associated_item(def_id);
823823

@@ -908,7 +908,7 @@ impl EncodeContext<'tcx> {
908908
debug!("EncodeContext::encode_info_for_impl_item({:?})", def_id);
909909
let tcx = self.tcx;
910910

911-
let hir_id = self.tcx.hir().as_local_hir_id(def_id).unwrap();
911+
let hir_id = self.tcx.hir().as_local_hir_id(def_id.expect_local()).unwrap();
912912
let ast_item = self.tcx.hir().expect_impl_item(hir_id);
913913
let impl_item = self.tcx.associated_item(def_id);
914914

@@ -1308,14 +1308,14 @@ impl EncodeContext<'tcx> {
13081308
}
13091309

13101310
fn encode_info_for_closure(&mut self, def_id: LocalDefId) {
1311-
let def_id = def_id.to_def_id();
13121311
debug!("EncodeContext::encode_info_for_closure({:?})", def_id);
13131312

13141313
// NOTE(eddyb) `tcx.type_of(def_id)` isn't used because it's fully generic,
13151314
// including on the signature, which is inferred in `typeck_tables_of.
13161315
let hir_id = self.tcx.hir().as_local_hir_id(def_id).unwrap();
13171316
let ty = self.tcx.typeck_tables_of(def_id).node_type(hir_id);
13181317

1318+
let def_id = def_id.to_def_id();
13191319
record!(self.tables.kind[def_id] <- match ty.kind {
13201320
ty::Generator(..) => {
13211321
let data = self.tcx.generator_kind(def_id).unwrap();
@@ -1339,11 +1339,11 @@ impl EncodeContext<'tcx> {
13391339
}
13401340

13411341
fn encode_info_for_anon_const(&mut self, def_id: LocalDefId) {
1342-
let def_id = def_id.to_def_id();
13431342
debug!("EncodeContext::encode_info_for_anon_const({:?})", def_id);
13441343
let id = self.tcx.hir().as_local_hir_id(def_id).unwrap();
13451344
let body_id = self.tcx.hir().body_owned_by(id);
13461345
let const_data = self.encode_rendered_const_for_body(body_id);
1346+
let def_id = def_id.to_def_id();
13471347
let qualifs = self.tcx.mir_const_qualif(def_id);
13481348

13491349
record!(self.tables.kind[def_id] <- EntryKind::Const(qualifs, const_data));

src/librustc_middle/dep_graph/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_data_structures::profiling::SelfProfilerRef;
55
use rustc_data_structures::sync::Lock;
66
use rustc_data_structures::thin_vec::ThinVec;
77
use rustc_errors::Diagnostic;
8-
use rustc_hir::def_id::DefId;
8+
use rustc_hir::def_id::LocalDefId;
99

1010
mod dep_node;
1111

@@ -106,7 +106,7 @@ impl<'tcx> DepContext for TyCtxt<'tcx> {
106106
match dep_node.kind {
107107
DepKind::hir_owner | DepKind::hir_owner_nodes | DepKind::CrateMetadata => {
108108
if let Some(def_id) = dep_node.extract_def_id(*self) {
109-
if def_id_corresponds_to_hir_dep_node(*self, def_id) {
109+
if def_id_corresponds_to_hir_dep_node(*self, def_id.expect_local()) {
110110
if dep_node.kind == DepKind::CrateMetadata {
111111
// The `DefPath` has corresponding node,
112112
// and that node should have been marked
@@ -180,7 +180,7 @@ impl<'tcx> DepContext for TyCtxt<'tcx> {
180180
}
181181
}
182182

183-
fn def_id_corresponds_to_hir_dep_node(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
183+
fn def_id_corresponds_to_hir_dep_node(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
184184
let hir_id = tcx.hir().as_local_hir_id(def_id).unwrap();
185-
def_id.index == hir_id.owner.local_def_index
185+
def_id == hir_id.owner
186186
}

src/librustc_middle/hir/map/mod.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ impl<'hir> Map<'hir> {
198198
}
199199

200200
#[inline]
201-
pub fn as_local_hir_id(&self, def_id: DefId) -> Option<HirId> {
201+
pub fn as_local_hir_id(&self, def_id: LocalDefId) -> Option<HirId> {
202202
self.tcx.definitions.as_local_hir_id(def_id)
203203
}
204204

@@ -448,7 +448,7 @@ impl<'hir> Map<'hir> {
448448
}
449449
}
450450

451-
pub fn get_module(&self, module: DefId) -> (&'hir Mod<'hir>, Span, HirId) {
451+
pub fn get_module(&self, module: LocalDefId) -> (&'hir Mod<'hir>, Span, HirId) {
452452
let hir_id = self.as_local_hir_id(module).unwrap();
453453
match self.get_entry(hir_id).node {
454454
Node::Item(&Item { span, kind: ItemKind::Mod(ref m), .. }) => (m, span, hir_id),
@@ -482,7 +482,11 @@ impl<'hir> Map<'hir> {
482482
}
483483

484484
pub fn get_if_local(&self, id: DefId) -> Option<Node<'hir>> {
485-
self.as_local_hir_id(id).map(|id| self.get(id))
485+
if let Some(id) = id.as_local() {
486+
self.as_local_hir_id(id).map(|id| self.get(id))
487+
} else {
488+
None
489+
}
486490
}
487491

488492
pub fn get_generics(&self, id: DefId) -> Option<&'hir Generics<'hir>> {
@@ -885,7 +889,11 @@ impl<'hir> Map<'hir> {
885889
}
886890

887891
pub fn span_if_local(&self, id: DefId) -> Option<Span> {
888-
self.as_local_hir_id(id).map(|id| self.span(id))
892+
if let Some(id) = id.as_local() {
893+
self.as_local_hir_id(id).map(|id| self.span(id))
894+
} else {
895+
None
896+
}
889897
}
890898

891899
pub fn res_span(&self, res: Res) -> Option<Span> {
@@ -1085,8 +1093,8 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId) -> String {
10851093

10861094
pub fn provide(providers: &mut Providers<'_>) {
10871095
providers.def_kind = |tcx, def_id| {
1088-
if let Some(hir_id) = tcx.hir().as_local_hir_id(def_id) {
1089-
tcx.hir().def_kind(hir_id)
1096+
if let Some(def_id) = def_id.as_local() {
1097+
tcx.hir().def_kind(tcx.hir().as_local_hir_id(def_id).unwrap())
10901098
} else {
10911099
bug!("calling local def_kind query provider for upstream DefId: {:?}", def_id);
10921100
}

src/librustc_middle/hir/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ impl<'tcx> TyCtxt<'tcx> {
6868
pub fn provide(providers: &mut Providers<'_>) {
6969
providers.parent_module_from_def_id = |tcx, id| {
7070
let hir = tcx.hir();
71-
hir.local_def_id(hir.get_module_parent_node(hir.as_local_hir_id(id.to_def_id()).unwrap()))
71+
hir.local_def_id(hir.get_module_parent_node(hir.as_local_hir_id(id).unwrap()))
7272
};
7373
providers.hir_crate = |tcx, _| tcx.untracked_crate;
7474
providers.index_hir = map::index_hir;
7575
providers.hir_module_items = |tcx, id| {
7676
let hir = tcx.hir();
77-
let module = hir.as_local_hir_id(id.to_def_id()).unwrap();
77+
let module = hir.as_local_hir_id(id).unwrap();
7878
&tcx.untracked_crate.modules[&module]
7979
};
8080
providers.hir_owner = |tcx, id| tcx.index_hir(LOCAL_CRATE).map[id].signature;

src/librustc_middle/middle/region.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ impl<'tcx> ScopeTree {
554554
pub fn early_free_scope(&self, tcx: TyCtxt<'tcx>, br: &ty::EarlyBoundRegion) -> Scope {
555555
let param_owner = tcx.parent(br.def_id).unwrap();
556556

557-
let param_owner_id = tcx.hir().as_local_hir_id(param_owner).unwrap();
557+
let param_owner_id = tcx.hir().as_local_hir_id(param_owner.expect_local()).unwrap();
558558
let scope = tcx
559559
.hir()
560560
.maybe_body_owned_by(param_owner_id)
@@ -595,7 +595,7 @@ impl<'tcx> ScopeTree {
595595
// on the same function that they ended up being freed in.
596596
assert_eq!(param_owner, fr.scope);
597597

598-
let param_owner_id = tcx.hir().as_local_hir_id(param_owner).unwrap();
598+
let param_owner_id = tcx.hir().as_local_hir_id(param_owner.expect_local()).unwrap();
599599
let body_id = tcx.hir().body_owned_by(param_owner_id);
600600
Scope { id: tcx.hir().body(body_id).value.hir_id.local_id, data: ScopeData::CallSite }
601601
}

src/librustc_middle/mir/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,7 +2284,10 @@ impl<'tcx> Debug for Rvalue<'tcx> {
22842284
}
22852285

22862286
AggregateKind::Closure(def_id, substs) => ty::tls::with(|tcx| {
2287-
if let Some(hir_id) = tcx.hir().as_local_hir_id(def_id) {
2287+
if let Some(hir_id) = def_id
2288+
.as_local()
2289+
.map(|def_id| tcx.hir().as_local_hir_id(def_id).unwrap())
2290+
{
22882291
let name = if tcx.sess.opts.debugging_opts.span_free_formats {
22892292
let substs = tcx.lift(&substs).unwrap();
22902293
format!(
@@ -2310,7 +2313,10 @@ impl<'tcx> Debug for Rvalue<'tcx> {
23102313
}),
23112314

23122315
AggregateKind::Generator(def_id, _, _) => ty::tls::with(|tcx| {
2313-
if let Some(hir_id) = tcx.hir().as_local_hir_id(def_id) {
2316+
if let Some(hir_id) = def_id
2317+
.as_local()
2318+
.map(|def_id| tcx.hir().as_local_hir_id(def_id).unwrap())
2319+
{
23142320
let name = format!("[generator@{:?}]", tcx.hir().span(hir_id));
23152321
let mut struct_fmt = fmt.debug_struct(&name);
23162322

0 commit comments

Comments
 (0)