Skip to content

Commit 34466a2

Browse files
committed
Remove Option from the return type of def_kind.
1 parent e5addfa commit 34466a2

File tree

23 files changed

+74
-110
lines changed

23 files changed

+74
-110
lines changed

src/librustc_infer/infer/error_reporting/need_type_info.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
192192
.get_opt_name()
193193
.map(|parent_symbol| parent_symbol.to_string());
194194

195-
let type_parent_desc = self
196-
.tcx
197-
.def_kind(parent_def_id)
198-
.map(|parent_def_kind| parent_def_kind.descr(parent_def_id));
199-
200-
(parent_name, type_parent_desc)
195+
(parent_name, Some(self.tcx.def_kind(parent_def_id).descr(parent_def_id)))
201196
} else {
202197
(None, None)
203198
};

src/librustc_metadata/rmeta/decoder/cstore_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ provide! { <'tcx> tcx, def_id, other, cdata,
127127
is_foreign_item => { cdata.is_foreign_item(def_id.index) }
128128
static_mutability => { cdata.static_mutability(def_id.index) }
129129
generator_kind => { cdata.generator_kind(def_id.index) }
130-
def_kind => { Some(cdata.def_kind(def_id.index)) }
130+
def_kind => { cdata.def_kind(def_id.index) }
131131
def_span => { cdata.get_span(def_id.index, &tcx.sess) }
132132
lookup_stability => {
133133
cdata.get_stability(def_id.index).map(|s| tcx.intern_stability(s))

src/librustc_middle/hir/map/mod.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,14 @@ impl<'hir> Map<'hir> {
229229
self.tcx.definitions.opt_local_def_id_to_hir_id(def_id)
230230
}
231231

232-
pub fn def_kind(&self, local_def_id: LocalDefId) -> Option<DefKind> {
232+
pub fn def_kind(&self, local_def_id: LocalDefId) -> DefKind {
233+
// FIXME(eddyb) support `find` on the crate root.
233234
if local_def_id.to_def_id().index == CRATE_DEF_INDEX {
234-
return Some(DefKind::Mod);
235+
return DefKind::Mod;
235236
}
236237

237238
let hir_id = self.local_def_id_to_hir_id(local_def_id);
238-
let node = self.find(hir_id)?;
239-
240-
Some(match node {
239+
match self.get(hir_id) {
241240
Node::Item(item) => match item.kind {
242241
ItemKind::Static(..) => DefKind::Static,
243242
ItemKind::Const(..) => DefKind::Const,
@@ -275,7 +274,7 @@ impl<'hir> Map<'hir> {
275274
Node::Variant(_) => DefKind::Variant,
276275
Node::Ctor(variant_data) => {
277276
// FIXME(eddyb) is this even possible, if we have a `Node::Ctor`?
278-
variant_data.ctor_hir_id()?;
277+
assert_ne!(variant_data.ctor_hir_id(), None);
279278

280279
let ctor_of = match self.find(self.get_parent_node(hir_id)) {
281280
Some(Node::Item(..)) => def::CtorOf::Struct,
@@ -310,7 +309,7 @@ impl<'hir> Map<'hir> {
310309
| Node::Visibility(_)
311310
| Node::Block(_)
312311
| Node::Crate(_) => bug!("def_kind: unsupported node: {}", self.node_to_string(hir_id)),
313-
})
312+
}
314313
}
315314

316315
fn find_entry(&self, id: HirId) -> Option<Entry<'hir>> {

src/librustc_middle/middle/stability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ pub enum EvalResult {
246246
fn skip_stability_check_due_to_privacy(tcx: TyCtxt<'_>, mut def_id: DefId) -> bool {
247247
// Check if `def_id` is a trait method.
248248
match tcx.def_kind(def_id) {
249-
Some(DefKind::AssocFn) | Some(DefKind::AssocTy) | Some(DefKind::AssocConst) => {
249+
DefKind::AssocFn | DefKind::AssocTy | DefKind::AssocConst => {
250250
if let ty::TraitContainer(trait_def_id) = tcx.associated_item(def_id).container {
251251
// Trait methods do not declare visibility (even
252252
// for visibility info in cstore). Use containing

src/librustc_middle/query/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ rustc_queries! {
630630
cache_on_disk_if { true }
631631
}
632632

633-
query def_kind(_: DefId) -> Option<DefKind> {}
633+
query def_kind(_: DefId) -> DefKind {}
634634
query def_span(_: DefId) -> Span {
635635
// FIXME(mw): DefSpans are not really inputs since they are derived from
636636
// HIR. But at the moment HIR hashing still contains some hacks that allow

src/librustc_middle/ty/context.rs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ use rustc_errors::ErrorReported;
5050
use rustc_hir as hir;
5151
use rustc_hir::def::{DefKind, Res};
5252
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, DefIdSet, LocalDefId, LOCAL_CRATE};
53-
use rustc_hir::definitions::{DefPathData, DefPathHash, Definitions};
53+
use rustc_hir::definitions::{DefPathHash, Definitions};
5454
use rustc_hir::lang_items;
5555
use rustc_hir::lang_items::PanicLocationLangItem;
5656
use rustc_hir::{HirId, Node, TraitCandidate};
@@ -1492,21 +1492,13 @@ impl<'tcx> TyCtxt<'tcx> {
14921492

14931493
/// Returns a displayable description and article for the given `def_id` (e.g. `("a", "struct")`).
14941494
pub fn article_and_description(&self, def_id: DefId) -> (&'static str, &'static str) {
1495-
self.def_kind(def_id)
1496-
.map(|def_kind| (def_kind.article(), def_kind.descr(def_id)))
1497-
.unwrap_or_else(|| match self.def_key(def_id).disambiguated_data.data {
1498-
DefPathData::ClosureExpr => match self.generator_kind(def_id) {
1499-
None => ("a", "closure"),
1500-
Some(rustc_hir::GeneratorKind::Async(..)) => ("an", "async closure"),
1501-
Some(rustc_hir::GeneratorKind::Gen) => ("a", "generator"),
1502-
},
1503-
DefPathData::LifetimeNs(..) => ("a", "lifetime"),
1504-
DefPathData::Impl => ("an", "implementation"),
1505-
DefPathData::TypeNs(..) | DefPathData::ValueNs(..) | DefPathData::MacroNs(..) => {
1506-
unreachable!()
1507-
}
1508-
_ => bug!("article_and_description called on def_id {:?}", def_id),
1509-
})
1495+
match self.def_kind(def_id) {
1496+
DefKind::Generator => match self.generator_kind(def_id).unwrap() {
1497+
rustc_hir::GeneratorKind::Async(..) => ("an", "async closure"),
1498+
rustc_hir::GeneratorKind::Gen => ("a", "generator"),
1499+
},
1500+
def_kind => (def_kind.article(), def_kind.descr(def_id)),
1501+
}
15101502
}
15111503
}
15121504

src/librustc_middle/ty/mod.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2670,16 +2670,9 @@ impl<'tcx> TyCtxt<'tcx> {
26702670
}
26712671

26722672
pub fn opt_associated_item(self, def_id: DefId) -> Option<AssocItem> {
2673-
let is_associated_item = if let Some(hir_id) = self.hir().as_local_hir_id(def_id) {
2674-
match self.hir().get(hir_id) {
2675-
Node::TraitItem(_) | Node::ImplItem(_) => true,
2676-
_ => false,
2677-
}
2678-
} else {
2679-
match self.def_kind(def_id) {
2680-
Some(DefKind::AssocConst | DefKind::AssocFn | DefKind::AssocTy) => true,
2681-
_ => false,
2682-
}
2673+
let is_associated_item = match self.def_kind(def_id) {
2674+
DefKind::AssocConst | DefKind::AssocFn | DefKind::AssocTy => true,
2675+
_ => false,
26832676
};
26842677

26852678
is_associated_item.then(|| self.associated_item(def_id))

src/librustc_middle/ty/print/pretty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,9 +909,9 @@ pub trait PrettyPrinter<'tcx>:
909909
p!(write("::{:?}", promoted));
910910
} else {
911911
match self.tcx().def_kind(did) {
912-
Some(DefKind::Static)
913-
| Some(DefKind::Const)
914-
| Some(DefKind::AssocConst) => p!(print_value_path(did, substs)),
912+
DefKind::Static | DefKind::Const | DefKind::AssocConst => {
913+
p!(print_value_path(did, substs))
914+
}
915915
_ => {
916916
if did.is_local() {
917917
let span = self.tcx().def_span(did);

src/librustc_middle/ty/util.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use rustc_errors::ErrorReported;
1616
use rustc_hir as hir;
1717
use rustc_hir::def::DefKind;
1818
use rustc_hir::def_id::DefId;
19-
use rustc_hir::definitions::DefPathData;
2019
use rustc_macros::HashStable;
2120
use rustc_span::Span;
2221
use rustc_target::abi::{Integer, Size, TargetDataLayout};
@@ -448,24 +447,24 @@ impl<'tcx> TyCtxt<'tcx> {
448447
/// those are not yet phased out). The parent of the closure's
449448
/// `DefId` will also be the context where it appears.
450449
pub fn is_closure(self, def_id: DefId) -> bool {
451-
self.def_key(def_id).disambiguated_data.data == DefPathData::ClosureExpr
450+
matches!(self.def_kind(def_id), DefKind::Closure | DefKind::Generator)
452451
}
453452

454453
/// Returns `true` if `def_id` refers to a trait (i.e., `trait Foo { ... }`).
455454
pub fn is_trait(self, def_id: DefId) -> bool {
456-
self.def_kind(def_id) == Some(DefKind::Trait)
455+
self.def_kind(def_id) == DefKind::Trait
457456
}
458457

459458
/// Returns `true` if `def_id` refers to a trait alias (i.e., `trait Foo = ...;`),
460459
/// and `false` otherwise.
461460
pub fn is_trait_alias(self, def_id: DefId) -> bool {
462-
self.def_kind(def_id) == Some(DefKind::TraitAlias)
461+
self.def_kind(def_id) == DefKind::TraitAlias
463462
}
464463

465464
/// Returns `true` if this `DefId` refers to the implicit constructor for
466465
/// a tuple struct like `struct Foo(u32)`, and `false` otherwise.
467466
pub fn is_constructor(self, def_id: DefId) -> bool {
468-
self.def_key(def_id).disambiguated_data.data == DefPathData::Ctor
467+
matches!(self.def_kind(def_id), DefKind::Ctor(..))
469468
}
470469

471470
/// Given the def-ID of a fn or closure, returns the def-ID of

src/librustc_mir/const_eval/eval_queries.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ pub fn const_eval_raw_provider<'tcx>(
345345
// because any code that existed before validation could not have failed
346346
// validation thus preventing such a hard error from being a backwards
347347
// compatibility hazard
348-
Some(DefKind::Const) | Some(DefKind::AssocConst) => {
348+
DefKind::Const | DefKind::AssocConst => {
349349
let hir_id = tcx.hir().as_local_hir_id(def_id).unwrap();
350350
err.report_as_lint(
351351
tcx.at(tcx.def_span(def_id)),

src/librustc_mir/interpret/eval_context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
631631
// FIXME: The above is likely untrue. See
632632
// <https://github.com/rust-lang/rust/pull/70004#issuecomment-602022110>. Is it
633633
// okay to ignore `StorageDead`/`StorageLive` annotations during CTFE?
634-
Some(DefKind::Static) | Some(DefKind::Const) | Some(DefKind::AssocConst) => {}
634+
DefKind::Static | DefKind::Const | DefKind::AssocConst => {}
635635
_ => {
636636
// Mark locals that use `Storage*` annotations as dead on function entry.
637637
let always_live = AlwaysLiveLocals::new(self.body());

src/librustc_mir/monomorphize/partitioning.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ fn compute_codegen_unit_name(
779779
cgu_def_id = Some(DefId { krate: def_id.krate, index: CRATE_DEF_INDEX });
780780
}
781781
break;
782-
} else if tcx.def_kind(current_def_id) == Some(DefKind::Mod) {
782+
} else if tcx.def_kind(current_def_id) == DefKind::Mod {
783783
if cgu_def_id.is_none() {
784784
cgu_def_id = Some(current_def_id);
785785
}

src/librustc_mir/transform/const_prop.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,7 @@ impl<'tcx> MirPass<'tcx> for ConstProp {
7272
.expect("Non-local call to local provider is_const_fn");
7373

7474
let is_fn_like = FnLikeNode::from_node(tcx.hir().get(hir_id)).is_some();
75-
let is_assoc_const = match tcx.def_kind(source.def_id()) {
76-
Some(DefKind::AssocConst) => true,
77-
_ => false,
78-
};
75+
let is_assoc_const = tcx.def_kind(source.def_id()) == DefKind::AssocConst;
7976

8077
// Only run const prop on functions, methods, closures and associated constants
8178
if !is_fn_like && !is_assoc_const {

src/librustc_mir/util/pretty.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -805,18 +805,18 @@ fn write_mir_sig(
805805

806806
trace!("write_mir_sig: {:?}", src.instance);
807807
let kind = tcx.def_kind(src.def_id());
808-
let is_function = match kind {
809-
Some(DefKind::Fn) | Some(DefKind::AssocFn) | Some(DefKind::Ctor(..)) => true,
810-
_ => tcx.is_closure(src.def_id()),
811-
};
808+
let is_function = matches!(
809+
kind,
810+
DefKind::Fn | DefKind::AssocFn | DefKind::Ctor(..) | DefKind::Closure | DefKind::Generator
811+
);
812812
match (kind, src.promoted) {
813813
(_, Some(i)) => write!(w, "{:?} in ", i)?,
814-
(Some(DefKind::Const), _) | (Some(DefKind::AssocConst), _) => write!(w, "const ")?,
815-
(Some(DefKind::Static), _) => {
814+
(DefKind::Const | DefKind::AssocConst, _) => write!(w, "const ")?,
815+
(DefKind::Static, _) => {
816816
write!(w, "static {}", if tcx.is_mutable_static(src.def_id()) { "mut " } else { "" })?
817817
}
818818
(_, _) if is_function => write!(w, "fn ")?,
819-
(Some(DefKind::AnonConst), _) | (None, _) => {} // things like anon const, not an item
819+
(DefKind::AnonConst, _) => {} // things like anon const, not an item
820820
_ => bug!("Unexpected def kind {:?}", kind),
821821
}
822822

src/librustc_privacy/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -537,11 +537,10 @@ impl EmbargoVisitor<'tcx> {
537537
for item_id in module.item_ids {
538538
let hir_id = item_id.id;
539539
let item_def_id = self.tcx.hir().local_def_id(hir_id);
540-
if let Some(def_kind) = self.tcx.def_kind(item_def_id) {
541-
let item = self.tcx.hir().expect_item(hir_id);
542-
let vis = ty::Visibility::from_hir(&item.vis, hir_id, self.tcx);
543-
self.update_macro_reachable_def(hir_id, def_kind, vis, defining_mod);
544-
}
540+
let def_kind = self.tcx.def_kind(item_def_id);
541+
let item = self.tcx.hir().expect_item(hir_id);
542+
let vis = ty::Visibility::from_hir(&item.vis, hir_id, self.tcx);
543+
self.update_macro_reachable_def(hir_id, def_kind, vis, defining_mod);
545544
}
546545
if let Some(exports) = self.tcx.module_exports(module_def_id) {
547546
for export in exports {

src/librustc_trait_selection/traits/error_reporting/suggestions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
14471447
// ```
14481448
debug!("parent_def_kind: {:?}", self.tcx.def_kind(parent_did));
14491449
let is_raw_borrow_inside_fn_like_call = match self.tcx.def_kind(parent_did) {
1450-
Some(DefKind::Fn) | Some(DefKind::Ctor(..)) => target_ty.is_unsafe_ptr(),
1450+
DefKind::Fn | DefKind::Ctor(..) => target_ty.is_unsafe_ptr(),
14511451
_ => false,
14521452
};
14531453

src/librustc_traits/lowering/mod.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,24 +150,23 @@ crate fn program_clauses_for(tcx: TyCtxt<'_>, def_id: DefId) -> Clauses<'_> {
150150
// FIXME(eddyb) this should only be using `def_kind`.
151151
match tcx.def_key(def_id).disambiguated_data.data {
152152
DefPathData::TypeNs(..) => match tcx.def_kind(def_id) {
153-
Some(DefKind::Trait) | Some(DefKind::TraitAlias) => {
154-
program_clauses_for_trait(tcx, def_id)
155-
}
153+
DefKind::Trait | DefKind::TraitAlias => program_clauses_for_trait(tcx, def_id),
154+
156155
// FIXME(eddyb) deduplicate this `associated_item` call with
157156
// `program_clauses_for_associated_type_{value,def}`.
158-
Some(DefKind::AssocTy) => match tcx.associated_item(def_id).container {
157+
DefKind::AssocTy => match tcx.associated_item(def_id).container {
159158
ty::AssocItemContainer::ImplContainer(_) => {
160159
program_clauses_for_associated_type_value(tcx, def_id)
161160
}
162161
ty::AssocItemContainer::TraitContainer(_) => {
163162
program_clauses_for_associated_type_def(tcx, def_id)
164163
}
165164
},
166-
Some(DefKind::Struct)
167-
| Some(DefKind::Enum)
168-
| Some(DefKind::TyAlias)
169-
| Some(DefKind::Union)
170-
| Some(DefKind::OpaqueTy) => program_clauses_for_type_def(tcx, def_id),
165+
DefKind::Struct
166+
| DefKind::Enum
167+
| DefKind::TyAlias
168+
| DefKind::Union
169+
| DefKind::OpaqueTy => program_clauses_for_type_def(tcx, def_id),
171170
_ => List::empty(),
172171
},
173172
DefPathData::Impl => program_clauses_for_impl(tcx, def_id),

src/librustc_typeck/check/dropck.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,7 @@ fn ensure_drop_params_and_item_params_correspond<'tcx>(
9393
}
9494
Err(_) => {
9595
let item_span = tcx.def_span(self_type_did);
96-
let self_descr = tcx
97-
.def_kind(self_type_did)
98-
.map(|kind| kind.descr(self_type_did))
99-
.unwrap_or("type");
96+
let self_descr = tcx.def_kind(self_type_did).descr(self_type_did);
10097
struct_span_err!(
10198
tcx.sess,
10299
drop_impl_span,
@@ -243,8 +240,7 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>(
243240

244241
if !assumptions_in_impl_context.iter().any(predicate_matches_closure) {
245242
let item_span = tcx.hir().span(self_type_hir_id);
246-
let self_descr =
247-
tcx.def_kind(self_type_did).map(|kind| kind.descr(self_type_did)).unwrap_or("type");
243+
let self_descr = tcx.def_kind(self_type_did).descr(self_type_did);
248244
struct_span_err!(
249245
tcx.sess,
250246
*predicate_sp,

src/librustc_typeck/check/expr.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,10 +1563,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
15631563
base_did: DefId,
15641564
) {
15651565
let struct_path = self.tcx().def_path_str(base_did);
1566-
let kind_name = match self.tcx().def_kind(base_did) {
1567-
Some(def_kind) => def_kind.descr(base_did),
1568-
_ => " ",
1569-
};
1566+
let kind_name = self.tcx().def_kind(base_did).descr(base_did);
15701567
let mut err = struct_span_err!(
15711568
self.tcx().sess,
15721569
field.span,

src/librustc_typeck/check/mod.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -831,18 +831,22 @@ fn primary_body_of(
831831
}
832832

833833
fn has_typeck_tables(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
834+
// FIXME(#71104) some `LocalDefId` do not seem to have a corresponding `HirId`.
835+
if let Some(def_id) = def_id.as_local() {
836+
if tcx.hir().opt_local_def_id_to_hir_id(def_id).is_none() {
837+
return false;
838+
}
839+
}
840+
834841
// Closures' tables come from their outermost function,
835842
// as they are part of the same "inference environment".
836843
let outer_def_id = tcx.closure_base_def_id(def_id);
837844
if outer_def_id != def_id {
838845
return tcx.has_typeck_tables(outer_def_id);
839846
}
840847

841-
// FIXME(#71104) Should really be using just `as_local_hir_id` but
842-
// some `LocalDefId` do not seem to have a corresponding HirId.
843-
if let Some(id) =
844-
def_id.as_local().and_then(|def_id| tcx.hir().opt_local_def_id_to_hir_id(def_id))
845-
{
848+
if let Some(def_id) = def_id.as_local() {
849+
let id = tcx.hir().local_def_id_to_hir_id(def_id);
846850
primary_body_of(tcx, id).is_some()
847851
} else {
848852
false
@@ -4935,10 +4939,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
49354939
Some(Node::Ctor(hir::VariantData::Tuple(fields, _))) => {
49364940
sugg_call = fields.iter().map(|_| "_").collect::<Vec<_>>().join(", ");
49374941
match self.tcx.def_kind(def_id) {
4938-
Some(hir::def::DefKind::Ctor(hir::def::CtorOf::Variant, _)) => {
4942+
DefKind::Ctor(CtorOf::Variant, _) => {
49394943
msg = "instantiate this tuple variant";
49404944
}
4941-
Some(hir::def::DefKind::Ctor(hir::def::CtorOf::Struct, _)) => {
4945+
DefKind::Ctor(CtorOf::Struct, _) => {
49424946
msg = "instantiate this tuple struct";
49434947
}
49444948
_ => {}

src/librustdoc/clean/inline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ fn build_type_alias_type(cx: &DocContext<'_>, did: DefId) -> Option<clean::Type>
278278
}
279279

280280
pub fn build_ty(cx: &DocContext, did: DefId) -> Option<clean::Type> {
281-
match cx.tcx.def_kind(did)? {
281+
match cx.tcx.def_kind(did) {
282282
DefKind::Struct | DefKind::Union | DefKind::Enum | DefKind::Const | DefKind::Static => {
283283
Some(cx.tcx.type_of(did).clean(cx))
284284
}

0 commit comments

Comments
 (0)