X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_resolve%2Flate.rs;h=e02cba6fbfd25793bd10f509083daebbe0a08869;hb=7bc94cc3c2ccef8b4d393910bb978a6487db1202;hp=3ddaf2d94f9c82649e8b56b73c2de3b6b56f8f9c;hpb=e61813548a23c0d5ea5eb306734760b0d92f7f6c;p=rust.git diff --git a/src/librustc_resolve/late.rs b/src/librustc_resolve/late.rs index 3ddaf2d94f9..e02cba6fbfd 100644 --- a/src/librustc_resolve/late.rs +++ b/src/librustc_resolve/late.rs @@ -221,7 +221,7 @@ fn descr_expected(self) -> &'static str { ValueNS => "method or associated constant", MacroNS => bug!("associated macro"), }, - PathSource::Expr(parent) => match parent.map(|p| &p.node) { + PathSource::Expr(parent) => match parent.map(|p| &p.kind) { // "function" here means "anything callable" rather than `DefKind::Fn`, // this is not precise but usually more helpful than just "value". Some(&ExprKind::Call(..)) => "function", @@ -298,18 +298,18 @@ fn descr_expected(self) -> &'static str { } fn error_code(self, has_unexpected_resolution: bool) -> &'static str { - __diagnostic_used!(E0404); - __diagnostic_used!(E0405); - __diagnostic_used!(E0412); - __diagnostic_used!(E0422); - __diagnostic_used!(E0423); - __diagnostic_used!(E0425); - __diagnostic_used!(E0531); - __diagnostic_used!(E0532); - __diagnostic_used!(E0573); - __diagnostic_used!(E0574); - __diagnostic_used!(E0575); - __diagnostic_used!(E0576); + syntax::diagnostic_used!(E0404); + syntax::diagnostic_used!(E0405); + syntax::diagnostic_used!(E0412); + syntax::diagnostic_used!(E0422); + syntax::diagnostic_used!(E0423); + syntax::diagnostic_used!(E0425); + syntax::diagnostic_used!(E0531); + syntax::diagnostic_used!(E0532); + syntax::diagnostic_used!(E0573); + syntax::diagnostic_used!(E0574); + syntax::diagnostic_used!(E0575); + syntax::diagnostic_used!(E0576); match (self, has_unexpected_resolution) { (PathSource::Trait(_), true) => "E0404", (PathSource::Trait(_), false) => "E0405", @@ -384,7 +384,7 @@ fn visit_local(&mut self, local: &'tcx Local) { self.resolve_local(local); } fn visit_ty(&mut self, ty: &'tcx Ty) { - match ty.node { + match ty.kind { TyKind::Path(ref qself, ref path) => { self.smart_resolve_path(ty.id, qself.as_ref(), path, PathSource::Type); } @@ -700,9 +700,9 @@ fn future_proof_import(&mut self, use_tree: &UseTree) { fn resolve_item(&mut self, item: &Item) { let name = item.ident.name; - debug!("(resolving item) resolving {} ({:?})", name, item.node); + debug!("(resolving item) resolving {} ({:?})", name, item.kind); - match item.node { + match item.kind { ItemKind::TyAlias(_, ref generics) | ItemKind::OpaqueTy(_, ref generics) | ItemKind::Fn(_, _, ref generics, _) => { @@ -740,7 +740,7 @@ fn resolve_item(&mut self, item: &Item) { AssocItemRibKind, ); this.with_generic_param_rib(generic_params, |this| { - match trait_item.node { + match trait_item.kind { TraitItemKind::Const(ref ty, ref default) => { this.visit_ty(ty); @@ -938,7 +938,7 @@ fn with_trait_items( ) -> T { let trait_assoc_types = replace( &mut self.current_trait_assoc_types, - trait_items.iter().filter_map(|item| match &item.node { + trait_items.iter().filter_map(|item| match &item.kind { TraitItemKind::Type(bounds, _) if bounds.len() == 0 => Some(item.ident), _ => None, }).collect(), @@ -1035,7 +1035,7 @@ fn resolve_implementation(&mut self, AssocItemRibKind); this.with_generic_param_rib(generic_params, |this| { use crate::ResolutionError::*; - match impl_item.node { + match impl_item.kind { ImplItemKind::Const(..) => { debug!( "resolve_implementation ImplItemKind::Const", @@ -1146,7 +1146,7 @@ fn binding_mode_map(&mut self, pat: &Pat) -> BindingMap { let mut binding_map = FxHashMap::default(); pat.walk(&mut |pat| { - match pat.node { + match pat.kind { PatKind::Ident(binding_mode, ident, ref sub_pat) if sub_pat.is_some() || self.is_base_res_local(pat.id) => { @@ -1246,7 +1246,7 @@ fn check_consistent_bindings(&mut self, pats: &[P]) -> Vec { /// Check the consistency of the outermost or-patterns. fn check_consistent_bindings_top(&mut self, pat: &Pat) { - pat.walk(&mut |pat| match pat.node { + pat.walk(&mut |pat| match pat.kind { PatKind::Or(ref ps) => { self.check_consistent_bindings(ps); false @@ -1308,8 +1308,8 @@ fn resolve_pattern_inner( ) { // Visit all direct subpatterns of this pattern. pat.walk(&mut |pat| { - debug!("resolve_pattern pat={:?} node={:?}", pat, pat.node); - match pat.node { + debug!("resolve_pattern pat={:?} node={:?}", pat, pat.kind); + match pat.kind { PatKind::Ident(bmode, ident, ref sub) => { // First try to resolve the identifier as some existing entity, // then fall back to a fresh binding. @@ -1804,8 +1804,8 @@ fn resolve_block(&mut self, block: &Block) { // Descend into the block. for stmt in &block.stmts { - if let StmtKind::Item(ref item) = stmt.node { - if let ItemKind::MacroDef(..) = item.node { + if let StmtKind::Item(ref item) = stmt.kind { + if let ItemKind::MacroDef(..) = item.kind { num_macro_definition_ribs += 1; let res = self.r.definitions.local_def_id(item.id); self.ribs[ValueNS].push(Rib::new(MacroDefinition(res))); @@ -1836,7 +1836,7 @@ fn resolve_expr(&mut self, expr: &Expr, parent: Option<&Expr>) { self.record_candidate_traits_for_expr_if_necessary(expr); // Next, resolve the node. - match expr.node { + match expr.kind { ExprKind::Path(ref qself, ref path) => { self.smart_resolve_path(expr.id, qself.as_ref(), path, PathSource::Expr(parent)); visit::walk_expr(self, expr); @@ -1968,7 +1968,7 @@ fn resolve_expr(&mut self, expr: &Expr, parent: Option<&Expr>) { } fn record_candidate_traits_for_expr_if_necessary(&mut self, expr: &Expr) { - match expr.node { + match expr.kind { ExprKind::Field(_, ident) => { // FIXME(#6890): Even though you can't treat a method like a // field, we need to add any trait methods we find that match