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>;
}
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),
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) => {