]> git.lizzy.rs Git - rust.git/commitdiff
pass down a Ident
authorDouglas Campos <qmx@qmx.me>
Fri, 10 Aug 2018 13:48:36 +0000 (13:48 +0000)
committerDouglas Campos <qmx@qmx.me>
Thu, 16 Aug 2018 19:21:33 +0000 (19:21 +0000)
src/librustc_resolve/lib.rs

index a1338710b6b4bddc8169ee9356a44b89e01532af..29c76009610a3e9e2773c183b6725609fee25d08 100644 (file)
@@ -4241,7 +4241,7 @@ fn lookup_import_candidates_from_module<FilterFn>(&mut self,
                                           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 @@ fn lookup_import_candidates_from_module<FilterFn>(&mut self,
                         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));