use rustc_hir::def_id::{DefId, DefPathHash, LocalDefId, CRATE_DEF_ID};
use rustc_hir::definitions::{DefKey, DefPathData, Definitions};
use rustc_hir::intravisit;
-use rustc_hir::{ConstArg, GenericArg, InferKind, ParamName};
+use rustc_hir::{ConstArg, GenericArg, ParamName};
use rustc_index::vec::{Idx, IndexVec};
use rustc_query_system::ich::StableHashingContext;
use rustc_session::lint::builtin::BARE_TRAIT_OBJECTS;
return GenericArg::Infer(hir::InferArg {
hir_id: self.lower_node_id(ty.id),
span: self.lower_span(ty.span),
- kind: InferKind::Type,
});
}
// We parse const arguments as path types as we cannot distinguish them during
pub span: Span,
}
-#[derive(Copy, Clone, Encodable, Debug, HashStable_Generic)]
-pub enum InferKind {
- Const,
- Type,
-}
-
-impl InferKind {
- #[inline]
- pub fn is_type(self) -> bool {
- matches!(self, InferKind::Type)
- }
-}
-
#[derive(Encodable, Debug, HashStable_Generic)]
pub struct InferArg {
pub hir_id: HirId,
- pub kind: InferKind,
pub span: Span,
}
GenericParamDefKind::Type { object_lifetime_default, .. } => {
Some(object_lifetime_default)
}
- GenericParamDefKind::Lifetime
- | GenericParamDefKind::Const { .. } => None,
+ GenericParamDefKind::Const { .. } => Some(Set1::Empty),
+ GenericParamDefKind::Lifetime => None,
})
.collect()
})
}
GenericArg::Const(ct) => {
self.visit_anon_const(&ct.value);
+ i += 1;
}
GenericArg::Infer(inf) => {
self.visit_id(inf.hir_id);
- if inf.kind.is_type() {
- i += 1;
- }
+ i += 1;
}
}
}