1
Fork 0

Change DefKind::Static to a struct variant

This commit is contained in:
Oli Scherer 2024-02-23 23:12:20 +00:00
parent 12e2846514
commit 9816915954
47 changed files with 90 additions and 86 deletions

View file

@ -134,7 +134,7 @@ fn assumed_wf_types<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &'tcx [(Ty<'
| DefKind::TyParam
| DefKind::Const
| DefKind::ConstParam
| DefKind::Static(_)
| DefKind::Static { .. }
| DefKind::Ctor(_, _)
| DefKind::Macro(_)
| DefKind::ExternCrate

View file

@ -318,7 +318,7 @@ fn opaque_types_defined_by<'tcx>(
match kind {
DefKind::AssocFn
| DefKind::Fn
| DefKind::Static(_)
| DefKind::Static { .. }
| DefKind::Const
| DefKind::AssocConst
| DefKind::AnonConst => {

View file

@ -43,7 +43,7 @@ pub fn walk_types<'tcx, V: SpannedTypeVisitor<'tcx>>(
// Walk over the type behind the alias
DefKind::TyAlias {..} | DefKind::AssocTy |
// Walk over the type of the item
DefKind::Static(_) | DefKind::Const | DefKind::AssocConst | DefKind::AnonConst => {
DefKind::Static{..} | DefKind::Const | DefKind::AssocConst | DefKind::AnonConst => {
if let Some(ty) = tcx.hir_node_by_def_id(item).ty() {
// If the type of the item uses `_`, we're gonna error out anyway, but
// typeck (which type_of invokes below), will call back into opaque_types_defined_by