mod unsafety;
fn check_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, node_id: ast::NodeId) {
- let impl_def_id = tcx.hir.local_def_id(node_id);
+ let impl_def_id = tcx.hir().local_def_id(node_id);
// If there are no traits, then this implementation must have a
// base type.
tcx.item_path_str(impl_def_id));
// Skip impls where one of the self type is an error type.
- // This occurs with e.g. resolve failures (#30589).
+ // This occurs with e.g., resolve failures (#30589).
if trait_ref.references_error() {
return;
}
}
fn coherent_trait<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) {
- let impls = tcx.hir.trait_impls(def_id);
+ let impls = tcx.hir().trait_impls(def_id);
for &impl_id in impls {
check_impl(tcx, impl_id);
}
}
pub fn check_coherence<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
- for &trait_def_id in tcx.hir.krate().trait_impls.keys() {
+ for &trait_def_id in tcx.hir().krate().trait_impls.keys() {
ty::query::queries::coherent_trait::ensure(tcx, trait_def_id);
}
/// same type. Likewise, no two inherent impls for a given type
/// constructor provide a method with the same name.
fn check_impl_overlap<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, node_id: ast::NodeId) {
- let impl_def_id = tcx.hir.local_def_id(node_id);
+ let impl_def_id = tcx.hir().local_def_id(node_id);
let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap();
let trait_def_id = trait_ref.def_id;