diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index 8661af6d7a1..ef2389fcefa 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -485,7 +485,7 @@ fn build_reduced_graph_for_use_tree( module_path.push(Segment { ident: Ident { name: kw::PathRoot, span: source.ident.span }, id: Some(self.r.next_node_id()), - has_args: false, + has_generic_args: false, }); source.ident.name = crate_name; } diff --git a/src/librustc_resolve/late/diagnostics.rs b/src/librustc_resolve/late/diagnostics.rs index 694e2ac2a36..a6e016e9e6a 100644 --- a/src/librustc_resolve/late/diagnostics.rs +++ b/src/librustc_resolve/late/diagnostics.rs @@ -920,7 +920,9 @@ fn collect_enum_variants(&mut self, def_id: DefId) -> Option> { path: &[Segment], ) -> Option<(Span, &'static str, String, Applicability)> { let (ident, span) = match path { - [segment] if !segment.has_args => (segment.ident.to_string(), segment.ident.span), + [segment] if !segment.has_generic_args => { + (segment.ident.to_string(), segment.ident.span) + } _ => return None, }; let mut iter = ident.chars().map(|c| c.is_uppercase()); diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index f7ec919fa04..a30e5cc1ab6 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -233,7 +233,7 @@ pub struct Segment { id: Option, /// Signals whether this `PathSegment` has generic arguments. Used to avoid providing /// nonsensical suggestions. - has_args: bool, + has_generic_args: bool, } impl Segment { @@ -242,7 +242,7 @@ fn from_path(path: &Path) -> Vec { } fn from_ident(ident: Ident) -> Segment { - Segment { ident, id: None, has_args: false } + Segment { ident, id: None, has_generic_args: false } } fn names_to_string(segments: &[Segment]) -> String { @@ -252,7 +252,7 @@ fn names_to_string(segments: &[Segment]) -> String { impl<'a> From<&'a ast::PathSegment> for Segment { fn from(seg: &'a ast::PathSegment) -> Segment { - Segment { ident: seg.ident, id: Some(seg.id), has_args: seg.args.is_some() } + Segment { ident: seg.ident, id: Some(seg.id), has_generic_args: seg.args.is_some() } } } @@ -2019,7 +2019,7 @@ fn resolve_path_with_ribs( path, opt_ns, record_used, path_span, crate_lint, ); - for (i, &Segment { ident, id, has_args: _ }) in path.iter().enumerate() { + for (i, &Segment { ident, id, has_generic_args: _ }) in path.iter().enumerate() { debug!("resolve_path ident {} {:?} {:?}", i, ident, id); let record_segment_res = |this: &mut Self, res| { if record_used {