Repository: rust-analyzer/rust-analyzer
Pull request #132 (2018-10-15 18:02:09)

Cache caro on Travis


Patch:
diff --git a/.travis.yml b/.travis.yml
index 33dc7803ed..bca3e57bcc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,9 @@
+cache: cargo
+
 matrix:
   include:
     - language: rust
-      rust: beta
+      rust: stable
       script:
         - cargo gen-kinds --verify
         - cargo gen-tests --verify
diff --git a/README.md b/README.md
index c3056bcfd0..1c6facbbd5 100644
--- a/README.md
+++ b/README.md
@@ -16,8 +16,7 @@ functionality is provided via a language server.
 
 ## Quick Start
 
-Rust analyzer builds on Rust >= 1.30.0 (currently in beta) and uses
-the 2018 edition.
+Rust analyzer builds on stable Rust >= 1.29.0.
 
 ```
 # run tests
diff --git a/appveyor.yml b/appveyor.yml
index a32a1e7b8a..a6ba3b0e15 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -2,7 +2,7 @@ os: Visual Studio 2015
 
 install:
   - curl https://win.rustup.rs/ --output rustup-init.exe
-  - rustup-init -yv --default-toolchain beta --default-host x86_64-pc-windows-msvc
+  - rustup-init -yv --default-toolchain stable --default-host x86_64-pc-windows-msvc
   - set PATH=%PATH%;%USERPROFILE%\.cargo\bin
   - rustc -vV
   - cargo -vV
diff --git a/crates/ra_analysis/Cargo.toml b/crates/ra_analysis/Cargo.toml
index 28d95c5813..a82e1761c2 100644
--- a/crates/ra_analysis/Cargo.toml
+++ b/crates/ra_analysis/Cargo.toml
@@ -1,5 +1,4 @@
 [package]
-edition = "2018"
 name = "ra_analysis"
 version = "0.1.0"
 authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
diff --git a/crates/ra_analysis/src/db/imp.rs b/crates/ra_analysis/src/db/imp.rs
index 7669b61845..36f6cf2907 100644
--- a/crates/ra_analysis/src/db/imp.rs
+++ b/crates/ra_analysis/src/db/imp.rs
@@ -7,7 +7,7 @@ use std::{
 };
 use rustc_hash::FxHashMap;
 use salsa;
-use crate::{FileId, imp::FileResolverImp};
+use {FileId, imp::FileResolverImp};
 use super::{State, Query, QueryCtx};
 
 pub(super) type Data = Arc<Any + Send + Sync + 'static>;
@@ -51,7 +51,7 @@ pub(crate) trait EvalQuery {
     type Output;
     fn query_type(&self) -> salsa::QueryTypeId;
     fn f(&self) -> salsa::QueryFn<State, Data>;
-    fn get(&self, ctx: &QueryCtx, params: Self::Params) -> Arc<Self::Output>;
+    fn get(&self, &QueryCtx, Self::Params) -> Arc<Self::Output>;
 }
 
 impl<T, R> EvalQuery for Query<T, R>
diff --git a/crates/ra_analysis/src/db/mod.rs b/crates/ra_analysis/src/db/mod.rs
index 4eb7d922d9..22769d1120 100644
--- a/crates/ra_analysis/src/db/mod.rs
+++ b/crates/ra_analysis/src/db/mod.rs
@@ -5,7 +5,7 @@ use std::{
 };
 use im;
 use salsa;
-use crate::{FileId, imp::FileResolverImp};
+use {FileId, imp::FileResolverImp};
 
 #[derive(Debug, Default, Clone)]
 pub(crate) struct State {
@@ -75,8 +75,8 @@ pub(crate) fn file_set(ctx: QueryCtx) -> Arc<(Vec<FileId>, FileResolverImp)> {
 impl QueryRegistry {
     fn new() -> QueryRegistry {
         let mut reg = QueryRegistry { imp: imp::QueryRegistry::new() };
-        crate::queries::register_queries(&mut reg);
-        crate::module_map::register_queries(&mut reg);
+        ::queries::register_queries(&mut reg);
+        ::module_map::register_queries(&mut reg);
         reg
     }
     pub(crate) fn add<Q: imp::EvalQuery>(&mut self, q: Q, name: &'static str) {
diff --git a/crates/ra_analysis/src/descriptors.rs b/crates/ra_analysis/src/descriptors.rs
index f26dac8753..faf945a41f 100644
--- a/crates/ra_analysis/src/descriptors.rs
+++ b/crates/ra_analysis/src/descriptors.rs
@@ -7,7 +7,7 @@ use ra_syntax::{
     ast::{self, NameOwner, AstNode},
     text_utils::is_subrange
 };
-use crate::{
+use {
     FileId,
     imp::FileResolverImp,
 };
@@ -271,4 +271,4 @@ impl FnDescriptor {
         }
         res
     }
-}
+}
\ No newline at end of file
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs
index 26f5e175b7..aad54b9771 100644
--- a/crates/ra_analysis/src/imp.rs
+++ b/crates/ra_analysis/src/imp.rs
@@ -17,7 +17,7 @@ use ra_syntax::{
     ast::{self, NameOwner, ArgListOwner, Expr},
 };
 
-use crate::{
+use {
     FileId, FileResolver, Query, Diagnostic, SourceChange, SourceFileEdit, Position, FileSystemEdit,
     JobToken, CrateGraph, CrateId,
     roots::{SourceRoot, ReadonlySourceRoot, WritableSourceRoot},
@@ -458,4 +458,4 @@ impl<'a> FnCallNode<'a> {
             FnCallNode::MethodCallExpr(expr) => expr.arg_list()
         }
     }
-}
+}
\ No newline at end of file
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs
index 86c66236ce..1aca72ae00 100644
--- a/crates/ra_analysis/src/lib.rs
+++ b/crates/ra_analysis/src/lib.rs
@@ -29,18 +29,16 @@ use std::{
 
 use relative_path::{RelativePath, RelativePathBuf};
 use ra_syntax::{File, TextRange, TextUnit, AtomEdit};
+use imp::{AnalysisImpl, AnalysisHostImpl, FileResolverImp};
 use rustc_hash::FxHashMap;
-use crate::imp::{AnalysisImpl, AnalysisHostImpl, FileResolverImp};
 
 pub use ra_editor::{
     StructureNode, LineIndex, FileSymbol,
     Runnable, RunnableKind, HighlightedRange, CompletionItem,
     Fold, FoldKind
 };
-pub use crate::{
-    job::{JobToken, JobHandle},
-    descriptors::FnDescriptor,
-};
+pub use job::{JobToken, JobHandle};
+pub use descriptors::FnDescriptor;
 
 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
 pub struct FileId(pub u32);
diff --git a/crates/ra_analysis/src/module_map.rs b/crates/ra_analysis/src/module_map.rs
index c77c5cec61..a21f55fff1 100644
--- a/crates/ra_analysis/src/module_map.rs
+++ b/crates/ra_analysis/src/module_map.rs
@@ -1,5 +1,5 @@
 use std::sync::Arc;
-use crate::{
+use {
     FileId,
     db::{
         Query, QueryRegistry, QueryCtx,
@@ -38,7 +38,7 @@ mod tests {
     use std::collections::HashMap;
     use im;
     use relative_path::{RelativePath, RelativePathBuf};
-    use crate::{
+    use {
         db::{Db},
         imp::FileResolverImp,
         FileId, FileResolver,
diff --git a/crates/ra_analysis/src/queries.rs b/crates/ra_analysis/src/queries.rs
index 613bf1e610..062a2f4203 100644
--- a/crates/ra_analysis/src/queries.rs
+++ b/crates/ra_analysis/src/queries.rs
@@ -1,13 +1,13 @@
 use std::sync::Arc;
 use ra_syntax::File;
 use ra_editor::LineIndex;
-use crate::{
+use {
     FileId,
     db::{Query, QueryCtx, QueryRegistry},
     symbol_index::SymbolIndex,
 };
 
-pub(crate) use crate::db::{file_text, file_set};
+pub(crate) use db::{file_text, file_set};
 
 pub(crate) fn file_syntax(ctx: QueryCtx, file_id: FileId) -> File {
     (&*ctx.get(FILE_SYNTAX, file_id)).clone()
diff --git a/crates/ra_analysis/src/roots.rs b/crates/ra_analysis/src/roots.rs
index 208acc4c22..32a8c5bd05 100644
--- a/crates/ra_analysis/src/roots.rs
+++ b/crates/ra_analysis/src/roots.rs
@@ -9,7 +9,7 @@ use rustc_hash::FxHashMap;
 use ra_editor::LineIndex;
 use ra_syntax::File;
 
-use crate::{
+use {
     FileId,
     imp::FileResolverImp,
     symbol_index::SymbolIndex,
@@ -62,23 +62,23 @@ impl WritableSourceRoot {
 
 impl SourceRoot for WritableSourceRoot {
     fn module_tree(&self) -> Arc<ModuleTreeDescriptor> {
-        self.db.make_query(crate::module_map::module_tree)
+        self.db.make_query(::module_map::module_tree)
     }
 
     fn contains(&self, file_id: FileId) -> bool {
         self.db.state().file_map.contains_key(&file_id)
     }
     fn lines(&self, file_id: FileId) -> Arc<LineIndex> {
-        self.db.make_query(|ctx| crate::queries::file_lines(ctx, file_id))
+        self.db.make_query(|ctx| ::queries::file_lines(ctx, file_id))
     }
     fn syntax(&self, file_id: FileId) -> File {
-        self.db.make_query(|ctx| crate::queries::file_syntax(ctx, file_id))
+        self.db.make_query(|ctx| ::queries::file_syntax(ctx, file_id))
     }
     fn symbols<'a>(&'a self, acc: &mut Vec<Arc<SymbolIndex>>) {
         self.db.make_query(|ctx| {
-            let file_set = crate::queries::file_set(ctx);
+            let file_set = ::queries::file_set(ctx);
             let syms = file_set.0.iter()
-                .map(|file_id| crate::queries::file_symbols(ctx, *file_id));
+                .map(|file_id| ::queries::file_symbols(ctx, *file_id));
             acc.extend(syms);
         });
     }
diff --git a/crates/ra_analysis/src/symbol_index.rs b/crates/ra_analysis/src/symbol_index.rs
index e5d83d365c..ffbb6a29fd 100644
--- a/crates/ra_analysis/src/symbol_index.rs
+++ b/crates/ra_analysis/src/symbol_index.rs
@@ -9,7 +9,7 @@ use ra_syntax::{
 };
 use fst::{self, Streamer};
 use rayon::prelude::*;
-use crate::{Query, FileId, JobToken};
+use {Query, FileId, JobToken};
 
 #[derive(Debug)]
 pub(crate) struct SymbolIndex {
diff --git a/crates/ra_cli/Cargo.toml b/crates/ra_cli/Cargo.toml
index 0b8d6f3dd8..5e7bf3ed45 100644
--- a/crates/ra_cli/Cargo.toml
+++ b/crates/ra_cli/Cargo.toml
@@ -1,5 +1,4 @@
 [package]
-edition = "2018"
 name = "ra_cli"
 version = "0.1.0"
 authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
diff --git a/crates/ra_editor/Cargo.toml b/crates/ra_editor/Cargo.toml
index 7791da1562..91cefc8d76 100644
--- a/crates/ra_editor/Cargo.toml
+++ b/crates/ra_editor/Cargo.toml
@@ -1,5 +1,4 @@
 [package]
-edition = "2018"
 name = "ra_editor"
 version = "0.1.0"
 authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
diff --git a/crates/ra_editor/src/code_actions.rs b/crates/ra_editor/src/code_actions.rs
index 7b0a48c81a..216d592ff4 100644
--- a/crates/ra_editor/src/code_actions.rs
+++ b/crates/ra_editor/src/code_actions.rs
@@ -11,7 +11,7 @@ use ra_syntax::{
     },
 };
 
-use crate::{EditBuilder, Edit, find_node_at_offset};
+use {EditBuilder, Edit, find_node_at_offset};
 
 #[derive(Debug)]
 pub struct LocalEdit {
@@ -136,7 +136,7 @@ fn non_trivia_sibling(node: SyntaxNodeRef, direction: Direction) -> Option<Synta
 #[cfg(test)]
 mod tests {
     use super::*;
-    use crate::test_utils::{check_action, check_action_range};
+    use test_utils::{check_action, check_action_range};
 
     #[test]
     fn test_swap_comma() {
diff --git a/crates/ra_editor/src/completion.rs b/crates/ra_editor/src/completion.rs
index b6095dca9c..20b8484b33 100644
--- a/crates/ra_editor/src/completion.rs
+++ b/crates/ra_editor/src/completion.rs
@@ -9,7 +9,7 @@ use ra_syntax::{
     text_utils::is_subrange,
 };
 
-use crate::{
+use {
     AtomEdit, find_node_at_offset,
     scope::{FnScopes, ModuleScope},
 };
diff --git a/crates/ra_editor/src/edit.rs b/crates/ra_editor/src/edit.rs
index 46e6873197..2839ac20a0 100644
--- a/crates/ra_editor/src/edit.rs
+++ b/crates/ra_editor/src/edit.rs
@@ -1,4 +1,4 @@
-use crate::{TextRange, TextUnit};
+use {TextRange, TextUnit};
 use ra_syntax::{
     AtomEdit,
     text_utils::contains_offset_nonstrict,
diff --git a/crates/ra_editor/src/lib.rs b/crates/ra_editor/src/lib.rs
index bd61fd1914..710afc65d5 100644
--- a/crates/ra_editor/src/lib.rs
+++ b/crates/ra_editor/src/lib.rs
@@ -164,7 +164,7 @@ pub fn resolve_local_name(file: &File, offset: TextUnit, name_ref: ast::NameRef)
 #[cfg(test)]
 mod tests {
     use super::*;
-    use crate::test_utils::{assert_eq_dbg, extract_offset, add_cursor};
+    use test_utils::{assert_eq_dbg, extract_offset, add_cursor};
 
     #[test]
     fn test_highlighting() {
diff --git a/crates/ra_editor/src/line_index.rs b/crates/ra_editor/src/line_index.rs
index 6ccfdbd83a..9cd8da3a89 100644
--- a/crates/ra_editor/src/line_index.rs
+++ b/crates/ra_editor/src/line_index.rs
@@ -1,5 +1,5 @@
 use superslice::Ext;
-use crate::TextUnit;
+use ::TextUnit;
 
 #[derive(Clone, Debug, Hash)]
 pub struct LineIndex {
diff --git a/crates/ra_editor/src/scope/fn_scope.rs b/crates/ra_editor/src/scope/fn_scope.rs
index 99d698b607..9a48bda020 100644
--- a/crates/ra_editor/src/scope/fn_scope.rs
+++ b/crates/ra_editor/src/scope/fn_scope.rs
@@ -174,7 +174,7 @@ fn compute_expr_scopes(expr: ast::Expr, scopes: &mut FnScopes, scope: ScopeId) {
             }
         }
         ast::Expr::LambdaExpr(e) => {
-            let scope = scopes.new_scope(scope);
+            let mut scope = scopes.new_scope(scope);
             scopes.add_params_bindings(scope, e.param_list());
             if let Some(body) = e.body() {
                 scopes.set_scope(body.syntax(), scope);
@@ -256,7 +256,7 @@ pub fn resolve_local_name<'a>(name_ref: ast::NameRef, scopes: &'a FnScopes) -> O
 mod tests {
     use super::*;
     use ra_syntax::File;
-    use crate::{find_node_at_offset, test_utils::extract_offset};
+    use {find_node_at_offset, test_utils::extract_offset};
 
     fn do_check(code: &str, expected: &[&str]) {
         let (off, code) = extract_offset(code);
diff --git a/crates/ra_editor/src/symbols.rs b/crates/ra_editor/src/symbols.rs
index 6211ed5477..e5cc5ca284 100644
--- a/crates/ra_editor/src/symbols.rs
+++ b/crates/ra_editor/src/symbols.rs
@@ -6,7 +6,7 @@ use ra_syntax::{
         walk::{walk, WalkEvent},
     },
 };
-use crate::TextRange;
+use TextRange;
 
 #[derive(Debug, Clone)]
 pub struct StructureNode {
diff --git a/crates/ra_editor/src/typing.rs b/crates/ra_editor/src/typing.rs
index 542b9e10bd..1dc658f9b0 100644
--- a/crates/ra_editor/src/typing.rs
+++ b/crates/ra_editor/src/typing.rs
@@ -10,7 +10,7 @@ use ra_syntax::{
     SyntaxKind::*,
 };
 
-use crate::{LocalEdit, EditBuilder, find_node_at_offset};
+use {LocalEdit, EditBuilder, find_node_at_offset};
 
 pub fn join_lines(file: &File, range: TextRange) -> LocalEdit {
     let range = if range.is_empty() {
@@ -244,7 +244,7 @@ fn compute_ws(left: SyntaxNodeRef, right: SyntaxNodeRef) -> &'static str {
 #[cfg(test)]
 mod tests {
     use super::*;
-    use crate::test_utils::{check_action, extract_range, extract_offset, add_cursor};
+    use test_utils::{check_action, extract_range, extract_offset, add_cursor};
 
     fn check_join_lines(before: &str, after: &str) {
         check_action(before, after, |file, offset| {
diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml
index 2b32571171..1fe6b2ebe6 100644
--- a/crates/ra_lsp_server/Cargo.toml
+++ b/crates/ra_lsp_server/Cargo.toml
@@ -1,5 +1,4 @@
 [package]
-edition = "2018"
 name = "ra_lsp_server"
 version = "0.1.0"
 authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs
index a75b160c53..08a6565693 100644
--- a/crates/ra_lsp_server/src/conv.rs
+++ b/crates/ra_lsp_server/src/conv.rs
@@ -7,7 +7,7 @@ use ra_editor::{LineIndex, LineCol, Edit, AtomEdit};
 use ra_syntax::{SyntaxKind, TextUnit, TextRange};
 use ra_analysis::{FileId, SourceChange, SourceFileEdit, FileSystemEdit};
 
-use crate::{
+use {
     Result,
     server_world::ServerWorld,
     req,
@@ -299,7 +299,7 @@ pub fn to_location(
         Ok(loc)
 }
 
-pub trait MapConvWith<'a>: Sized + 'a {
+pub trait MapConvWith<'a>: Sized {
     type Ctx;
     type Output;
 
@@ -309,7 +309,7 @@ pub trait MapConvWith<'a>: Sized + 'a {
 }
 
 impl<'a, I> MapConvWith<'a> for I
-    where I: Iterator + 'a,
+    where I: Iterator,
           I::Item: ConvWith
 {
     type Ctx = <I::Item as ConvWith>::Ctx;
diff --git a/crates/ra_lsp_server/src/lib.rs b/crates/ra_lsp_server/src/lib.rs
index 7224b14760..60652d55ee 100644
--- a/crates/ra_lsp_server/src/lib.rs
+++ b/crates/ra_lsp_server/src/lib.rs
@@ -34,7 +34,5 @@ mod project_model;
 pub mod thread_watcher;
 
 pub type Result<T> = ::std::result::Result<T, ::failure::Error>;
-pub use crate::{
-    main_loop::main_loop,
-    caps::server_capabilities,
-};
+pub use caps::server_capabilities;
+pub use main_loop::main_loop;
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index 1fe78f3d0f..f65e2a8890 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -13,7 +13,7 @@ use ra_syntax::{
     text_utils::contains_offset_nonstrict
 };
 
-use crate::{
+use ::{
     req::{self, Decoration}, Result,
     conv::{Conv, ConvWith, TryConvWith, MapConvWith, to_location},
     server_world::ServerWorld,
diff --git a/crates/ra_lsp_server/src/main_loop/mod.rs b/crates/ra_lsp_server/src/main_loop/mod.rs
index 773501efe7..f4e7cfc330 100644
--- a/crates/ra_lsp_server/src/main_loop/mod.rs
+++ b/crates/ra_lsp_server/src/main_loop/mod.rs
@@ -16,7 +16,7 @@ use gen_lsp_server::{
 };
 use rustc_hash::FxHashMap;
 
-use crate::{
+use {
     req,
     Result,
     vfs::{self, FileEvent},
diff --git a/crates/ra_lsp_server/src/project_model.rs b/crates/ra_lsp_server/src/project_model.rs
index c144d95960..43e4fd6542 100644
--- a/crates/ra_lsp_server/src/project_model.rs
+++ b/crates/ra_lsp_server/src/project_model.rs
@@ -5,7 +5,7 @@ use rustc_hash::{FxHashMap, FxHashSet};
 use cargo_metadata::{metadata_run, CargoOpt};
 use ra_syntax::SmolStr;
 
-use crate::{
+use {
     Result,
     thread_watcher::{Worker, ThreadWatcher},
 };
diff --git a/crates/ra_lsp_server/src/server_world.rs b/crates/ra_lsp_server/src/server_world.rs
index c931afa021..c4cdf83d47 100644
--- a/crates/ra_lsp_server/src/server_world.rs
+++ b/crates/ra_lsp_server/src/server_world.rs
@@ -8,7 +8,7 @@ use rustc_hash::FxHashMap;
 use languageserver_types::Url;
 use ra_analysis::{FileId, AnalysisHost, Analysis, CrateGraph, CrateId, LibraryData, FileResolver};
 
-use crate::{
+use {
     Result,
     path_map::{PathMap, Root},
     vfs::{FileEvent, FileEventKind},
diff --git a/crates/ra_lsp_server/src/thread_watcher.rs b/crates/ra_lsp_server/src/thread_watcher.rs
index 3257effcba..86a3a91e07 100644
--- a/crates/ra_lsp_server/src/thread_watcher.rs
+++ b/crates/ra_lsp_server/src/thread_watcher.rs
@@ -1,7 +1,7 @@
 use std::thread;
 use crossbeam_channel::{bounded, unbounded, Sender, Receiver};
 use drop_bomb::DropBomb;
-use crate::Result;
+use Result;
 
 pub struct Worker<I, O> {
     pub inp: Sender<I>,
diff --git a/crates/ra_lsp_server/src/vfs.rs b/crates/ra_lsp_server/src/vfs.rs
index d8f9b1aac9..a1c1783f20 100644
--- a/crates/ra_lsp_server/src/vfs.rs
+++ b/crates/ra_lsp_server/src/vfs.rs
@@ -5,7 +5,7 @@ use std::{
 
 use walkdir::WalkDir;
 
-use crate::{
+use {
     thread_watcher::{Worker, ThreadWatcher},
 };
 
diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml
index 34bb1c591b..6345e4725a 100644
--- a/crates/ra_syntax/Cargo.toml
+++ b/crates/ra_syntax/Cargo.toml
@@ -1,5 +1,4 @@
 [package]
-edition = "2018"
 name = "ra_syntax"
 version = "0.1.0"
 authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
diff --git a/crates/ra_syntax/src/algo/mod.rs b/crates/ra_syntax/src/algo/mod.rs
index e686a57044..a6678093d9 100644
--- a/crates/ra_syntax/src/algo/mod.rs
+++ b/crates/ra_syntax/src/algo/mod.rs
@@ -1,7 +1,7 @@
 pub mod walk;
 pub mod visit;
 
-use crate::{
+use {
     SyntaxNodeRef, TextUnit, TextRange,
     text_utils::{contains_offset_nonstrict, is_subrange},
 };
diff --git a/crates/ra_syntax/src/algo/visit.rs b/crates/ra_syntax/src/algo/visit.rs
index 1ae988a877..9f1c127c70 100644
--- a/crates/ra_syntax/src/algo/visit.rs
+++ b/crates/ra_syntax/src/algo/visit.rs
@@ -1,5 +1,5 @@
 use std::marker::PhantomData;
-use crate::{SyntaxNodeRef, AstNode};
+use {SyntaxNodeRef, AstNode};
 
 
 pub fn visitor<'a, T>() -> impl Visitor<'a, Output=T> {
diff --git a/crates/ra_syntax/src/algo/walk.rs b/crates/ra_syntax/src/algo/walk.rs
index d344156262..8e294d965b 100644
--- a/crates/ra_syntax/src/algo/walk.rs
+++ b/crates/ra_syntax/src/algo/walk.rs
@@ -1,4 +1,4 @@
-use crate::{
+use {
     SyntaxNodeRef,
     algo::generate,
 };
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs
index 160d186b8d..4db1bcbf93 100644
--- a/crates/ra_syntax/src/ast/generated.rs
+++ b/crates/ra_syntax/src/ast/generated.rs
@@ -1,7 +1,7 @@
 // This file is automatically generated based on the file `./generated.rs.tera` when `cargo gen-kinds` is run
 // Do not edit manually
 
-use crate::{
+use {
     ast,
     SyntaxNodeRef, AstNode,
     SyntaxKind::*,
diff --git a/crates/ra_syntax/src/ast/generated.rs.tera b/crates/ra_syntax/src/ast/generated.rs.tera
index 5cb7a35ed9..ffa9c41346 100644
--- a/crates/ra_syntax/src/ast/generated.rs.tera
+++ b/crates/ra_syntax/src/ast/generated.rs.tera
@@ -3,7 +3,7 @@ the below applies to the result of this template
 #}// This file is automatically generated based on the file `./generated.rs.tera` when `cargo gen-kinds` is run
 // Do not edit manually
 
-use crate::{
+use {
     ast,
     SyntaxNodeRef, AstNode,
     SyntaxKind::*,
diff --git a/crates/ra_syntax/src/ast/mod.rs b/crates/ra_syntax/src/ast/mod.rs
index 88193a1ede..12ddc02100 100644
--- a/crates/ra_syntax/src/ast/mod.rs
+++ b/crates/ra_syntax/src/ast/mod.rs
@@ -4,7 +4,7 @@ use std::marker::PhantomData;
 
 use itertools::Itertools;
 
-use crate::{
+use {
     SmolStr, SyntaxNodeRef, SyntaxKind::*,
     yellow::{RefRoot, SyntaxNodeChildren},
 };
diff --git a/crates/ra_syntax/src/grammar/expressions/atom.rs b/crates/ra_syntax/src/grammar/expressions/atom.rs
index e21de68c5b..a720d255f8 100644
--- a/crates/ra_syntax/src/grammar/expressions/atom.rs
+++ b/crates/ra_syntax/src/grammar/expressions/atom.rs
@@ -30,7 +30,7 @@ pub(super) const ATOM_EXPR_FIRST: TokenSet =
     token_set_union![
         LITERAL_FIRST,
         token_set![L_CURLY, L_PAREN, L_BRACK, PIPE, MOVE_KW, IF_KW, WHILE_KW, MATCH_KW, UNSAFE_KW,
-                   RETURN_KW, IDENT, SELF_KW, SUPER_KW, CRATE_KW, COLONCOLON, BREAK_KW, CONTINUE_KW, LIFETIME ],
+                   RETURN_KW, IDENT, SELF_KW, SUPER_KW, COLONCOLON, BREAK_KW, CONTINUE_KW, LIFETIME ],
     ];
 
 const EXPR_RECOVERY_SET: TokenSet =
diff --git a/crates/ra_syntax/src/grammar/mod.rs b/crates/ra_syntax/src/grammar/mod.rs
index 1199ba2300..2cb11dc1e3 100644
--- a/crates/ra_syntax/src/grammar/mod.rs
+++ b/crates/ra_syntax/src/grammar/mod.rs
@@ -31,7 +31,7 @@ mod type_args;
 mod type_params;
 mod types;
 
-use crate::{
+use {
     token_set::TokenSet,
     parser_api::{Marker, CompletedMarker, Parser},
     SyntaxKind::{self, *},
diff --git a/crates/ra_syntax/src/lexer/comments.rs b/crates/ra_syntax/src/lexer/comments.rs
index afe6886a1f..eb417c2dc4 100644
--- a/crates/ra_syntax/src/lexer/comments.rs
+++ b/crates/ra_syntax/src/lexer/comments.rs
@@ -1,6 +1,6 @@
-use crate::lexer::ptr::Ptr;
+use lexer::ptr::Ptr;
 
-use crate::SyntaxKind::{self, *};
+use SyntaxKind::{self, *};
 
 pub(crate) fn scan_shebang(ptr: &mut Ptr) -> bool {
     if ptr.at_str("!/") {
diff --git a/crates/ra_syntax/src/lexer/mod.rs b/crates/ra_syntax/src/lexer/mod.rs
index 9dc0b63d6b..3e11db88b2 100644
--- a/crates/ra_syntax/src/lexer/mod.rs
+++ b/crates/ra_syntax/src/lexer/mod.rs
@@ -4,7 +4,7 @@ mod numbers;
 mod ptr;
 mod strings;
 
-use crate::{
+use {
     SyntaxKind::{self, *},
     TextUnit,
 };
diff --git a/crates/ra_syntax/src/lexer/numbers.rs b/crates/ra_syntax/src/lexer/numbers.rs
index 46daf5e526..22e7d4e99d 100644
--- a/crates/ra_syntax/src/lexer/numbers.rs
+++ b/crates/ra_syntax/src/lexer/numbers.rs
@@ -1,7 +1,7 @@
-use crate::lexer::classes::*;
-use crate::lexer::ptr::Ptr;
+use lexer::classes::*;
+use lexer::ptr::Ptr;
 
-use crate::SyntaxKind::{self, *};
+use SyntaxKind::{self, *};
 
 pub(crate) fn scan_number(c: char, ptr: &mut Ptr) -> SyntaxKind {
     if c == '0' {
diff --git a/crates/ra_syntax/src/lexer/ptr.rs b/crates/ra_syntax/src/lexer/ptr.rs
index c4708cb1c9..c9a5354ea3 100644
--- a/crates/ra_syntax/src/lexer/ptr.rs
+++ b/crates/ra_syntax/src/lexer/ptr.rs
@@ -1,4 +1,4 @@
-use crate::TextUnit;
+use TextUnit;
 
 use std::str::Chars;
 
diff --git a/crates/ra_syntax/src/lexer/strings.rs b/crates/ra_syntax/src/lexer/strings.rs
index bceacdcac2..5ff483d14c 100644
--- a/crates/ra_syntax/src/lexer/strings.rs
+++ b/crates/ra_syntax/src/lexer/strings.rs
@@ -1,6 +1,6 @@
-use crate::SyntaxKind::{self, *};
+use SyntaxKind::{self, *};
 
-use crate::lexer::ptr::Ptr;
+use lexer::ptr::Ptr;
 
 pub(crate) fn is_string_literal_start(c: char, c1: Option<char>, c2: Option<char>) -> bool {
     match (c, c1, c2) {
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs
index 5bb54aba19..7034696298 100644
--- a/crates/ra_syntax/src/lib.rs
+++ b/crates/ra_syntax/src/lib.rs
@@ -46,7 +46,7 @@ mod yellow;
 pub mod utils;
 pub mod text_utils;
 
-pub use crate::{
+pub use {
     rowan::{SmolStr, TextRange, TextUnit},
     ast::AstNode,
     lexer::{tokenize, Token},
@@ -55,7 +55,7 @@ pub use crate::{
     reparsing::AtomEdit,
 };
 
-use crate::{
+use {
     yellow::{GreenNode},
 };
 
diff --git a/crates/ra_syntax/src/parser_api.rs b/crates/ra_syntax/src/parser_api.rs
index cc23bb75e3..772d753afa 100644
--- a/crates/ra_syntax/src/parser_api.rs
+++ b/crates/ra_syntax/src/parser_api.rs
@@ -1,4 +1,4 @@
-use crate::{
+use {
     token_set::TokenSet,
     parser_impl::ParserImpl,
     SyntaxKind::{self, ERROR},
diff --git a/crates/ra_syntax/src/parser_impl/event.rs b/crates/ra_syntax/src/parser_impl/event.rs
index 928d2cc7a1..95e5ce4cc8 100644
--- a/crates/ra_syntax/src/parser_impl/event.rs
+++ b/crates/ra_syntax/src/parser_impl/event.rs
@@ -8,7 +8,7 @@
 //! `start node`, `finish node`, and `FileBuilder` converts
 //! this stream to a real tree.
 use std::mem;
-use crate::{
+use {
     TextUnit, TextRange, SmolStr,
     lexer::Token,
     parser_impl::Sink,
diff --git a/crates/ra_syntax/src/parser_impl/input.rs b/crates/ra_syntax/src/parser_impl/input.rs
index ac6d900d83..c0fe4d488e 100644
--- a/crates/ra_syntax/src/parser_impl/input.rs
+++ b/crates/ra_syntax/src/parser_impl/input.rs
@@ -1,4 +1,4 @@
-use crate::{lexer::Token, SyntaxKind, SyntaxKind::EOF, TextRange, TextUnit};
+use {lexer::Token, SyntaxKind, SyntaxKind::EOF, TextRange, TextUnit};
 
 use std::ops::{Add, AddAssign};
 
diff --git a/crates/ra_syntax/src/parser_impl/mod.rs b/crates/ra_syntax/src/parser_impl/mod.rs
index c2a6448e7a..8d74cef0ee 100644
--- a/crates/ra_syntax/src/parser_impl/mod.rs
+++ b/crates/ra_syntax/src/parser_impl/mod.rs
@@ -3,7 +3,7 @@ mod input;
 
 use std::cell::Cell;
 
-use crate::{
+use {
     TextUnit, SmolStr,
     lexer::Token,
     parser_api::Parser,
@@ -13,7 +13,7 @@ use crate::{
     },
 };
 
-use crate::SyntaxKind::{self, EOF, TOMBSTONE};
+use SyntaxKind::{self, EOF, TOMBSTONE};
 
 pub(crate) trait Sink {
     type Tree;
diff --git a/crates/ra_syntax/src/reparsing.rs b/crates/ra_syntax/src/reparsing.rs
index 16272fe888..d8b6a6a108 100644
--- a/crates/ra_syntax/src/reparsing.rs
+++ b/crates/ra_syntax/src/reparsing.rs
@@ -1,14 +1,14 @@
-use crate::algo;
-use crate::grammar;
-use crate::lexer::{tokenize, Token};
-use crate::yellow::{self, GreenNode, SyntaxNodeRef, SyntaxError};
-use crate::parser_impl;
-use crate::parser_api::Parser;
-use crate::{
+use algo;
+use grammar;
+use lexer::{tokenize, Token};
+use yellow::{self, GreenNode, SyntaxNodeRef, SyntaxError};
+use parser_impl;
+use parser_api::Parser;
+use {
     TextUnit, TextRange,
     SyntaxKind::*,
 };
-use crate::text_utils::replace_range;
+use text_utils::replace_range;
 
 #[derive(Debug, Clone)]
 pub struct AtomEdit {
diff --git a/crates/ra_syntax/src/syntax_kinds/mod.rs b/crates/ra_syntax/src/syntax_kinds/mod.rs
index 3041e56339..332cd13ac5 100644
--- a/crates/ra_syntax/src/syntax_kinds/mod.rs
+++ b/crates/ra_syntax/src/syntax_kinds/mod.rs
@@ -1,7 +1,7 @@
 mod generated;
 
 use std::fmt;
-use crate::SyntaxKind::*;
+use SyntaxKind::*;
 
 pub use self::generated::SyntaxKind;
 
diff --git a/crates/ra_syntax/src/text_utils.rs b/crates/ra_syntax/src/text_utils.rs
index adf26ef30a..58ae1e43e0 100644
--- a/crates/ra_syntax/src/text_utils.rs
+++ b/crates/ra_syntax/src/text_utils.rs
@@ -1,4 +1,4 @@
-use crate::{TextRange, TextUnit};
+use {TextRange, TextUnit};
 
 pub fn contains_offset_nonstrict(range: TextRange, offset: TextUnit) -> bool {
     range.start() <= offset && offset <= range.end()
diff --git a/crates/ra_syntax/src/token_set.rs b/crates/ra_syntax/src/token_set.rs
index d407dfa485..c83fba81bf 100644
--- a/crates/ra_syntax/src/token_set.rs
+++ b/crates/ra_syntax/src/token_set.rs
@@ -1,4 +1,4 @@
-use crate::SyntaxKind;
+use SyntaxKind;
 
 #[derive(Clone, Copy)]
 pub(crate) struct TokenSet(pub(crate) u128);
@@ -29,7 +29,7 @@ macro_rules! token_set_union {
 
 #[test]
 fn token_set_works_for_tokens() {
-    use crate::SyntaxKind::*;
+    use SyntaxKind::*;
     let ts = token_set! { EOF, SHEBANG };
     assert!(ts.contains(EOF));
     assert!(ts.contains(SHEBANG));
diff --git a/crates/ra_syntax/src/utils.rs b/crates/ra_syntax/src/utils.rs
index df1f4b3724..e274f7471f 100644
--- a/crates/ra_syntax/src/utils.rs
+++ b/crates/ra_syntax/src/utils.rs
@@ -1,5 +1,5 @@
 use std::fmt::Write;
-use crate::{
+use {
     algo::walk::{walk, WalkEvent},
     SyntaxKind, File, SyntaxNodeRef
 };
diff --git a/crates/ra_syntax/src/yellow/builder.rs b/crates/ra_syntax/src/yellow/builder.rs
index 67a1a382b5..c307b2bd00 100644
--- a/crates/ra_syntax/src/yellow/builder.rs
+++ b/crates/ra_syntax/src/yellow/builder.rs
@@ -1,5 +1,5 @@
 use rowan::GreenNodeBuilder;
-use crate::{
+use {
     TextUnit, SmolStr,
     parser_impl::Sink,
     yellow::{GreenNode, SyntaxError, RaTypes},
diff --git a/crates/ra_syntax/src/yellow/mod.rs b/crates/ra_syntax/src/yellow/mod.rs
index ab9bca0f02..710320f47c 100644
--- a/crates/ra_syntax/src/yellow/mod.rs
+++ b/crates/ra_syntax/src/yellow/mod.rs
@@ -6,7 +6,7 @@ use std::{
     hash::{Hash, Hasher},
 };
 use rowan::Types;
-use crate::{SyntaxKind, TextUnit, TextRange, SmolStr};
+use {SyntaxKind, TextUnit, TextRange, SmolStr};
 use self::syntax_text::SyntaxText;
 
 pub use rowan::{TreeRoot};
@@ -70,16 +70,16 @@ impl<'a> SyntaxNodeRef<'a> {
         self.0.leaf_text()
     }
     pub fn ancestors(self) -> impl Iterator<Item=SyntaxNodeRef<'a>> {
-        crate::algo::generate(Some(self), |&node| node.parent())
+        ::algo::generate(Some(self), |&node| node.parent())
     }
     pub fn descendants(self) -> impl Iterator<Item=SyntaxNodeRef<'a>> {
-        crate::algo::walk::walk(self).filter_map(|event| match event {
-            crate::algo::walk::WalkEvent::Enter(node) => Some(node),
-            crate::algo::walk::WalkEvent::Exit(_) => None,
+        ::algo::walk::walk(self).filter_map(|event| match event {
+            ::algo::walk::WalkEvent::Enter(node) => Some(node),
+            ::algo::walk::WalkEvent::Exit(_) => None,
         })
     }
     pub fn siblings(self, direction: Direction) -> impl Iterator<Item=SyntaxNodeRef<'a>> {
-        crate::algo::generate(Some(self), move |&node| match direction {
+        ::algo::generate(Some(self), move |&node| match direction {
             Direction::Next => node.next_sibling(),
             Direction::Prev => node.prev_sibling(),
         })
@@ -156,7 +156,7 @@ impl<R: TreeRoot<RaTypes>> Iterator for SyntaxNodeChildren<R> {
 
 
 fn has_short_text(kind: SyntaxKind) -> bool {
-    use crate::SyntaxKind::*;
+    use SyntaxKind::*;
     match kind {
         IDENT | LIFETIME | INT_NUMBER | FLOAT_NUMBER => true,
         _ => false,
diff --git a/crates/ra_syntax/src/yellow/syntax_text.rs b/crates/ra_syntax/src/yellow/syntax_text.rs
index ae33b993de..0db1049de9 100644
--- a/crates/ra_syntax/src/yellow/syntax_text.rs
+++ b/crates/ra_syntax/src/yellow/syntax_text.rs
@@ -2,7 +2,7 @@ use std::{
     fmt, ops,
 };
 
-use crate::{
+use {
     SyntaxNodeRef, TextRange, TextUnit,
     text_utils::{intersect, contains_offset_nonstrict},
 };
diff --git a/crates/tools/Cargo.toml b/crates/tools/Cargo.toml
index e2fecc60d2..d03910986f 100644
--- a/crates/tools/Cargo.toml
+++ b/crates/tools/Cargo.toml
@@ -1,5 +1,4 @@
 [package]
-edition = "2018"
 name = "tools"
 version = "0.1.0"
 authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]


Test patch:
diff --git a/crates/ra_editor/src/test_utils.rs b/crates/ra_editor/src/test_utils.rs
index 49eb530d50..c4ea4db6c9 100644
--- a/crates/ra_editor/src/test_utils.rs
+++ b/crates/ra_editor/src/test_utils.rs
@@ -1,6 +1,6 @@
 use ra_syntax::{File, TextUnit, TextRange};
-pub use crate::_test_utils::*;
-use crate::LocalEdit;
+pub use _test_utils::*;
+use LocalEdit;
 
 pub fn check_action<F: Fn(&File, TextUnit) -> Option<LocalEdit>> (
     before: &str,
diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs
index 7265b5999e..dced45f55b 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/main.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/main.rs
@@ -12,7 +12,7 @@ mod support;
 
 use ra_lsp_server::req::{Runnables, RunnablesParams};
 
-use crate::support::project;
+use support::project;
 
 
 const LOG: &'static str = "";
diff --git a/crates/ra_lsp_server/tests/heavy_tests/support.rs b/crates/ra_lsp_server/tests/heavy_tests/support.rs
index d1339f62fc..8fe2aa8164 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/support.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/support.rs
@@ -25,7 +25,7 @@ use ra_lsp_server::{main_loop, req, thread_watcher::{ThreadWatcher, Worker}};
 
 pub fn project(fixture: &str) -> Server {
     static INIT: Once = Once::new();
-    INIT.call_once(|| Logger::with_env_or_str(crate::LOG).start().unwrap());
+    INIT.call_once(|| Logger::with_env_or_str(::LOG).start().unwrap());
 
     let tmp_dir = TempDir::new("test-project")
         .unwrap();
diff --git a/crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.rs b/crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.rs
deleted file mode 100644
index f1ed30220a..0000000000
--- a/crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-fn main() {
-    make_query(crate::module_map::module_tree);
-}
diff --git a/crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.txt b/crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.txt
deleted file mode 100644
index 3643151801..0000000000
--- a/crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-ROOT@[0; 62)
-  FN_DEF@[0; 61)
-    FN_KW@[0; 2)
-    WHITESPACE@[2; 3)
-    NAME@[3; 7)
-      IDENT@[3; 7) "main"
-    PARAM_LIST@[7; 9)
-      L_PAREN@[7; 8)
-      R_PAREN@[8; 9)
-    WHITESPACE@[9; 10)
-    BLOCK@[10; 61)
-      L_CURLY@[10; 11)
-      WHITESPACE@[11; 16)
-      EXPR_STMT@[16; 59)
-        CALL_EXPR@[16; 58)
-          PATH_EXPR@[16; 26)
-            PATH@[16; 26)
-              PATH_SEGMENT@[16; 26)
-                NAME_REF@[16; 26)
-                  IDENT@[16; 26) "make_query"
-          ARG_LIST@[26; 58)
-            L_PAREN@[26; 27)
-            PATH_EXPR@[27; 57)
-              PATH@[27; 57)
-                PATH@[27; 44)
-                  PATH@[27; 32)
-                    PATH_SEGMENT@[27; 32)
-                      CRATE_KW@[27; 32)
-                  COLONCOLON@[32; 34)
-                  PATH_SEGMENT@[34; 44)
-                    NAME_REF@[34; 44)
-                      IDENT@[34; 44) "module_map"
-                COLONCOLON@[44; 46)
-                PATH_SEGMENT@[46; 57)
-                  NAME_REF@[46; 57)
-                    IDENT@[46; 57) "module_tree"
-            R_PAREN@[57; 58)
-        SEMI@[58; 59)
-      WHITESPACE@[59; 60)
-      R_CURLY@[60; 61)
-  WHITESPACE@[61; 62)
diff --git a/crates/test_utils/Cargo.toml b/crates/test_utils/Cargo.toml
index fe0998ab8a..41316581ed 100644
--- a/crates/test_utils/Cargo.toml
+++ b/crates/test_utils/Cargo.toml
@@ -1,5 +1,4 @@
 [package]
-edition = "2018"
 name = "test_utils"
 version = "0.1.0"
 authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]