use syntax::ast;
use syntax_pos::Span;
+use rustc_error_codes::*;
+
/// On-demand query: yields a map containing all types mapped to their inherent impls.
pub fn crate_inherent_impls(
tcx: TyCtxt<'_>,
impl ItemLikeVisitor<'v> for InherentCollect<'tcx> {
fn visit_item(&mut self, item: &hir::Item) {
- let ty = match item.node {
+ let ty = match item.kind {
hir::ItemKind::Impl(.., None, ref ty, _) => ty,
_ => return
};
let def_id = self.tcx.hir().local_def_id(item.hir_id);
let self_ty = self.tcx.type_of(def_id);
let lang_items = self.tcx.lang_items();
- match self_ty.sty {
+ match self_ty.kind {
ty::Adt(def, _) => {
self.check_def_id(item, def.did);
}
"[T]",
item.span);
}
- ty::RawPtr(ty::TypeAndMut { ty: _, mutbl: hir::MutImmutable }) => {
+ ty::RawPtr(ty::TypeAndMut { ty: _, mutbl: hir::Mutability::Immutable }) => {
self.check_primitive_impl(def_id,
lang_items.const_ptr_impl(),
None,
"*const T",
item.span);
}
- ty::RawPtr(ty::TypeAndMut { ty: _, mutbl: hir::MutMutable }) => {
+ ty::RawPtr(ty::TypeAndMut { ty: _, mutbl: hir::Mutability::Mutable }) => {
self.check_primitive_impl(def_id,
lang_items.mut_ptr_impl(),
None,