From 6605dbaff3dd4104fd402cd6de7531c55d697358 Mon Sep 17 00:00:00 2001
From: Aleksey Kladov <aleksey.kladov@gmail.com>
Date: Mon, 15 Oct 2018 19:52:01 +0300
Subject: [PATCH 1/9] Switch to beta

---
 .travis.yml  | 2 +-
 appveyor.yml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index acf1af0282c..33dc7803ed9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,7 @@
 matrix:
   include:
     - language: rust
-      rust: stable
+      rust: beta
       script:
         - cargo gen-kinds --verify
         - cargo gen-tests --verify
diff --git a/appveyor.yml b/appveyor.yml
index a6ba3b0e153..a32a1e7b8a5 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 stable --default-host x86_64-pc-windows-msvc
+  - rustup-init -yv --default-toolchain beta --default-host x86_64-pc-windows-msvc
   - set PATH=%PATH%;%USERPROFILE%\.cargo\bin
   - rustc -vV
   - cargo -vV

From 171c176833c197bfd1b266940bd2a8c3d4d52cd5 Mon Sep 17 00:00:00 2001
From: Aleksey Kladov <aleksey.kladov@gmail.com>
Date: Mon, 15 Oct 2018 19:55:32 +0300
Subject: [PATCH 2/9] Run cargo fix

---
 crates/ra_syntax/src/algo/mod.rs           |  2 +-
 crates/ra_syntax/src/algo/visit.rs         |  2 +-
 crates/ra_syntax/src/algo/walk.rs          |  2 +-
 crates/ra_syntax/src/ast/generated.rs      |  2 +-
 crates/ra_syntax/src/ast/mod.rs            |  2 +-
 crates/ra_syntax/src/grammar/mod.rs        |  2 +-
 crates/ra_syntax/src/lexer/comments.rs     |  4 ++--
 crates/ra_syntax/src/lexer/mod.rs          |  2 +-
 crates/ra_syntax/src/lexer/numbers.rs      |  6 +++---
 crates/ra_syntax/src/lexer/ptr.rs          |  2 +-
 crates/ra_syntax/src/lexer/strings.rs      |  4 ++--
 crates/ra_syntax/src/lib.rs                |  4 ++--
 crates/ra_syntax/src/parser_api.rs         |  2 +-
 crates/ra_syntax/src/parser_impl/event.rs  |  2 +-
 crates/ra_syntax/src/parser_impl/input.rs  |  2 +-
 crates/ra_syntax/src/parser_impl/mod.rs    |  4 ++--
 crates/ra_syntax/src/reparsing.rs          | 16 ++++++++--------
 crates/ra_syntax/src/syntax_kinds/mod.rs   |  2 +-
 crates/ra_syntax/src/text_utils.rs         |  2 +-
 crates/ra_syntax/src/token_set.rs          |  4 ++--
 crates/ra_syntax/src/utils.rs              |  2 +-
 crates/ra_syntax/src/yellow/builder.rs     |  2 +-
 crates/ra_syntax/src/yellow/mod.rs         | 14 +++++++-------
 crates/ra_syntax/src/yellow/syntax_text.rs |  2 +-
 24 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/crates/ra_syntax/src/algo/mod.rs b/crates/ra_syntax/src/algo/mod.rs
index a6678093d9e..e686a570442 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 {
+use crate::{
     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 9f1c127c707..1ae988a8777 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 {SyntaxNodeRef, AstNode};
+use crate::{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 8e294d965b0..d3441562623 100644
--- a/crates/ra_syntax/src/algo/walk.rs
+++ b/crates/ra_syntax/src/algo/walk.rs
@@ -1,4 +1,4 @@
-use {
+use crate::{
     SyntaxNodeRef,
     algo::generate,
 };
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs
index 4db1bcbf93d..160d186b8d8 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 {
+use crate::{
     ast,
     SyntaxNodeRef, AstNode,
     SyntaxKind::*,
diff --git a/crates/ra_syntax/src/ast/mod.rs b/crates/ra_syntax/src/ast/mod.rs
index 12ddc021005..88193a1edec 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 {
+use crate::{
     SmolStr, SyntaxNodeRef, SyntaxKind::*,
     yellow::{RefRoot, SyntaxNodeChildren},
 };
diff --git a/crates/ra_syntax/src/grammar/mod.rs b/crates/ra_syntax/src/grammar/mod.rs
index 2cb11dc1e30..1199ba2300e 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 {
+use crate::{
     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 eb417c2dc4f..afe6886a1fa 100644
--- a/crates/ra_syntax/src/lexer/comments.rs
+++ b/crates/ra_syntax/src/lexer/comments.rs
@@ -1,6 +1,6 @@
-use lexer::ptr::Ptr;
+use crate::lexer::ptr::Ptr;
 
-use SyntaxKind::{self, *};
+use crate::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 3e11db88b27..9dc0b63d6b8 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 {
+use crate::{
     SyntaxKind::{self, *},
     TextUnit,
 };
diff --git a/crates/ra_syntax/src/lexer/numbers.rs b/crates/ra_syntax/src/lexer/numbers.rs
index 22e7d4e99d6..46daf5e5268 100644
--- a/crates/ra_syntax/src/lexer/numbers.rs
+++ b/crates/ra_syntax/src/lexer/numbers.rs
@@ -1,7 +1,7 @@
-use lexer::classes::*;
-use lexer::ptr::Ptr;
+use crate::lexer::classes::*;
+use crate::lexer::ptr::Ptr;
 
-use SyntaxKind::{self, *};
+use crate::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 c9a5354ea30..c4708cb1c95 100644
--- a/crates/ra_syntax/src/lexer/ptr.rs
+++ b/crates/ra_syntax/src/lexer/ptr.rs
@@ -1,4 +1,4 @@
-use TextUnit;
+use crate::TextUnit;
 
 use std::str::Chars;
 
diff --git a/crates/ra_syntax/src/lexer/strings.rs b/crates/ra_syntax/src/lexer/strings.rs
index 5ff483d14c5..bceacdcac20 100644
--- a/crates/ra_syntax/src/lexer/strings.rs
+++ b/crates/ra_syntax/src/lexer/strings.rs
@@ -1,6 +1,6 @@
-use SyntaxKind::{self, *};
+use crate::SyntaxKind::{self, *};
 
-use lexer::ptr::Ptr;
+use crate::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 70346962981..5bb54aba198 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 {
+pub use crate::{
     rowan::{SmolStr, TextRange, TextUnit},
     ast::AstNode,
     lexer::{tokenize, Token},
@@ -55,7 +55,7 @@ pub use {
     reparsing::AtomEdit,
 };
 
-use {
+use crate::{
     yellow::{GreenNode},
 };
 
diff --git a/crates/ra_syntax/src/parser_api.rs b/crates/ra_syntax/src/parser_api.rs
index 772d753afa3..cc23bb75e3a 100644
--- a/crates/ra_syntax/src/parser_api.rs
+++ b/crates/ra_syntax/src/parser_api.rs
@@ -1,4 +1,4 @@
-use {
+use crate::{
     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 95e5ce4cc83..928d2cc7a16 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 {
+use crate::{
     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 c0fe4d488ee..ac6d900d837 100644
--- a/crates/ra_syntax/src/parser_impl/input.rs
+++ b/crates/ra_syntax/src/parser_impl/input.rs
@@ -1,4 +1,4 @@
-use {lexer::Token, SyntaxKind, SyntaxKind::EOF, TextRange, TextUnit};
+use crate::{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 8d74cef0ee1..c2a6448e7ae 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 {
+use crate::{
     TextUnit, SmolStr,
     lexer::Token,
     parser_api::Parser,
@@ -13,7 +13,7 @@ use {
     },
 };
 
-use SyntaxKind::{self, EOF, TOMBSTONE};
+use crate::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 d8b6a6a108f..16272fe8887 100644
--- a/crates/ra_syntax/src/reparsing.rs
+++ b/crates/ra_syntax/src/reparsing.rs
@@ -1,14 +1,14 @@
-use algo;
-use grammar;
-use lexer::{tokenize, Token};
-use yellow::{self, GreenNode, SyntaxNodeRef, SyntaxError};
-use parser_impl;
-use parser_api::Parser;
-use {
+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::{
     TextUnit, TextRange,
     SyntaxKind::*,
 };
-use text_utils::replace_range;
+use crate::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 332cd13ac5f..3041e56339a 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 SyntaxKind::*;
+use crate::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 58ae1e43e0a..adf26ef30a5 100644
--- a/crates/ra_syntax/src/text_utils.rs
+++ b/crates/ra_syntax/src/text_utils.rs
@@ -1,4 +1,4 @@
-use {TextRange, TextUnit};
+use crate::{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 c83fba81bfa..d407dfa485c 100644
--- a/crates/ra_syntax/src/token_set.rs
+++ b/crates/ra_syntax/src/token_set.rs
@@ -1,4 +1,4 @@
-use SyntaxKind;
+use crate::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 SyntaxKind::*;
+    use crate::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 e274f7471f8..df1f4b37242 100644
--- a/crates/ra_syntax/src/utils.rs
+++ b/crates/ra_syntax/src/utils.rs
@@ -1,5 +1,5 @@
 use std::fmt::Write;
-use {
+use crate::{
     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 c307b2bd00e..67a1a382b5a 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 {
+use crate::{
     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 710320f47ca..ab9bca0f020 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 {SyntaxKind, TextUnit, TextRange, SmolStr};
+use crate::{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>> {
-        ::algo::generate(Some(self), |&node| node.parent())
+        crate::algo::generate(Some(self), |&node| node.parent())
     }
     pub fn descendants(self) -> impl Iterator<Item=SyntaxNodeRef<'a>> {
-        ::algo::walk::walk(self).filter_map(|event| match event {
-            ::algo::walk::WalkEvent::Enter(node) => Some(node),
-            ::algo::walk::WalkEvent::Exit(_) => None,
+        crate::algo::walk::walk(self).filter_map(|event| match event {
+            crate::algo::walk::WalkEvent::Enter(node) => Some(node),
+            crate::algo::walk::WalkEvent::Exit(_) => None,
         })
     }
     pub fn siblings(self, direction: Direction) -> impl Iterator<Item=SyntaxNodeRef<'a>> {
-        ::algo::generate(Some(self), move |&node| match direction {
+        crate::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 SyntaxKind::*;
+    use crate::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 0db1049de9b..ae33b993de0 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 {
+use crate::{
     SyntaxNodeRef, TextRange, TextUnit,
     text_utils::{intersect, contains_offset_nonstrict},
 };

From e4d04a5df8b6326668f67c10be061e27af6d5e70 Mon Sep 17 00:00:00 2001
From: Aleksey Kladov <aleksey.kladov@gmail.com>
Date: Mon, 15 Oct 2018 19:56:37 +0300
Subject: [PATCH 3/9] Mention 2018 in the readme

---
 README.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 1c6facbbd5f..c3056bcfd0e 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,8 @@ functionality is provided via a language server.
 
 ## Quick Start
 
-Rust analyzer builds on stable Rust >= 1.29.0.
+Rust analyzer builds on Rust >= 1.30.0 (currently in beta) and uses
+the 2018 edition.
 
 ```
 # run tests

From 94349206483ad78de71e1546d74a355bbdf764c4 Mon Sep 17 00:00:00 2001
From: Aleksey Kladov <aleksey.kladov@gmail.com>
Date: Mon, 15 Oct 2018 20:00:54 +0300
Subject: [PATCH 4/9] switch base crates to 2018

---
 crates/ra_syntax/Cargo.toml  | 1 +
 crates/test_utils/Cargo.toml | 1 +
 crates/tools/Cargo.toml      | 1 +
 3 files changed, 3 insertions(+)

diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml
index 6345e4725a5..34bb1c591bf 100644
--- a/crates/ra_syntax/Cargo.toml
+++ b/crates/ra_syntax/Cargo.toml
@@ -1,4 +1,5 @@
 [package]
+edition = "2018"
 name = "ra_syntax"
 version = "0.1.0"
 authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
diff --git a/crates/test_utils/Cargo.toml b/crates/test_utils/Cargo.toml
index 41316581ed0..fe0998ab8a4 100644
--- a/crates/test_utils/Cargo.toml
+++ b/crates/test_utils/Cargo.toml
@@ -1,4 +1,5 @@
 [package]
+edition = "2018"
 name = "test_utils"
 version = "0.1.0"
 authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
diff --git a/crates/tools/Cargo.toml b/crates/tools/Cargo.toml
index d03910986f9..e2fecc60d29 100644
--- a/crates/tools/Cargo.toml
+++ b/crates/tools/Cargo.toml
@@ -1,4 +1,5 @@
 [package]
+edition = "2018"
 name = "tools"
 version = "0.1.0"
 authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]

From 1624bf2d7f8c60620830149ac2f88e94dfdb036e Mon Sep 17 00:00:00 2001
From: Aleksey Kladov <aleksey.kladov@gmail.com>
Date: Mon, 15 Oct 2018 20:05:26 +0300
Subject: [PATCH 5/9] switch editor to 2018

---
 crates/ra_editor/Cargo.toml            | 1 +
 crates/ra_editor/src/code_actions.rs   | 4 ++--
 crates/ra_editor/src/completion.rs     | 2 +-
 crates/ra_editor/src/edit.rs           | 2 +-
 crates/ra_editor/src/lib.rs            | 2 +-
 crates/ra_editor/src/line_index.rs     | 2 +-
 crates/ra_editor/src/scope/fn_scope.rs | 4 ++--
 crates/ra_editor/src/symbols.rs        | 2 +-
 crates/ra_editor/src/test_utils.rs     | 4 ++--
 crates/ra_editor/src/typing.rs         | 4 ++--
 10 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/crates/ra_editor/Cargo.toml b/crates/ra_editor/Cargo.toml
index 91cefc8d769..7791da15625 100644
--- a/crates/ra_editor/Cargo.toml
+++ b/crates/ra_editor/Cargo.toml
@@ -1,4 +1,5 @@
 [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 216d592ff45..7b0a48c81a3 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 {EditBuilder, Edit, find_node_at_offset};
+use crate::{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 test_utils::{check_action, check_action_range};
+    use crate::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 20b8484b339..b6095dca9c5 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 {
+use crate::{
     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 2839ac20a00..46e6873197b 100644
--- a/crates/ra_editor/src/edit.rs
+++ b/crates/ra_editor/src/edit.rs
@@ -1,4 +1,4 @@
-use {TextRange, TextUnit};
+use crate::{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 710afc65d55..bd61fd1914f 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 test_utils::{assert_eq_dbg, extract_offset, add_cursor};
+    use crate::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 9cd8da3a893..6ccfdbd83ab 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 ::TextUnit;
+use crate::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 9a48bda020d..99d698b607f 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 mut scope = scopes.new_scope(scope);
+            let 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 {find_node_at_offset, test_utils::extract_offset};
+    use crate::{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 e5cc5ca284f..6211ed5477c 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 TextRange;
+use crate::TextRange;
 
 #[derive(Debug, Clone)]
 pub struct StructureNode {
diff --git a/crates/ra_editor/src/test_utils.rs b/crates/ra_editor/src/test_utils.rs
index c4ea4db6c97..49eb530d50b 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 _test_utils::*;
-use LocalEdit;
+pub use crate::_test_utils::*;
+use crate::LocalEdit;
 
 pub fn check_action<F: Fn(&File, TextUnit) -> Option<LocalEdit>> (
     before: &str,
diff --git a/crates/ra_editor/src/typing.rs b/crates/ra_editor/src/typing.rs
index 1dc658f9b09..542b9e10bd9 100644
--- a/crates/ra_editor/src/typing.rs
+++ b/crates/ra_editor/src/typing.rs
@@ -10,7 +10,7 @@ use ra_syntax::{
     SyntaxKind::*,
 };
 
-use {LocalEdit, EditBuilder, find_node_at_offset};
+use crate::{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 test_utils::{check_action, extract_range, extract_offset, add_cursor};
+    use crate::test_utils::{check_action, extract_range, extract_offset, add_cursor};
 
     fn check_join_lines(before: &str, after: &str) {
         check_action(before, after, |file, offset| {

From 2dd6858d03dd9c3f6dced3cc5c33ef3ab9d09157 Mon Sep 17 00:00:00 2001
From: Aleksey Kladov <aleksey.kladov@gmail.com>
Date: Mon, 15 Oct 2018 20:06:02 +0300
Subject: [PATCH 6/9] switch ra_cli to 2018

---
 crates/ra_cli/Cargo.toml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/crates/ra_cli/Cargo.toml b/crates/ra_cli/Cargo.toml
index 5e7bf3ed457..0b8d6f3dd81 100644
--- a/crates/ra_cli/Cargo.toml
+++ b/crates/ra_cli/Cargo.toml
@@ -1,4 +1,5 @@
 [package]
+edition = "2018"
 name = "ra_cli"
 version = "0.1.0"
 authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]

From bb298158ebc7fc62cad1654c76dc582e6dc28f05 Mon Sep 17 00:00:00 2001
From: Aleksey Kladov <aleksey.kladov@gmail.com>
Date: Mon, 15 Oct 2018 20:15:53 +0300
Subject: [PATCH 7/9] migrate analysis and server to 2018

---
 crates/ra_analysis/Cargo.toml                     |  1 +
 crates/ra_analysis/src/db/imp.rs                  |  4 ++--
 crates/ra_analysis/src/db/mod.rs                  |  6 +++---
 crates/ra_analysis/src/descriptors.rs             |  4 ++--
 crates/ra_analysis/src/imp.rs                     |  4 ++--
 crates/ra_analysis/src/lib.rs                     |  8 +++++---
 crates/ra_analysis/src/module_map.rs              |  4 ++--
 crates/ra_analysis/src/queries.rs                 |  4 ++--
 crates/ra_analysis/src/roots.rs                   | 12 ++++++------
 crates/ra_analysis/src/symbol_index.rs            |  2 +-
 crates/ra_lsp_server/Cargo.toml                   |  1 +
 crates/ra_lsp_server/src/conv.rs                  |  6 +++---
 crates/ra_lsp_server/src/lib.rs                   |  6 ++++--
 crates/ra_lsp_server/src/main_loop/handlers.rs    |  2 +-
 crates/ra_lsp_server/src/main_loop/mod.rs         |  2 +-
 crates/ra_lsp_server/src/project_model.rs         |  2 +-
 crates/ra_lsp_server/src/server_world.rs          |  2 +-
 crates/ra_lsp_server/src/thread_watcher.rs        |  2 +-
 crates/ra_lsp_server/src/vfs.rs                   |  2 +-
 crates/ra_lsp_server/tests/heavy_tests/main.rs    |  2 +-
 crates/ra_lsp_server/tests/heavy_tests/support.rs |  2 +-
 21 files changed, 42 insertions(+), 36 deletions(-)

diff --git a/crates/ra_analysis/Cargo.toml b/crates/ra_analysis/Cargo.toml
index a82e1761c28..28d95c58139 100644
--- a/crates/ra_analysis/Cargo.toml
+++ b/crates/ra_analysis/Cargo.toml
@@ -1,4 +1,5 @@
 [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 36f6cf2907e..7669b618455 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 {FileId, imp::FileResolverImp};
+use crate::{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, &QueryCtx, Self::Params) -> Arc<Self::Output>;
+    fn get(&self, ctx: &QueryCtx, params: 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 22769d1120e..4eb7d922d9b 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 {FileId, imp::FileResolverImp};
+use crate::{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() };
-        ::queries::register_queries(&mut reg);
-        ::module_map::register_queries(&mut reg);
+        crate::queries::register_queries(&mut reg);
+        crate::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 faf945a41f0..f26dac8753e 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 {
+use crate::{
     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 aad54b97713..26f5e175b77 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 {
+use crate::{
     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 1aca72ae007..86c66236ce9 100644
--- a/crates/ra_analysis/src/lib.rs
+++ b/crates/ra_analysis/src/lib.rs
@@ -29,16 +29,18 @@ 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 job::{JobToken, JobHandle};
-pub use descriptors::FnDescriptor;
+pub use crate::{
+    job::{JobToken, JobHandle},
+    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 a21f55fff1e..c77c5cec61a 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 {
+use crate::{
     FileId,
     db::{
         Query, QueryRegistry, QueryCtx,
@@ -38,7 +38,7 @@ mod tests {
     use std::collections::HashMap;
     use im;
     use relative_path::{RelativePath, RelativePathBuf};
-    use {
+    use crate::{
         db::{Db},
         imp::FileResolverImp,
         FileId, FileResolver,
diff --git a/crates/ra_analysis/src/queries.rs b/crates/ra_analysis/src/queries.rs
index 062a2f4203f..613bf1e6103 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 {
+use crate::{
     FileId,
     db::{Query, QueryCtx, QueryRegistry},
     symbol_index::SymbolIndex,
 };
 
-pub(crate) use db::{file_text, file_set};
+pub(crate) use crate::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 32a8c5bd05f..208acc4c22f 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 {
+use crate::{
     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(::module_map::module_tree)
+        self.db.make_query(crate::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| ::queries::file_lines(ctx, file_id))
+        self.db.make_query(|ctx| crate::queries::file_lines(ctx, file_id))
     }
     fn syntax(&self, file_id: FileId) -> File {
-        self.db.make_query(|ctx| ::queries::file_syntax(ctx, file_id))
+        self.db.make_query(|ctx| crate::queries::file_syntax(ctx, file_id))
     }
     fn symbols<'a>(&'a self, acc: &mut Vec<Arc<SymbolIndex>>) {
         self.db.make_query(|ctx| {
-            let file_set = ::queries::file_set(ctx);
+            let file_set = crate::queries::file_set(ctx);
             let syms = file_set.0.iter()
-                .map(|file_id| ::queries::file_symbols(ctx, *file_id));
+                .map(|file_id| crate::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 ffbb6a29fda..e5d83d365ce 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 {Query, FileId, JobToken};
+use crate::{Query, FileId, JobToken};
 
 #[derive(Debug)]
 pub(crate) struct SymbolIndex {
diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml
index 1fe6b2ebe60..2b32571171a 100644
--- a/crates/ra_lsp_server/Cargo.toml
+++ b/crates/ra_lsp_server/Cargo.toml
@@ -1,4 +1,5 @@
 [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 08a6565693f..a75b160c539 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 {
+use crate::{
     Result,
     server_world::ServerWorld,
     req,
@@ -299,7 +299,7 @@ pub fn to_location(
         Ok(loc)
 }
 
-pub trait MapConvWith<'a>: Sized {
+pub trait MapConvWith<'a>: Sized + 'a {
     type Ctx;
     type Output;
 
@@ -309,7 +309,7 @@ pub trait MapConvWith<'a>: Sized {
 }
 
 impl<'a, I> MapConvWith<'a> for I
-    where I: Iterator,
+    where I: Iterator + 'a,
           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 60652d55eee..7224b147609 100644
--- a/crates/ra_lsp_server/src/lib.rs
+++ b/crates/ra_lsp_server/src/lib.rs
@@ -34,5 +34,7 @@ mod project_model;
 pub mod thread_watcher;
 
 pub type Result<T> = ::std::result::Result<T, ::failure::Error>;
-pub use caps::server_capabilities;
-pub use main_loop::main_loop;
+pub use crate::{
+    main_loop::main_loop,
+    caps::server_capabilities,
+};
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index f65e2a88909..1fe78f3d0fd 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 ::{
+use crate::{
     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 f4e7cfc330c..773501efe72 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 {
+use crate::{
     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 43e4fd6542b..c144d95960c 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 {
+use crate::{
     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 c4cdf83d472..c931afa021a 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 {
+use crate::{
     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 86a3a91e071..3257effcba3 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 Result;
+use crate::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 a1c1783f206..d8f9b1aac9a 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 {
+use crate::{
     thread_watcher::{Worker, ThreadWatcher},
 };
 
diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs
index dced45f55b5..7265b5999e9 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 support::project;
+use crate::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 8fe2aa81642..d1339f62fcc 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(::LOG).start().unwrap());
+    INIT.call_once(|| Logger::with_env_or_str(crate::LOG).start().unwrap());
 
     let tmp_dir = TempDir::new("test-project")
         .unwrap();

From 376639c70f94f1f26c7fbd86a9b5adebfa400f44 Mon Sep 17 00:00:00 2001
From: Aleksey Kladov <aleksey.kladov@gmail.com>
Date: Mon, 15 Oct 2018 20:52:56 +0300
Subject: [PATCH 8/9] Parse crate paths in expressions

---
 .../ra_syntax/src/grammar/expressions/atom.rs |  2 +-
 .../data/parser/ok/0035_crate_path_in_call.rs |  3 ++
 .../parser/ok/0035_crate_path_in_call.txt     | 41 +++++++++++++++++++
 3 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.rs
 create mode 100644 crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.txt

diff --git a/crates/ra_syntax/src/grammar/expressions/atom.rs b/crates/ra_syntax/src/grammar/expressions/atom.rs
index a720d255f81..e21de68c5bd 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, COLONCOLON, BREAK_KW, CONTINUE_KW, LIFETIME ],
+                   RETURN_KW, IDENT, SELF_KW, SUPER_KW, CRATE_KW, COLONCOLON, BREAK_KW, CONTINUE_KW, LIFETIME ],
     ];
 
 const EXPR_RECOVERY_SET: TokenSet =
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
new file mode 100644
index 00000000000..f1ed30220ae
--- /dev/null
+++ b/crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.rs
@@ -0,0 +1,3 @@
+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
new file mode 100644
index 00000000000..36431518016
--- /dev/null
+++ b/crates/ra_syntax/tests/data/parser/ok/0035_crate_path_in_call.txt
@@ -0,0 +1,41 @@
+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)

From 9a98d8e99acf8acd40b2153847a37551d2a8d0f4 Mon Sep 17 00:00:00 2001
From: Aleksey Kladov <aleksey.kladov@gmail.com>
Date: Mon, 15 Oct 2018 20:53:15 +0300
Subject: [PATCH 9/9] regenerate

---
 crates/ra_syntax/src/ast/generated.rs.tera | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crates/ra_syntax/src/ast/generated.rs.tera b/crates/ra_syntax/src/ast/generated.rs.tera
index ffa9c413469..5cb7a35ed91 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 {
+use crate::{
     ast,
     SyntaxNodeRef, AstNode,
     SyntaxKind::*,