aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/path/lower
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-02-04 21:42:57 +0000
committerGitHub <[email protected]>2021-02-04 21:42:57 +0000
commit842033b15055eba9aabfc730468cd076a30a5f29 (patch)
tree08bbf19e5bc90699c00d1a8cae709d7f6e0e13ac /crates/hir_def/src/path/lower
parentde046bf4572a75cf534a2342358a422b2f18d01c (diff)
parent474df093a9d91e2995e34608b577bff2b28f1e04 (diff)
Merge #7561
7561: Avoid using ModPath's fields directly r=jonas-schievink a=jonas-schievink bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def/src/path/lower')
-rw-r--r--crates/hir_def/src/path/lower/lower_use.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/hir_def/src/path/lower/lower_use.rs b/crates/hir_def/src/path/lower/lower_use.rs
index ba0d1f0e7..d584b0b70 100644
--- a/crates/hir_def/src/path/lower/lower_use.rs
+++ b/crates/hir_def/src/path/lower/lower_use.rs
@@ -75,9 +75,10 @@ fn convert_path(prefix: Option<ModPath>, path: ast::Path, hygiene: &Hygiene) ->
75 match hygiene.name_ref_to_name(name_ref) { 75 match hygiene.name_ref_to_name(name_ref) {
76 Either::Left(name) => { 76 Either::Left(name) => {
77 // no type args in use 77 // no type args in use
78 let mut res = prefix.unwrap_or_else(|| ModPath { 78 let mut res = prefix.unwrap_or_else(|| {
79 kind: segment.coloncolon_token().map_or(PathKind::Plain, |_| PathKind::Abs), 79 ModPath::from_kind(
80 segments: Vec::with_capacity(1), 80 segment.coloncolon_token().map_or(PathKind::Plain, |_| PathKind::Abs),
81 )
81 }); 82 });
82 res.segments.push(name); 83 res.segments.push(name);
83 res 84 res