]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_resolve/late.rs
Do not ICE on multipart suggestions touching multiple files
[rust.git] / src / librustc_resolve / late.rs
index 29a1be6bb7461e72edb315686530e28a51f12d12..5e08ac8e2c38a869724132bb5d89667b38255605 100644 (file)
 use crate::{Module, ModuleOrUniformRoot, NameBindingKind, ParentScope, PathResult};
 use crate::{ResolutionError, Resolver, Segment, UseError};
 
-use errors::DiagnosticId;
-use log::debug;
 use rustc::{bug, lint, span_bug};
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use rustc_errors::DiagnosticId;
 use rustc_hir::def::Namespace::{self, *};
 use rustc_hir::def::{self, CtorKind, DefKind, PartialRes, PerNS};
 use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX};
 use syntax::visit::{self, FnKind, Visitor};
 use syntax::{unwrap_or, walk_list};
 
+use log::debug;
 use std::collections::BTreeSet;
 use std::mem::replace;
 
-use rustc_error_codes::*;
-
 mod diagnostics;
 
 type Res = def::Res<NodeId>;
@@ -306,7 +304,7 @@ fn descr_expected(self) -> &'static str {
     }
 
     fn error_code(self, has_unexpected_resolution: bool) -> DiagnosticId {
-        use errors::error_code;
+        use rustc_errors::error_code;
         match (self, has_unexpected_resolution) {
             (PathSource::Trait(_), true) => error_code!(E0404),
             (PathSource::Trait(_), false) => error_code!(E0405),
@@ -797,14 +795,14 @@ fn resolve_item(&mut self, item: &Item) {
                 self.resolve_adt(item, generics);
             }
 
-            ItemKind::Impl(.., ref generics, ref opt_trait_ref, ref self_type, ref impl_items) => {
-                self.resolve_implementation(
-                    generics,
-                    opt_trait_ref,
-                    &self_type,
-                    item.id,
-                    impl_items,
-                )
+            ItemKind::Impl {
+                ref generics,
+                ref of_trait,
+                ref self_ty,
+                items: ref impl_items,
+                ..
+            } => {
+                self.resolve_implementation(generics, of_trait, &self_ty, item.id, impl_items);
             }
 
             ItemKind::Trait(.., ref generics, ref bounds, ref trait_items) => {