|
5 | 5 | // done by the orphan and overlap modules. Then we build up various
|
6 | 6 | // mappings. That mapping code resides here.
|
7 | 7 |
|
| 8 | +use crate::hir::HirId; |
8 | 9 | use crate::hir::def_id::{DefId, LOCAL_CRATE};
|
9 | 10 | use rustc::traits;
|
10 | 11 | use rustc::ty::{self, TyCtxt, TypeFoldable};
|
11 | 12 | use rustc::ty::query::Providers;
|
12 | 13 | use rustc::util::common::time;
|
13 | 14 |
|
14 |
| -use syntax::ast; |
15 |
| - |
16 | 15 | mod builtin;
|
17 | 16 | mod inherent_impls;
|
18 | 17 | mod inherent_impls_overlap;
|
19 | 18 | mod orphan;
|
20 | 19 | mod unsafety;
|
21 | 20 |
|
22 |
| -fn check_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, node_id: ast::NodeId) { |
23 |
| - let impl_def_id = tcx.hir().local_def_id(node_id); |
| 21 | +fn check_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, hir_id: HirId) { |
| 22 | + let impl_def_id = tcx.hir().local_def_id_from_hir_id(hir_id); |
24 | 23 |
|
25 | 24 | // If there are no traits, then this implementation must have a
|
26 | 25 | // base type.
|
@@ -160,8 +159,8 @@ pub fn check_coherence<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
|
160 | 159 | /// Overlap: no two impls for the same trait are implemented for the
|
161 | 160 | /// same type. Likewise, no two inherent impls for a given type
|
162 | 161 | /// constructor provide a method with the same name.
|
163 |
| -fn check_impl_overlap<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, node_id: ast::NodeId) { |
164 |
| - let impl_def_id = tcx.hir().local_def_id(node_id); |
| 162 | +fn check_impl_overlap<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, hir_id: HirId) { |
| 163 | + let impl_def_id = tcx.hir().local_def_id_from_hir_id(hir_id); |
165 | 164 | let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap();
|
166 | 165 | let trait_def_id = trait_ref.def_id;
|
167 | 166 |
|
|
0 commit comments