about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDouglas Campos <qmx@qmx.me>2018-08-10 13:48:36 +0000
committerDouglas Campos <qmx@qmx.me>2018-08-16 19:21:33 +0000
commit963c8bd1237e17f71dc6a0d4da8400a7808d47cb (patch)
tree8cb2c1464c68caa14ee39782fae68cd4f6e96841
parent2fcabf2dd7fb71617d9af078cc64245fc790823f (diff)
downloadrust-963c8bd1237e17f71dc6a0d4da8400a7808d47cb.tar.gz
rust-963c8bd1237e17f71dc6a0d4da8400a7808d47cb.zip
pass down a Ident
-rw-r--r--src/librustc_resolve/lib.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs
index a1338710b6b..29c76009610 100644
--- a/src/librustc_resolve/lib.rs
+++ b/src/librustc_resolve/lib.rs
@@ -4241,7 +4241,7 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
                                           lookup_name: Name,
                                           namespace: Namespace,
                                           start_module: &'a ModuleData<'a>,
-                                          name: Name,
+                                          crate_name: Ident,
                                           filter_fn: FilterFn)
                                           -> Vec<ImportSuggestion>
         where FilterFn: Fn(Def) -> bool
@@ -4272,11 +4272,10 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
                         if self.session.rust_2018() && !in_module_is_extern {
                             // crate-local absolute paths start with `crate::` in edition 2018
                             // FIXME: may also be stabilized for Rust 2015 (Issues #45477, #44660)
-                            if name == keywords::Crate.name() {
-                                segms.insert(
-                                    0, ast::PathSegment::from_ident(keywords::Crate.ident())
-                                );
-                            }
+
+                            segms.insert(
+                                0, ast::PathSegment::from_ident(crate_name)
+                            );
                         }
 
                         segms.push(ast::PathSegment::from_ident(ident));