Repository: rust-analyzer/rust-analyzer
Pull request #5722 (2020-08-12 13:06:23)

Replace SepBy with Itertools


bors r+
🤖


Patch:
diff --git a/crates/ra_assists/src/handlers/add_custom_impl.rs b/crates/ra_assists/src/handlers/add_custom_impl.rs
index b67438b6ba..ebdf00e676 100644
--- a/crates/ra_assists/src/handlers/add_custom_impl.rs
+++ b/crates/ra_assists/src/handlers/add_custom_impl.rs
@@ -1,10 +1,10 @@
+use itertools::Itertools;
 use ra_syntax::{
     ast::{self, AstNode},
     Direction, SmolStr,
     SyntaxKind::{IDENT, WHITESPACE},
     TextRange, TextSize,
 };
-use stdx::SepBy;
 
 use crate::{
     assist_context::{AssistContext, Assists},
@@ -61,9 +61,9 @@ pub(crate) fn add_custom_impl(acc: &mut Assists, ctx: &AssistContext) -> Option<
             .filter(|t| t != trait_token.text())
             .collect::<Vec<SmolStr>>();
         let has_more_derives = !new_attr_input.is_empty();
-        let new_attr_input = new_attr_input.iter().sep_by(", ").surround_with("(", ")").to_string();
 
         if has_more_derives {
+            let new_attr_input = format!("({})", new_attr_input.iter().format(", "));
             builder.replace(input.syntax().text_range(), new_attr_input);
         } else {
             let attr_range = attr.syntax().text_range();
diff --git a/crates/ra_assists/src/handlers/generate_impl.rs b/crates/ra_assists/src/handlers/generate_impl.rs
index d9b87c9c0d..7162dc1848 100644
--- a/crates/ra_assists/src/handlers/generate_impl.rs
+++ b/crates/ra_assists/src/handlers/generate_impl.rs
@@ -1,5 +1,6 @@
+use itertools::Itertools;
 use ra_syntax::ast::{self, AstNode, GenericParamsOwner, NameOwner};
-use stdx::{format_to, SepBy};
+use stdx::format_to;
 
 use crate::{AssistContext, AssistId, AssistKind, Assists};
 
@@ -50,7 +51,7 @@ pub(crate) fn generate_impl(acc: &mut Assists, ctx: &AssistContext) -> Option<()
                     .filter_map(|it| it.name())
                     .map(|it| it.text().clone());
 
-                let generic_params = lifetime_params.chain(type_params).sep_by(", ");
+                let generic_params = lifetime_params.chain(type_params).format(", ");
                 format_to!(buf, "<{}>", generic_params)
             }
             match ctx.config.snippet_cap {
diff --git a/crates/ra_assists/src/handlers/generate_new.rs b/crates/ra_assists/src/handlers/generate_new.rs
index b84aa24b6c..32dfed274a 100644
--- a/crates/ra_assists/src/handlers/generate_new.rs
+++ b/crates/ra_assists/src/handlers/generate_new.rs
@@ -1,9 +1,10 @@
 use hir::Adt;
+use itertools::Itertools;
 use ra_syntax::{
     ast::{self, AstNode, GenericParamsOwner, NameOwner, StructKind, VisibilityOwner},
     T,
 };
-use stdx::{format_to, SepBy};
+use stdx::format_to;
 
 use crate::{AssistContext, AssistId, AssistKind, Assists};
 
@@ -52,8 +53,8 @@ pub(crate) fn generate_new(acc: &mut Assists, ctx: &AssistContext) -> Option<()>
         let params = field_list
             .fields()
             .filter_map(|f| Some(format!("{}: {}", f.name()?.syntax(), f.ty()?.syntax())))
-            .sep_by(", ");
-        let fields = field_list.fields().filter_map(|f| f.name()).sep_by(", ");
+            .format(", ");
+        let fields = field_list.fields().filter_map(|f| f.name()).format(", ");
 
         format_to!(buf, "    {}fn new({}) -> Self {{ Self {{ {} }} }}", vis, params, fields);
 
@@ -102,7 +103,7 @@ fn generate_impl_text(strukt: &ast::Struct, code: &str) -> String {
             .map(|it| it.text().clone());
         let type_params =
             type_params.type_params().filter_map(|it| it.name()).map(|it| it.text().clone());
-        format_to!(buf, "<{}>", lifetime_params.chain(type_params).sep_by(", "))
+        format_to!(buf, "<{}>", lifetime_params.chain(type_params).format(", "))
     }
 
     format_to!(buf, " {{\n{}\n}}\n", code);
diff --git a/crates/ra_ide/src/completion/presentation.rs b/crates/ra_ide/src/completion/presentation.rs
index 9a94ff4767..59f1b14246 100644
--- a/crates/ra_ide/src/completion/presentation.rs
+++ b/crates/ra_ide/src/completion/presentation.rs
@@ -2,8 +2,8 @@
 //! It also handles scoring (sorting) completions.
 
 use hir::{Docs, HasAttrs, HasSource, HirDisplay, ModPath, ScopeDef, StructKind, Type};
+use itertools::Itertools;
 use ra_syntax::ast::NameOwner;
-use stdx::SepBy;
 use test_utils::mark;
 
 use crate::{
@@ -289,16 +289,16 @@ impl Completions {
             .map(|field| (field.name(ctx.db), field.signature_ty(ctx.db)));
         let variant_kind = variant.kind(ctx.db);
         let detail = match variant_kind {
-            StructKind::Tuple | StructKind::Unit => detail_types
-                .map(|(_, t)| t.display(ctx.db).to_string())
-                .sep_by(", ")
-                .surround_with("(", ")")
-                .to_string(),
-            StructKind::Record => detail_types
-                .map(|(n, t)| format!("{}: {}", n, t.display(ctx.db).to_string()))
-                .sep_by(", ")
-                .surround_with("{ ", " }")
-                .to_string(),
+            StructKind::Tuple | StructKind::Unit => format!(
+                "({})",
+                detail_types.map(|(_, t)| t.display(ctx.db).to_string()).format(", ")
+            ),
+            StructKind::Record => format!(
+                "{{ {} }}",
+                detail_types
+                    .map(|(n, t)| format!("{}: {}", n, t.display(ctx.db).to_string()))
+                    .format(", ")
+            ),
         };
         let mut res = CompletionItem::new(
             CompletionKind::Reference,
@@ -412,11 +412,10 @@ impl Builder {
             self = self.trigger_call_info();
             let snippet = match (ctx.config.add_call_argument_snippets, params) {
                 (true, Params::Named(params)) => {
-                    let function_params_snippet = params
-                        .iter()
-                        .enumerate()
-                        .map(|(index, param_name)| format!("${{{}:{}}}", index + 1, param_name))
-                        .sep_by(", ");
+                    let function_params_snippet =
+                        params.iter().enumerate().format_with(", ", |(index, param_name), f| {
+                            f(&format_args!("${{{}:{}}}", index + 1, param_name))
+                        });
                     format!("{}({})$0", name, function_params_snippet)
                 }
                 _ => {
diff --git a/crates/ra_ide/src/syntax_highlighting/injection.rs b/crates/ra_ide/src/syntax_highlighting/injection.rs
index 8665b480fd..6046643ef1 100644
--- a/crates/ra_ide/src/syntax_highlighting/injection.rs
+++ b/crates/ra_ide/src/syntax_highlighting/injection.rs
@@ -4,8 +4,8 @@ use std::{collections::BTreeMap, convert::TryFrom};
 
 use ast::{HasQuotes, HasStringValue};
 use hir::Semantics;
+use itertools::Itertools;
 use ra_syntax::{ast, AstToken, SyntaxNode, SyntaxToken, TextRange, TextSize};
-use stdx::SepBy;
 
 use crate::{
     call_info::ActiveParameter, Analysis, Highlight, HighlightModifier, HighlightTag,
@@ -129,8 +129,7 @@ pub(super) fn extract_doc_comments(
 
             line[pos..].to_owned()
         })
-        .sep_by("\n")
-        .to_string();
+        .join("\n");
 
     if doctest.is_empty() {
         return None;
diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs
index 88468bc971..c2e1d701e2 100644
--- a/crates/ra_parser/src/grammar.rs
+++ b/crates/ra_parser/src/grammar.rs
@@ -110,7 +110,7 @@ pub(crate) mod fragments {
     }
 
     pub(crate) fn item(p: &mut Parser) {
-        items::item_or_macro(p, true)
+        items::item_or_macro(p, true, items::ItemFlavor::Mod)
     }
 
     pub(crate) fn macro_items(p: &mut Parser) {
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs
index 3291e3f146..51eaf7af65 100644
--- a/crates/ra_parser/src/grammar/expressions.rs
+++ b/crates/ra_parser/src/grammar/expressions.rs
@@ -73,7 +73,7 @@ pub(super) fn stmt(p: &mut Parser, with_semi: StmtWithSemi) {
 
     // test block_items
     // fn a() { fn b() {} }
-    let m = match items::maybe_item(p, m) {
+    let m = match items::maybe_item(p, m, items::ItemFlavor::Mod) {
         Ok(()) => return,
         Err(m) => m,
     };
diff --git a/crates/ra_parser/src/grammar/items.rs b/crates/ra_parser/src/grammar/items.rs
index d091b0fbb2..cca524ceaa 100644
--- a/crates/ra_parser/src/grammar/items.rs
+++ b/crates/ra_parser/src/grammar/items.rs
@@ -22,19 +22,24 @@ use super::*;
 pub(super) fn mod_contents(p: &mut Parser, stop_on_r_curly: bool) {
     attributes::inner_attributes(p);
     while !(stop_on_r_curly && p.at(T!['}']) || p.at(EOF)) {
-        item_or_macro(p, stop_on_r_curly)
+        item_or_macro(p, stop_on_r_curly, ItemFlavor::Mod)
     }
 }
 
+pub(super) enum ItemFlavor {
+    Mod,
+    Trait,
+}
+
 pub(super) const ITEM_RECOVERY_SET: TokenSet = token_set![
     FN_KW, STRUCT_KW, ENUM_KW, IMPL_KW, TRAIT_KW, CONST_KW, STATIC_KW, LET_KW, MOD_KW, PUB_KW,
     CRATE_KW, USE_KW, MACRO_KW
 ];
 
-pub(super) fn item_or_macro(p: &mut Parser, stop_on_r_curly: bool) {
+pub(super) fn item_or_macro(p: &mut Parser, stop_on_r_curly: bool, flavor: ItemFlavor) {
     let m = p.start();
     attributes::outer_attributes(p);
-    let m = match maybe_item(p, m) {
+    let m = match maybe_item(p, m, flavor) {
         Ok(()) => {
             if p.at(T![;]) {
                 p.err_and_bump(
@@ -71,7 +76,7 @@ pub(super) fn item_or_macro(p: &mut Parser, stop_on_r_curly: bool) {
     }
 }
 
-pub(super) fn maybe_item(p: &mut Parser, m: Marker) -> Result<(), Marker> {
+pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Result<(), Marker> {
     // test_err pub_expr
     // fn foo() { pub 92; }
     let has_visibility = opt_visibility(p);
@@ -109,31 +114,38 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker) -> Result<(), Marker> {
         has_mods = true;
     }
 
-    // test default_item
-    // default impl T for Foo {}
-    if p.at(IDENT) && p.at_contextual_kw("default") {
-        match p.nth(1) {
-            T![fn] | T![type] | T![const] | T![impl] => {
-                p.bump_remap(T![default]);
-                has_mods = true;
-            }
+    if p.at(IDENT)
+        && p.at_contextual_kw("default")
+        && (match p.nth(1) {
+            T![impl] => true,
             T![unsafe] => {
-                // test default_unsafe_item
-                // default unsafe impl T for Foo {
+                // test default_unsafe_impl
+                // default unsafe impl Foo {}
+
+                // test default_unsafe_fn
+                // impl T for Foo {
                 //     default unsafe fn foo() {}
                 // }
-                if matches!(p.nth(2), T![impl] | T![fn]) {
+                if p.nth(2) == T![impl] || p.nth(2) == T![fn] {
                     p.bump_remap(T![default]);
                     p.bump(T![unsafe]);
                     has_mods = true;
                 }
+                false
             }
-            _ => (),
-        }
+            T![fn] | T![type] | T![const] => {
+                if let ItemFlavor::Mod = flavor {
+                    true
+                } else {
+                    false
+                }
+            }
+            _ => false,
+        })
+    {
+        p.bump_remap(T![default]);
+        has_mods = true;
     }
-
-    // test existential_type
-    // existential type Foo: Fn() -> usize;
     if p.at(IDENT) && p.at_contextual_kw("existential") && p.nth(1) == T![type] {
         p.bump_remap(T![existential]);
         has_mods = true;
@@ -141,31 +153,79 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker) -> Result<(), Marker> {
 
     // items
     match p.current() {
-        // test fn
-        // fn foo() {}
+        // test async_fn
+        // async fn foo() {}
+
+        // test extern_fn
+        // extern fn foo() {}
+
+        // test const_fn
+        // const fn foo() {}
+
+        // test const_unsafe_fn
+        // const unsafe fn foo() {}
+
+        // test unsafe_extern_fn
+        // unsafe extern "C" fn foo() {}
+
+        // test unsafe_fn
+        // unsafe fn foo() {}
+
+        // test combined_fns
+        // async unsafe fn foo() {}
+        // const unsafe fn bar() {}
+
+        // test_err wrong_order_fns
+        // unsafe async fn foo() {}
+        // unsafe const fn bar() {}
         T![fn] => {
             fn_def(p);
             m.complete(p, FN);
         }
 
-        // test trait
-        // trait T {}
+        // test unsafe_trait
+        // unsafe trait T {}
+
+        // test auto_trait
+        // auto trait T {}
+
+        // test unsafe_auto_trait
+        // unsafe auto trait T {}
         T![trait] => {
             traits::trait_def(p);
             m.complete(p, TRAIT);
         }
 
+        // test unsafe_impl
+        // unsafe impl Foo {}
+
+        // test default_impl
+        // default impl Foo {}
+
+        // test_err default_fn_type
+        // trait T {
+        //     default type T = Bar;
+        //     default fn foo() {}
+        // }
+
+        // test default_fn_type
+        // impl T for Foo {
+        //     default type T = Bar;
+        //     default fn foo() {}
+        // }
         T![const] => {
             consts::const_def(p, m);
         }
 
-        // test impl
-        // impl T for S {}
+        // test unsafe_default_impl
+        // unsafe default impl Foo {}
         T![impl] => {
             traits::impl_def(p);
             m.complete(p, IMPL);
         }
 
+        // test existential_type
+        // existential type Foo: Fn() -> usize;
         T![type] => {
             type_def(p, m);
         }
diff --git a/crates/ra_parser/src/grammar/items/traits.rs b/crates/ra_parser/src/grammar/items/traits.rs
index 751ce65f2d..ef9c8ff5b0 100644
--- a/crates/ra_parser/src/grammar/items/traits.rs
+++ b/crates/ra_parser/src/grammar/items/traits.rs
@@ -47,7 +47,7 @@ pub(crate) fn trait_item_list(p: &mut Parser) {
             error_block(p, "expected an item");
             continue;
         }
-        item_or_macro(p, true);
+        item_or_macro(p, true, ItemFlavor::Trait);
     }
     p.expect(T!['}']);
     m.complete(p, ASSOC_ITEM_LIST);
@@ -104,7 +104,7 @@ pub(crate) fn impl_item_list(p: &mut Parser) {
             error_block(p, "expected an item");
             continue;
         }
-        item_or_macro(p, true);
+        item_or_macro(p, true, ItemFlavor::Mod);
     }
     p.expect(T!['}']);
     m.complete(p, ASSOC_ITEM_LIST);
diff --git a/crates/ra_syntax/src/ast/traits.rs b/crates/ra_syntax/src/ast/traits.rs
index 3a56b1674c..0bdc22d953 100644
--- a/crates/ra_syntax/src/ast/traits.rs
+++ b/crates/ra_syntax/src/ast/traits.rs
@@ -1,7 +1,7 @@
 //! Various traits that are implemented by ast nodes.
 //!
 //! The implementations are usually trivial, and live in generated.rs
-use stdx::SepBy;
+use itertools::Itertools;
 
 use crate::{
     ast::{self, support, AstChildren, AstNode, AstToken},
@@ -119,8 +119,7 @@ impl CommentIter {
                 // of a line in markdown.
                 line[pos..end].to_owned()
             })
-            .sep_by("\n")
-            .to_string();
+            .join("\n");
 
         if has_comments {
             Some(docs)
diff --git a/crates/stdx/src/lib.rs b/crates/stdx/src/lib.rs
index 00bfcd29ed..3c5027fe57 100644
--- a/crates/stdx/src/lib.rs
+++ b/crates/stdx/src/lib.rs
@@ -1,5 +1,5 @@
 //! Missing batteries for standard libraries.
-use std::{cell::Cell, fmt, time::Instant};
+use std::time::Instant;
 
 mod macros;
 
@@ -8,69 +8,6 @@ pub fn is_ci() -> bool {
     option_env!("CI").is_some()
 }
 
-pub trait SepBy: Sized {
-    /// Returns an `impl fmt::Display`, which joins elements via a separator.
-    fn sep_by(self, sep: &str) -> SepByBuilder<'_, Self>;
-}
-
-impl<I> SepBy for I
-where
-    I: Iterator,
-    I::Item: fmt::Display,
-{
-    fn sep_by(self, sep: &str) -> SepByBuilder<'_, Self> {
-        SepByBuilder::new(sep, self)
-    }
-}
-
-pub struct SepByBuilder<'a, I> {
-    sep: &'a str,
-    prefix: &'a str,
-    suffix: &'a str,
-    iter: Cell<Option<I>>,
-}
-
-impl<'a, I> SepByBuilder<'a, I> {
-    fn new(sep: &'a str, iter: I) -> SepByBuilder<'a, I> {
-        SepByBuilder { sep, prefix: "", suffix: "", iter: Cell::new(Some(iter)) }
-    }
-
-    pub fn prefix(mut self, prefix: &'a str) -> Self {
-        self.prefix = prefix;
-        self
-    }
-
-    pub fn suffix(mut self, suffix: &'a str) -> Self {
-        self.suffix = suffix;
-        self
-    }
-
-    /// Set both suffix and prefix.
-    pub fn surround_with(self, prefix: &'a str, suffix: &'a str) -> Self {
-        self.prefix(prefix).suffix(suffix)
-    }
-}
-
-impl<I> fmt::Display for SepByBuilder<'_, I>
-where
-    I: Iterator,
-    I::Item: fmt::Display,
-{
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        f.write_str(self.prefix)?;
-        let mut first = true;
-        for item in self.iter.take().unwrap() {
-            if !first {
-                f.write_str(self.sep)?;
-            }
-            first = false;
-            fmt::Display::fmt(&item, f)?;
-        }
-        f.write_str(self.suffix)?;
-        Ok(())
-    }
-}
-
 #[must_use]
 pub fn timeit(label: &'static str) -> impl Drop {
     struct Guard {


Test patch:
diff --git a/crates/ra_syntax/test_data/parser/err/0043_default_const.rast b/crates/ra_syntax/test_data/parser/err/0043_default_const.rast
new file mode 100644
index 0000000000..51ad2a846f
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/err/0043_default_const.rast
@@ -0,0 +1,40 @@
+SOURCE_FILE@0..39
+  TRAIT@0..38
+    TRAIT_KW@0..5 "trait"
+    WHITESPACE@5..6 " "
+    NAME@6..7
+      IDENT@6..7 "T"
+    WHITESPACE@7..8 " "
+    ASSOC_ITEM_LIST@8..38
+      L_CURLY@8..9 "{"
+      WHITESPACE@9..12 "\n  "
+      MACRO_CALL@12..19
+        PATH@12..19
+          PATH_SEGMENT@12..19
+            NAME_REF@12..19
+              IDENT@12..19 "default"
+      WHITESPACE@19..20 " "
+      CONST@20..36
+        CONST_KW@20..25 "const"
+        WHITESPACE@25..26 " "
+        NAME@26..27
+          IDENT@26..27 "f"
+        COLON@27..28 ":"
+        WHITESPACE@28..29 " "
+        PATH_TYPE@29..31
+          PATH@29..31
+            PATH_SEGMENT@29..31
+              NAME_REF@29..31
+                IDENT@29..31 "u8"
+        WHITESPACE@31..32 " "
+        EQ@32..33 "="
+        WHITESPACE@33..34 " "
+        LITERAL@34..35
+          INT_NUMBER@34..35 "0"
+        SEMICOLON@35..36 ";"
+      WHITESPACE@36..37 "\n"
+      R_CURLY@37..38 "}"
+  WHITESPACE@38..39 "\n"
+error 19..19: expected BANG
+error 19..19: expected `{`, `[`, `(`
+error 19..19: expected SEMICOLON
diff --git a/crates/ra_syntax/test_data/parser/err/0043_default_const.rs b/crates/ra_syntax/test_data/parser/err/0043_default_const.rs
new file mode 100644
index 0000000000..80f15474a5
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/err/0043_default_const.rs
@@ -0,0 +1,3 @@
+trait T {
+  default const f: u8 = 0;
+}
diff --git a/crates/ra_syntax/test_data/parser/err/0043_weird_blocks.rast b/crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rast
similarity index 100%
rename from crates/ra_syntax/test_data/parser/err/0043_weird_blocks.rast
rename to crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rast
diff --git a/crates/ra_syntax/test_data/parser/err/0043_weird_blocks.rs b/crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rs
similarity index 100%
rename from crates/ra_syntax/test_data/parser/err/0043_weird_blocks.rs
rename to crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rs
diff --git a/crates/ra_syntax/test_data/parser/err/0045_item_modifiers.rast b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast
similarity index 100%
rename from crates/ra_syntax/test_data/parser/err/0045_item_modifiers.rast
rename to crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast
diff --git a/crates/ra_syntax/test_data/parser/err/0045_item_modifiers.rs b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rs
similarity index 100%
rename from crates/ra_syntax/test_data/parser/err/0045_item_modifiers.rs
rename to crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rs
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast
new file mode 100644
index 0000000000..acd72094b9
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast
@@ -0,0 +1,58 @@
+SOURCE_FILE@0..62
+  TRAIT@0..61
+    TRAIT_KW@0..5 "trait"
+    WHITESPACE@5..6 " "
+    NAME@6..7
+      IDENT@6..7 "T"
+    WHITESPACE@7..8 " "
+    ASSOC_ITEM_LIST@8..61
+      L_CURLY@8..9 "{"
+      WHITESPACE@9..14 "\n    "
+      MACRO_CALL@14..21
+        PATH@14..21
+          PATH_SEGMENT@14..21
+            NAME_REF@14..21
+              IDENT@14..21 "default"
+      WHITESPACE@21..22 " "
+      TYPE_ALIAS@22..35
+        TYPE_KW@22..26 "type"
+        WHITESPACE@26..27 " "
+        NAME@27..28
+          IDENT@27..28 "T"
+        WHITESPACE@28..29 " "
+        EQ@29..30 "="
+        WHITESPACE@30..31 " "
+        PATH_TYPE@31..34
+          PATH@31..34
+            PATH_SEGMENT@31..34
+              NAME_REF@31..34
+                IDENT@31..34 "Bar"
+        SEMICOLON@34..35 ";"
+      WHITESPACE@35..40 "\n    "
+      MACRO_CALL@40..47
+        PATH@40..47
+          PATH_SEGMENT@40..47
+            NAME_REF@40..47
+              IDENT@40..47 "default"
+      WHITESPACE@47..48 " "
+      FN@48..59
+        FN_KW@48..50 "fn"
+        WHITESPACE@50..51 " "
+        NAME@51..54
+          IDENT@51..54 "foo"
+        PARAM_LIST@54..56
+          L_PAREN@54..55 "("
+          R_PAREN@55..56 ")"
+        WHITESPACE@56..57 " "
+        BLOCK_EXPR@57..59
+          L_CURLY@57..58 "{"
+          R_CURLY@58..59 "}"
+      WHITESPACE@59..60 "\n"
+      R_CURLY@60..61 "}"
+  WHITESPACE@61..62 "\n"
+error 21..21: expected BANG
+error 21..21: expected `{`, `[`, `(`
+error 21..21: expected SEMICOLON
+error 47..47: expected BANG
+error 47..47: expected `{`, `[`, `(`
+error 47..47: expected SEMICOLON
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rs b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rs
new file mode 100644
index 0000000000..15ba8f4a85
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rs
@@ -0,0 +1,4 @@
+trait T {
+    default type T = Bar;
+    default fn foo() {}
+}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rast b/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rast
new file mode 100644
index 0000000000..625ab4c2d9
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rast
@@ -0,0 +1,13 @@
+SOURCE_FILE@0..18
+  TRAIT@0..17
+    UNSAFE_KW@0..6 "unsafe"
+    WHITESPACE@6..7 " "
+    TRAIT_KW@7..12 "trait"
+    WHITESPACE@12..13 " "
+    NAME@13..14
+      IDENT@13..14 "T"
+    WHITESPACE@14..15 " "
+    ASSOC_ITEM_LIST@15..17
+      L_CURLY@15..16 "{"
+      R_CURLY@16..17 "}"
+  WHITESPACE@17..18 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rs b/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rs
new file mode 100644
index 0000000000..04e021550d
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rs
@@ -0,0 +1,1 @@
+unsafe trait T {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rast
new file mode 100644
index 0000000000..293b1d64c7
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rast
@@ -0,0 +1,21 @@
+SOURCE_FILE@0..30
+  FN@0..29
+    UNSAFE_KW@0..6 "unsafe"
+    WHITESPACE@6..7 " "
+    ABI@7..17
+      EXTERN_KW@7..13 "extern"
+      WHITESPACE@13..14 " "
+      STRING@14..17 "\"C\""
+    WHITESPACE@17..18 " "
+    FN_KW@18..20 "fn"
+    WHITESPACE@20..21 " "
+    NAME@21..24
+      IDENT@21..24 "foo"
+    PARAM_LIST@24..26
+      L_PAREN@24..25 "("
+      R_PAREN@25..26 ")"
+    WHITESPACE@26..27 " "
+    BLOCK_EXPR@27..29
+      L_CURLY@27..28 "{"
+      R_CURLY@28..29 "}"
+  WHITESPACE@29..30 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rs b/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rs
new file mode 100644
index 0000000000..1295c2cd22
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rs
@@ -0,0 +1,1 @@
+unsafe extern "C" fn foo() {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rast
new file mode 100644
index 0000000000..d6dfa83b70
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rast
@@ -0,0 +1,18 @@
+SOURCE_FILE@0..27
+  IMPL@0..26
+    UNSAFE_KW@0..6 "unsafe"
+    WHITESPACE@6..7 " "
+    DEFAULT_KW@7..14 "default"
+    WHITESPACE@14..15 " "
+    IMPL_KW@15..19 "impl"
+    WHITESPACE@19..20 " "
+    PATH_TYPE@20..23
+      PATH@20..23
+        PATH_SEGMENT@20..23
+          NAME_REF@20..23
+            IDENT@20..23 "Foo"
+    WHITESPACE@23..24 " "
+    ASSOC_ITEM_LIST@24..26
+      L_CURLY@24..25 "{"
+      R_CURLY@25..26 "}"
+  WHITESPACE@26..27 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rs b/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rs
new file mode 100644
index 0000000000..9cd6c57bd8
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rs
@@ -0,0 +1,1 @@
+unsafe default impl Foo {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rast
new file mode 100644
index 0000000000..97548a5eeb
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rast
@@ -0,0 +1,16 @@
+SOURCE_FILE@0..18
+  FN@0..17
+    CONST_KW@0..5 "const"
+    WHITESPACE@5..6 " "
+    FN_KW@6..8 "fn"
+    WHITESPACE@8..9 " "
+    NAME@9..12
+      IDENT@9..12 "foo"
+    PARAM_LIST@12..14
+      L_PAREN@12..13 "("
+      R_PAREN@13..14 ")"
+    WHITESPACE@14..15 " "
+    BLOCK_EXPR@15..17
+      L_CURLY@15..16 "{"
+      R_CURLY@16..17 "}"
+  WHITESPACE@17..18 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rs b/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rs
new file mode 100644
index 0000000000..8c84d9cd7c
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rs
@@ -0,0 +1,1 @@
+const fn foo() {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rast
new file mode 100644
index 0000000000..43c09affed
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rast
@@ -0,0 +1,16 @@
+SOURCE_FILE@0..19
+  IMPL@0..18
+    UNSAFE_KW@0..6 "unsafe"
+    WHITESPACE@6..7 " "
+    IMPL_KW@7..11 "impl"
+    WHITESPACE@11..12 " "
+    PATH_TYPE@12..15
+      PATH@12..15
+        PATH_SEGMENT@12..15
+          NAME_REF@12..15
+            IDENT@12..15 "Foo"
+    WHITESPACE@15..16 " "
+    ASSOC_ITEM_LIST@16..18
+      L_CURLY@16..17 "{"
+      R_CURLY@17..18 "}"
+  WHITESPACE@18..19 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rs b/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rs
new file mode 100644
index 0000000000..41055f41d9
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rs
@@ -0,0 +1,1 @@
+unsafe impl Foo {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rast
new file mode 100644
index 0000000000..405b6a259f
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rast
@@ -0,0 +1,17 @@
+SOURCE_FILE@0..19
+  FN@0..18
+    ABI@0..6
+      EXTERN_KW@0..6 "extern"
+    WHITESPACE@6..7 " "
+    FN_KW@7..9 "fn"
+    WHITESPACE@9..10 " "
+    NAME@10..13
+      IDENT@10..13 "foo"
+    PARAM_LIST@13..15
+      L_PAREN@13..14 "("
+      R_PAREN@14..15 ")"
+    WHITESPACE@15..16 " "
+    BLOCK_EXPR@16..18
+      L_CURLY@16..17 "{"
+      R_CURLY@17..18 "}"
+  WHITESPACE@18..19 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rs b/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rs
new file mode 100644
index 0000000000..394a049f0f
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rs
@@ -0,0 +1,1 @@
+extern fn foo() {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rast b/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rast
new file mode 100644
index 0000000000..0cac9ac431
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rast
@@ -0,0 +1,13 @@
+SOURCE_FILE@0..16
+  TRAIT@0..15
+    AUTO_KW@0..4 "auto"
+    WHITESPACE@4..5 " "
+    TRAIT_KW@5..10 "trait"
+    WHITESPACE@10..11 " "
+    NAME@11..12
+      IDENT@11..12 "T"
+    WHITESPACE@12..13 " "
+    ASSOC_ITEM_LIST@13..15
+      L_CURLY@13..14 "{"
+      R_CURLY@14..15 "}"
+  WHITESPACE@15..16 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rs b/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rs
new file mode 100644
index 0000000000..72adf60351
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rs
@@ -0,0 +1,1 @@
+auto trait T {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rast b/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rast
new file mode 100644
index 0000000000..0ef11c6825
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rast
@@ -0,0 +1,15 @@
+SOURCE_FILE@0..23
+  TRAIT@0..22
+    UNSAFE_KW@0..6 "unsafe"
+    WHITESPACE@6..7 " "
+    AUTO_KW@7..11 "auto"
+    WHITESPACE@11..12 " "
+    TRAIT_KW@12..17 "trait"
+    WHITESPACE@17..18 " "
+    NAME@18..19
+      IDENT@18..19 "T"
+    WHITESPACE@19..20 " "
+    ASSOC_ITEM_LIST@20..22
+      L_CURLY@20..21 "{"
+      R_CURLY@21..22 "}"
+  WHITESPACE@22..23 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rs b/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rs
new file mode 100644
index 0000000000..03d29f3241
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rs
@@ -0,0 +1,1 @@
+unsafe auto trait T {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rast
new file mode 100644
index 0000000000..0a1b21d6e6
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rast
@@ -0,0 +1,16 @@
+SOURCE_FILE@0..20
+  IMPL@0..19
+    DEFAULT_KW@0..7 "default"
+    WHITESPACE@7..8 " "
+    IMPL_KW@8..12 "impl"
+    WHITESPACE@12..13 " "
+    PATH_TYPE@13..16
+      PATH@13..16
+        PATH_SEGMENT@13..16
+          NAME_REF@13..16
+            IDENT@13..16 "Foo"
+    WHITESPACE@16..17 " "
+    ASSOC_ITEM_LIST@17..19
+      L_CURLY@17..18 "{"
+      R_CURLY@18..19 "}"
+  WHITESPACE@19..20 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rs b/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rs
new file mode 100644
index 0000000000..ef6aa84a29
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rs
@@ -0,0 +1,1 @@
+default impl Foo {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rast
new file mode 100644
index 0000000000..32a77ba490
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rast
@@ -0,0 +1,18 @@
+SOURCE_FILE@0..25
+  FN@0..24
+    CONST_KW@0..5 "const"
+    WHITESPACE@5..6 " "
+    UNSAFE_KW@6..12 "unsafe"
+    WHITESPACE@12..13 " "
+    FN_KW@13..15 "fn"
+    WHITESPACE@15..16 " "
+    NAME@16..19
+      IDENT@16..19 "foo"
+    PARAM_LIST@19..21
+      L_PAREN@19..20 "("
+      R_PAREN@20..21 ")"
+    WHITESPACE@21..22 " "
+    BLOCK_EXPR@22..24
+      L_CURLY@22..23 "{"
+      R_CURLY@23..24 "}"
+  WHITESPACE@24..25 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rs b/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rs
new file mode 100644
index 0000000000..31a1e435f5
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rs
@@ -0,0 +1,1 @@
+const unsafe fn foo() {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rast
new file mode 100644
index 0000000000..73c94e5d43
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rast
@@ -0,0 +1,16 @@
+SOURCE_FILE@0..19
+  FN@0..18
+    UNSAFE_KW@0..6 "unsafe"
+    WHITESPACE@6..7 " "
+    FN_KW@7..9 "fn"
+    WHITESPACE@9..10 " "
+    NAME@10..13
+      IDENT@10..13 "foo"
+    PARAM_LIST@13..15
+      L_PAREN@13..14 "("
+      R_PAREN@14..15 ")"
+    WHITESPACE@15..16 " "
+    BLOCK_EXPR@16..18
+      L_CURLY@16..17 "{"
+      R_CURLY@17..18 "}"
+  WHITESPACE@18..19 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rs b/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rs
new file mode 100644
index 0000000000..33cfc4cd7a
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rs
@@ -0,0 +1,1 @@
+unsafe fn foo() {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rast
new file mode 100644
index 0000000000..a7df188bd6
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rast
@@ -0,0 +1,16 @@
+SOURCE_FILE@0..18
+  FN@0..17
+    ASYNC_KW@0..5 "async"
+    WHITESPACE@5..6 " "
+    FN_KW@6..8 "fn"
+    WHITESPACE@8..9 " "
+    NAME@9..12
+      IDENT@9..12 "foo"
+    PARAM_LIST@12..14
+      L_PAREN@12..13 "("
+      R_PAREN@13..14 ")"
+    WHITESPACE@14..15 " "
+    BLOCK_EXPR@15..17
+      L_CURLY@15..16 "{"
+      R_CURLY@16..17 "}"
+  WHITESPACE@17..18 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rs b/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rs
new file mode 100644
index 0000000000..f4adcb62b3
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rs
@@ -0,0 +1,1 @@
+async fn foo() {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rast b/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rast
new file mode 100644
index 0000000000..98a20f36d6
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rast
@@ -0,0 +1,35 @@
+SOURCE_FILE@0..50
+  FN@0..24
+    ASYNC_KW@0..5 "async"
+    WHITESPACE@5..6 " "
+    UNSAFE_KW@6..12 "unsafe"
+    WHITESPACE@12..13 " "
+    FN_KW@13..15 "fn"
+    WHITESPACE@15..16 " "
+    NAME@16..19
+      IDENT@16..19 "foo"
+    PARAM_LIST@19..21
+      L_PAREN@19..20 "("
+      R_PAREN@20..21 ")"
+    WHITESPACE@21..22 " "
+    BLOCK_EXPR@22..24
+      L_CURLY@22..23 "{"
+      R_CURLY@23..24 "}"
+  WHITESPACE@24..25 "\n"
+  FN@25..49
+    CONST_KW@25..30 "const"
+    WHITESPACE@30..31 " "
+    UNSAFE_KW@31..37 "unsafe"
+    WHITESPACE@37..38 " "
+    FN_KW@38..40 "fn"
+    WHITESPACE@40..41 " "
+    NAME@41..44
+      IDENT@41..44 "bar"
+    PARAM_LIST@44..46
+      L_PAREN@44..45 "("
+      R_PAREN@45..46 ")"
+    WHITESPACE@46..47 " "
+    BLOCK_EXPR@47..49
+      L_CURLY@47..48 "{"
+      R_CURLY@48..49 "}"
+  WHITESPACE@49..50 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rs b/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rs
new file mode 100644
index 0000000000..1262871453
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rs
@@ -0,0 +1,2 @@
+async unsafe fn foo() {}
+const unsafe fn bar() {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rast
new file mode 100644
index 0000000000..b8d26a53a5
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rast
@@ -0,0 +1,55 @@
+SOURCE_FILE@0..69
+  IMPL@0..68
+    IMPL_KW@0..4 "impl"
+    WHITESPACE@4..5 " "
+    PATH_TYPE@5..6
+      PATH@5..6
+        PATH_SEGMENT@5..6
+          NAME_REF@5..6
+            IDENT@5..6 "T"
+    WHITESPACE@6..7 " "
+    FOR_KW@7..10 "for"
+    WHITESPACE@10..11 " "
+    PATH_TYPE@11..14
+      PATH@11..14
+        PATH_SEGMENT@11..14
+          NAME_REF@11..14
+            IDENT@11..14 "Foo"
+    WHITESPACE@14..15 " "
+    ASSOC_ITEM_LIST@15..68
+      L_CURLY@15..16 "{"
+      WHITESPACE@16..21 "\n    "
+      TYPE_ALIAS@21..42
+        DEFAULT_KW@21..28 "default"
+        WHITESPACE@28..29 " "
+        TYPE_KW@29..33 "type"
+        WHITESPACE@33..34 " "
+        NAME@34..35
+          IDENT@34..35 "T"
+        WHITESPACE@35..36 " "
+        EQ@36..37 "="
+        WHITESPACE@37..38 " "
+        PATH_TYPE@38..41
+          PATH@38..41
+            PATH_SEGMENT@38..41
+              NAME_REF@38..41
+                IDENT@38..41 "Bar"
+        SEMICOLON@41..42 ";"
+      WHITESPACE@42..47 "\n    "
+      FN@47..66
+        DEFAULT_KW@47..54 "default"
+        WHITESPACE@54..55 " "
+        FN_KW@55..57 "fn"
+        WHITESPACE@57..58 " "
+        NAME@58..61
+          IDENT@58..61 "foo"
+        PARAM_LIST@61..63
+          L_PAREN@61..62 "("
+          R_PAREN@62..63 ")"
+        WHITESPACE@63..64 " "
+        BLOCK_EXPR@64..66
+          L_CURLY@64..65 "{"
+          R_CURLY@65..66 "}"
+      WHITESPACE@66..67 "\n"
+      R_CURLY@67..68 "}"
+  WHITESPACE@68..69 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rs
new file mode 100644
index 0000000000..8f5d611139
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rs
@@ -0,0 +1,4 @@
+impl T for Foo {
+    default type T = Bar;
+    default fn foo() {}
+}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0151_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0151_fn.rast
deleted file mode 100644
index 23c4269b30..0000000000
--- a/crates/ra_syntax/test_data/parser/inline/ok/0151_fn.rast
+++ /dev/null
@@ -1,14 +0,0 @@
-SOURCE_FILE@0..12
-  FN@0..11
-    FN_KW@0..2 "fn"
-    WHITESPACE@2..3 " "
-    NAME@3..6
-      IDENT@3..6 "foo"
-    PARAM_LIST@6..8
-      L_PAREN@6..7 "("
-      R_PAREN@7..8 ")"
-    WHITESPACE@8..9 " "
-    BLOCK_EXPR@9..11
-      L_CURLY@9..10 "{"
-      R_CURLY@10..11 "}"
-  WHITESPACE@11..12 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0151_fn.rs b/crates/ra_syntax/test_data/parser/inline/ok/0151_fn.rs
deleted file mode 100644
index 8f3b7ef112..0000000000
--- a/crates/ra_syntax/test_data/parser/inline/ok/0151_fn.rs
+++ /dev/null
@@ -1,1 +0,0 @@
-fn foo() {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0152_impl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0152_impl.rast
deleted file mode 100644
index 7968cf9ffa..0000000000
--- a/crates/ra_syntax/test_data/parser/inline/ok/0152_impl.rast
+++ /dev/null
@@ -1,22 +0,0 @@
-SOURCE_FILE@0..16
-  IMPL@0..15
-    IMPL_KW@0..4 "impl"
-    WHITESPACE@4..5 " "
-    PATH_TYPE@5..6
-      PATH@5..6
-        PATH_SEGMENT@5..6
-          NAME_REF@5..6
-            IDENT@5..6 "T"
-    WHITESPACE@6..7 " "
-    FOR_KW@7..10 "for"
-    WHITESPACE@10..11 " "
-    PATH_TYPE@11..12
-      PATH@11..12
-        PATH_SEGMENT@11..12
-          NAME_REF@11..12
-            IDENT@11..12 "S"
-    WHITESPACE@12..13 " "
-    ASSOC_ITEM_LIST@13..15
-      L_CURLY@13..14 "{"
-      R_CURLY@14..15 "}"
-  WHITESPACE@15..16 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0152_impl.rs b/crates/ra_syntax/test_data/parser/inline/ok/0152_impl.rs
deleted file mode 100644
index a1a550d8a6..0000000000
--- a/crates/ra_syntax/test_data/parser/inline/ok/0152_impl.rs
+++ /dev/null
@@ -1,1 +0,0 @@
-impl T for S {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0153_trait.rast b/crates/ra_syntax/test_data/parser/inline/ok/0153_trait.rast
deleted file mode 100644
index 9881e5048c..0000000000
--- a/crates/ra_syntax/test_data/parser/inline/ok/0153_trait.rast
+++ /dev/null
@@ -1,11 +0,0 @@
-SOURCE_FILE@0..11
-  TRAIT@0..10
-    TRAIT_KW@0..5 "trait"
-    WHITESPACE@5..6 " "
-    NAME@6..7
-      IDENT@6..7 "T"
-    WHITESPACE@7..8 " "
-    ASSOC_ITEM_LIST@8..10
-      L_CURLY@8..9 "{"
-      R_CURLY@9..10 "}"
-  WHITESPACE@10..11 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0153_trait.rs b/crates/ra_syntax/test_data/parser/inline/ok/0153_trait.rs
deleted file mode 100644
index 8d183dbb5d..0000000000
--- a/crates/ra_syntax/test_data/parser/inline/ok/0153_trait.rs
+++ /dev/null
@@ -1,1 +0,0 @@
-trait T {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rast
new file mode 100644
index 0000000000..1269621dc2
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rast
@@ -0,0 +1,40 @@
+SOURCE_FILE@0..50
+  IMPL@0..49
+    IMPL_KW@0..4 "impl"
+    WHITESPACE@4..5 " "
+    PATH_TYPE@5..6
+      PATH@5..6
+        PATH_SEGMENT@5..6
+          NAME_REF@5..6
+            IDENT@5..6 "T"
+    WHITESPACE@6..7 " "
+    FOR_KW@7..10 "for"
+    WHITESPACE@10..11 " "
+    PATH_TYPE@11..14
+      PATH@11..14
+        PATH_SEGMENT@11..14
+          NAME_REF@11..14
+            IDENT@11..14 "Foo"
+    WHITESPACE@14..15 " "
+    ASSOC_ITEM_LIST@15..49
+      L_CURLY@15..16 "{"
+      WHITESPACE@16..21 "\n    "
+      FN@21..47
+        DEFAULT_KW@21..28 "default"
+        WHITESPACE@28..29 " "
+        UNSAFE_KW@29..35 "unsafe"
+        WHITESPACE@35..36 " "
+        FN_KW@36..38 "fn"
+        WHITESPACE@38..39 " "
+        NAME@39..42
+          IDENT@39..42 "foo"
+        PARAM_LIST@42..44
+          L_PAREN@42..43 "("
+          R_PAREN@43..44 ")"
+        WHITESPACE@44..45 " "
+        BLOCK_EXPR@45..47
+          L_CURLY@45..46 "{"
+          R_CURLY@46..47 "}"
+      WHITESPACE@47..48 "\n"
+      R_CURLY@48..49 "}"
+  WHITESPACE@49..50 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_item.rs b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rs
similarity index 50%
rename from crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_item.rs
rename to crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rs
index 96340f84ab..12926cd8a1 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_item.rs
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rs
@@ -1,3 +1,3 @@
-default unsafe impl T for Foo {
+impl T for Foo {
     default unsafe fn foo() {}
 }
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_impl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_impl.rast
new file mode 100644
index 0000000000..6bfe925af2
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_impl.rast
@@ -0,0 +1,18 @@
+SOURCE_FILE@0..27
+  IMPL@0..26
+    DEFAULT_KW@0..7 "default"
+    WHITESPACE@7..8 " "
+    UNSAFE_KW@8..14 "unsafe"
+    WHITESPACE@14..15 " "
+    IMPL_KW@15..19 "impl"
+    WHITESPACE@19..20 " "
+    PATH_TYPE@20..23
+      PATH@20..23
+        PATH_SEGMENT@20..23
+          NAME_REF@20..23
+            IDENT@20..23 "Foo"
+    WHITESPACE@23..24 " "
+    ASSOC_ITEM_LIST@24..26
+      L_CURLY@24..25 "{"
+      R_CURLY@25..26 "}"
+  WHITESPACE@26..27 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_impl.rs b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_impl.rs
new file mode 100644
index 0000000000..ba0998ff4d
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_impl.rs
@@ -0,0 +1,1 @@
+default unsafe impl Foo {}
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_item.rast b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_item.rast
deleted file mode 100644
index f2e2014605..0000000000
--- a/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_item.rast
+++ /dev/null
@@ -1,44 +0,0 @@
-SOURCE_FILE@0..65
-  IMPL@0..64
-    DEFAULT_KW@0..7 "default"
-    WHITESPACE@7..8 " "
-    UNSAFE_KW@8..14 "unsafe"
-    WHITESPACE@14..15 " "
-    IMPL_KW@15..19 "impl"
-    WHITESPACE@19..20 " "
-    PATH_TYPE@20..21
-      PATH@20..21
-        PATH_SEGMENT@20..21
-          NAME_REF@20..21
-            IDENT@20..21 "T"
-    WHITESPACE@21..22 " "
-    FOR_KW@22..25 "for"
-    WHITESPACE@25..26 " "
-    PATH_TYPE@26..29
-      PATH@26..29
-        PATH_SEGMENT@26..29
-          NAME_REF@26..29
-            IDENT@26..29 "Foo"
-    WHITESPACE@29..30 " "
-    ASSOC_ITEM_LIST@30..64
-      L_CURLY@30..31 "{"
-      WHITESPACE@31..36 "\n    "
-      FN@36..62
-        DEFAULT_KW@36..43 "default"
-        WHITESPACE@43..44 " "
-        UNSAFE_KW@44..50 "unsafe"
-        WHITESPACE@50..51 " "
-        FN_KW@51..53 "fn"
-        WHITESPACE@53..54 " "
-        NAME@54..57
-          IDENT@54..57 "foo"
-        PARAM_LIST@57..59
-          L_PAREN@57..58 "("
-          R_PAREN@58..59 ")"
-        WHITESPACE@59..60 " "
-        BLOCK_EXPR@60..62
-          L_CURLY@60..61 "{"
-          R_CURLY@61..62 "}"
-      WHITESPACE@62..63 "\n"
-      R_CURLY@63..64 "}"
-  WHITESPACE@64..65 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0164_default_item.rast b/crates/ra_syntax/test_data/parser/inline/ok/0164_default_item.rast
deleted file mode 100644
index 9282772f34..0000000000
--- a/crates/ra_syntax/test_data/parser/inline/ok/0164_default_item.rast
+++ /dev/null
@@ -1,24 +0,0 @@
-SOURCE_FILE@0..26
-  IMPL@0..25
-    DEFAULT_KW@0..7 "default"
-    WHITESPACE@7..8 " "
-    IMPL_KW@8..12 "impl"
-    WHITESPACE@12..13 " "
-    PATH_TYPE@13..14
-      PATH@13..14
-        PATH_SEGMENT@13..14
-          NAME_REF@13..14
-            IDENT@13..14 "T"
-    WHITESPACE@14..15 " "
-    FOR_KW@15..18 "for"
-    WHITESPACE@18..19 " "
-    PATH_TYPE@19..22
-      PATH@19..22
-        PATH_SEGMENT@19..22
-          NAME_REF@19..22
-            IDENT@19..22 "Foo"
-    WHITESPACE@22..23 " "
-    ASSOC_ITEM_LIST@23..25
-      L_CURLY@23..24 "{"
-      R_CURLY@24..25 "}"
-  WHITESPACE@25..26 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0164_default_item.rs b/crates/ra_syntax/test_data/parser/inline/ok/0164_default_item.rs
deleted file mode 100644
index a6836cbd57..0000000000
--- a/crates/ra_syntax/test_data/parser/inline/ok/0164_default_item.rs
+++ /dev/null
@@ -1,1 +0,0 @@
-default impl T for Foo {}
diff --git a/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.rast b/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.rast
new file mode 100644
index 0000000000..5524efaafe
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.rast
@@ -0,0 +1,56 @@
+SOURCE_FILE@0..71
+  FN@0..19
+    ABI@0..6
+      EXTERN_KW@0..6 "extern"
+    WHITESPACE@6..7 " "
+    FN_KW@7..9 "fn"
+    WHITESPACE@9..10 " "
+    NAME@10..13
+      IDENT@10..13 "foo"
+    PARAM_LIST@13..15
+      L_PAREN@13..14 "("
+      R_PAREN@14..15 ")"
+    WHITESPACE@15..16 " "
+    BLOCK_EXPR@16..19
+      L_CURLY@16..17 "{"
+      WHITESPACE@17..18 "\n"
+      R_CURLY@18..19 "}"
+  WHITESPACE@19..21 "\n\n"
+  FN@21..44
+    ABI@21..31
+      EXTERN_KW@21..27 "extern"
+      WHITESPACE@27..28 " "
+      STRING@28..31 "\"C\""
+    WHITESPACE@31..32 " "
+    FN_KW@32..34 "fn"
+    WHITESPACE@34..35 " "
+    NAME@35..38
+      IDENT@35..38 "bar"
+    PARAM_LIST@38..40
+      L_PAREN@38..39 "("
+      R_PAREN@39..40 ")"
+    WHITESPACE@40..41 " "
+    BLOCK_EXPR@41..44
+      L_CURLY@41..42 "{"
+      WHITESPACE@42..43 "\n"
+      R_CURLY@43..44 "}"
+  WHITESPACE@44..46 "\n\n"
+  FN@46..70
+    ABI@46..57
+      EXTERN_KW@46..52 "extern"
+      WHITESPACE@52..53 " "
+      RAW_STRING@53..57 "r\"D\""
+    WHITESPACE@57..58 " "
+    FN_KW@58..60 "fn"
+    WHITESPACE@60..61 " "
+    NAME@61..64
+      IDENT@61..64 "baz"
+    PARAM_LIST@64..66
+      L_PAREN@64..65 "("
+      R_PAREN@65..66 ")"
+    WHITESPACE@66..67 " "
+    BLOCK_EXPR@67..70
+      L_CURLY@67..68 "{"
+      WHITESPACE@68..69 "\n"
+      R_CURLY@69..70 "}"
+  WHITESPACE@70..71 "\n"
diff --git a/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.rs b/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.rs
new file mode 100644
index 0000000000..e929eef741
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.rs
@@ -0,0 +1,8 @@
+extern fn foo() {
+}
+
+extern "C" fn bar() {
+}
+
+extern r"D" fn baz() {
+}
diff --git a/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast b/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast
new file mode 100644
index 0000000000..6246a31a66
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast
@@ -0,0 +1,44 @@
+SOURCE_FILE@0..46
+  IMPL@0..45
+    IMPL_KW@0..4 "impl"
+    WHITESPACE@4..5 " "
+    PATH_TYPE@5..6
+      PATH@5..6
+        PATH_SEGMENT@5..6
+          NAME_REF@5..6
+            IDENT@5..6 "T"
+    WHITESPACE@6..7 " "
+    FOR_KW@7..10 "for"
+    WHITESPACE@10..11 " "
+    PATH_TYPE@11..14
+      PATH@11..14
+        PATH_SEGMENT@11..14
+          NAME_REF@11..14
+            IDENT@11..14 "Foo"
+    WHITESPACE@14..15 " "
+    ASSOC_ITEM_LIST@15..45
+      L_CURLY@15..16 "{"
+      WHITESPACE@16..19 "\n  "
+      CONST@19..43
+        DEFAULT_KW@19..26 "default"
+        WHITESPACE@26..27 " "
+        CONST_KW@27..32 "const"
+        WHITESPACE@32..33 " "
+        NAME@33..34
+          IDENT@33..34 "f"
+        COLON@34..35 ":"
+        WHITESPACE@35..36 " "
+        PATH_TYPE@36..38
+          PATH@36..38
+            PATH_SEGMENT@36..38
+              NAME_REF@36..38
+                IDENT@36..38 "u8"
+        WHITESPACE@38..39 " "
+        EQ@39..40 "="
+        WHITESPACE@40..41 " "
+        LITERAL@41..42
+          INT_NUMBER@41..42 "0"
+        SEMICOLON@42..43 ";"
+      WHITESPACE@43..44 "\n"
+      R_CURLY@44..45 "}"
+  WHITESPACE@45..46 "\n"
diff --git a/crates/ra_syntax/test_data/parser/ok/0066_default_const.rs b/crates/ra_syntax/test_data/parser/ok/0066_default_const.rs
new file mode 100644
index 0000000000..dfb3b92dca
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/ok/0066_default_const.rs
@@ -0,0 +1,3 @@
+impl T for Foo {
+  default const f: u8 = 0;
+}
diff --git a/crates/ra_syntax/test_data/parser/ok/0066_default_modifier.rast b/crates/ra_syntax/test_data/parser/ok/0066_default_modifier.rast
deleted file mode 100644
index e9b57ec3b3..0000000000
--- a/crates/ra_syntax/test_data/parser/ok/0066_default_modifier.rast
+++ /dev/null
@@ -1,218 +0,0 @@
-SOURCE_FILE@0..294
-  TRAIT@0..113
-    TRAIT_KW@0..5 "trait"
-    WHITESPACE@5..6 " "
-    NAME@6..7
-      IDENT@6..7 "T"
-    WHITESPACE@7..8 " "
-    ASSOC_ITEM_LIST@8..113
-      L_CURLY@8..9 "{"
-      WHITESPACE@9..12 "\n  "
-      TYPE_ALIAS@12..33
-        DEFAULT_KW@12..19 "default"
-        WHITESPACE@19..20 " "
-        TYPE_KW@20..24 "type"
-        WHITESPACE@24..25 " "
-        NAME@25..26
-          IDENT@25..26 "T"
-        WHITESPACE@26..27 " "
-        EQ@27..28 "="
-        WHITESPACE@28..29 " "
-        PATH_TYPE@29..32
-          PATH@29..32
-            PATH_SEGMENT@29..32
-              NAME_REF@29..32
-                IDENT@29..32 "Bar"
-        SEMICOLON@32..33 ";"
-      WHITESPACE@33..36 "\n  "
-      CONST@36..60
-        DEFAULT_KW@36..43 "default"
-        WHITESPACE@43..44 " "
-        CONST_KW@44..49 "const"
-        WHITESPACE@49..50 " "
-        NAME@50..51
-          IDENT@50..51 "f"
-        COLON@51..52 ":"
-        WHITESPACE@52..53 " "
-        PATH_TYPE@53..55
-          PATH@53..55
-            PATH_SEGMENT@53..55
-              NAME_REF@53..55
-                IDENT@53..55 "u8"
-        WHITESPACE@55..56 " "
-        EQ@56..57 "="
-        WHITESPACE@57..58 " "
-        LITERAL@58..59
-          INT_NUMBER@58..59 "0"
-        SEMICOLON@59..60 ";"
-      WHITESPACE@60..63 "\n  "
-      FN@63..82
-        DEFAULT_KW@63..70 "default"
-        WHITESPACE@70..71 " "
-        FN_KW@71..73 "fn"
-        WHITESPACE@73..74 " "
-        NAME@74..77
-          IDENT@74..77 "foo"
-        PARAM_LIST@77..79
-          L_PAREN@77..78 "("
-          R_PAREN@78..79 ")"
-        WHITESPACE@79..80 " "
-        BLOCK_EXPR@80..82
-          L_CURLY@80..81 "{"
-          R_CURLY@81..82 "}"
-      WHITESPACE@82..85 "\n  "
-      FN@85..111
-        DEFAULT_KW@85..92 "default"
-        WHITESPACE@92..93 " "
-        UNSAFE_KW@93..99 "unsafe"
-        WHITESPACE@99..100 " "
-        FN_KW@100..102 "fn"
-        WHITESPACE@102..103 " "
-        NAME@103..106
-          IDENT@103..106 "bar"
-        PARAM_LIST@106..108
-          L_PAREN@106..107 "("
-          R_PAREN@107..108 ")"
-        WHITESPACE@108..109 " "
-        BLOCK_EXPR@109..111
-          L_CURLY@109..110 "{"
-          R_CURLY@110..111 "}"
-      WHITESPACE@111..112 "\n"
-      R_CURLY@112..113 "}"
-  WHITESPACE@113..115 "\n\n"
-  IMPL@115..235
-    IMPL_KW@115..119 "impl"
-    WHITESPACE@119..120 " "
-    PATH_TYPE@120..121
-      PATH@120..121
-        PATH_SEGMENT@120..121
-          NAME_REF@120..121
-            IDENT@120..121 "T"
-    WHITESPACE@121..122 " "
-    FOR_KW@122..125 "for"
-    WHITESPACE@125..126 " "
-    PATH_TYPE@126..129
-      PATH@126..129
-        PATH_SEGMENT@126..129
-          NAME_REF@126..129
-            IDENT@126..129 "Foo"
-    WHITESPACE@129..130 " "
-    ASSOC_ITEM_LIST@130..235
-      L_CURLY@130..131 "{"
-      WHITESPACE@131..134 "\n  "
-      TYPE_ALIAS@134..155
-        DEFAULT_KW@134..141 "default"
-        WHITESPACE@141..142 " "
-        TYPE_KW@142..146 "type"
-        WHITESPACE@146..147 " "
-        NAME@147..148
-          IDENT@147..148 "T"
-        WHITESPACE@148..149 " "
-        EQ@149..150 "="
-        WHITESPACE@150..151 " "
-        PATH_TYPE@151..154
-          PATH@151..154
-            PATH_SEGMENT@151..154
-              NAME_REF@151..154
-                IDENT@151..154 "Bar"
-        SEMICOLON@154..155 ";"
-      WHITESPACE@155..158 "\n  "
-      CONST@158..182
-        DEFAULT_KW@158..165 "default"
-        WHITESPACE@165..166 " "
-        CONST_KW@166..171 "const"
-        WHITESPACE@171..172 " "
-        NAME@172..173
-          IDENT@172..173 "f"
-        COLON@173..174 ":"
-        WHITESPACE@174..175 " "
-        PATH_TYPE@175..177
-          PATH@175..177
-            PATH_SEGMENT@175..177
-              NAME_REF@175..177
-                IDENT@175..177 "u8"
-        WHITESPACE@177..178 " "
-        EQ@178..179 "="
-        WHITESPACE@179..180 " "
-        LITERAL@180..181
-          INT_NUMBER@180..181 "0"
-        SEMICOLON@181..182 ";"
-      WHITESPACE@182..185 "\n  "
-      FN@185..204
-        DEFAULT_KW@185..192 "default"
-        WHITESPACE@192..193 " "
-        FN_KW@193..195 "fn"
-        WHITESPACE@195..196 " "
-        NAME@196..199
-          IDENT@196..199 "foo"
-        PARAM_LIST@199..201
-          L_PAREN@199..200 "("
-          R_PAREN@200..201 ")"
-        WHITESPACE@201..202 " "
-        BLOCK_EXPR@202..204
-          L_CURLY@202..203 "{"
-          R_CURLY@203..204 "}"
-      WHITESPACE@204..207 "\n  "
-      FN@207..233
-        DEFAULT_KW@207..214 "default"
-        WHITESPACE@214..215 " "
-        UNSAFE_KW@215..221 "unsafe"
-        WHITESPACE@221..222 " "
-        FN_KW@222..224 "fn"
-        WHITESPACE@224..225 " "
-        NAME@225..228
-          IDENT@225..228 "bar"
-        PARAM_LIST@228..230
-          L_PAREN@228..229 "("
-          R_PAREN@229..230 ")"
-        WHITESPACE@230..231 " "
-        BLOCK_EXPR@231..233
-          L_CURLY@231..232 "{"
-          R_CURLY@232..233 "}"
-      WHITESPACE@233..234 "\n"
-      R_CURLY@234..235 "}"
-  WHITESPACE@235..237 "\n\n"
-  IMPL@237..261
-    DEFAULT_KW@237..244 "default"
-    WHITESPACE@244..245 " "
-    IMPL_KW@245..249 "impl"
-    WHITESPACE@249..250 " "
-    PATH_TYPE@250..251
-      PATH@250..251
-        PATH_SEGMENT@250..251
-          NAME_REF@250..251
-            IDENT@250..251 "T"
-    WHITESPACE@251..252 " "
-    FOR_KW@252..255 "for"
-    WHITESPACE@255..256 " "
-    TUPLE_TYPE@256..258
-      L_PAREN@256..257 "("
-      R_PAREN@257..258 ")"
-    WHITESPACE@258..259 " "
-    ASSOC_ITEM_LIST@259..261
-      L_CURLY@259..260 "{"
-      R_CURLY@260..261 "}"
-  WHITESPACE@261..262 "\n"
-  IMPL@262..293
-    DEFAULT_KW@262..269 "default"
-    WHITESPACE@269..270 " "
-    UNSAFE_KW@270..276 "unsafe"
-    WHITESPACE@276..277 " "
-    IMPL_KW@277..281 "impl"
-    WHITESPACE@281..282 " "
-    PATH_TYPE@282..283
-      PATH@282..283
-        PATH_SEGMENT@282..283
-          NAME_REF@282..283
-            IDENT@282..283 "T"
-    WHITESPACE@283..284 " "
-    FOR_KW@284..287 "for"
-    WHITESPACE@287..288 " "
-    TUPLE_TYPE@288..290
-      L_PAREN@288..289 "("
-      R_PAREN@289..290 ")"
-    WHITESPACE@290..291 " "
-    ASSOC_ITEM_LIST@291..293
-      L_CURLY@291..292 "{"
-      R_CURLY@292..293 "}"
-  WHITESPACE@293..294 "\n"
diff --git a/crates/ra_syntax/test_data/parser/ok/0066_default_modifier.rs b/crates/ra_syntax/test_data/parser/ok/0066_default_modifier.rs
deleted file mode 100644
index e443e3495e..0000000000
--- a/crates/ra_syntax/test_data/parser/ok/0066_default_modifier.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-trait T {
-  default type T = Bar;
-  default const f: u8 = 0;
-  default fn foo() {}
-  default unsafe fn bar() {}
-}
-
-impl T for Foo {
-  default type T = Bar;
-  default const f: u8 = 0;
-  default fn foo() {}
-  default unsafe fn bar() {}
-}
-
-default impl T for () {}
-default unsafe impl T for () {}
diff --git a/crates/ra_syntax/test_data/parser/ok/0068_item_modifiers.rast b/crates/ra_syntax/test_data/parser/ok/0068_item_modifiers.rast
deleted file mode 100644
index 50a6d8ee9a..0000000000
--- a/crates/ra_syntax/test_data/parser/ok/0068_item_modifiers.rast
+++ /dev/null
@@ -1,218 +0,0 @@
-SOURCE_FILE@0..304
-  FN@0..17
-    ASYNC_KW@0..5 "async"
-    WHITESPACE@5..6 " "
-    FN_KW@6..8 "fn"
-    WHITESPACE@8..9 " "
-    NAME@9..12
-      IDENT@9..12 "foo"
-    PARAM_LIST@12..14
-      L_PAREN@12..13 "("
-      R_PAREN@13..14 ")"
-    WHITESPACE@14..15 " "
-    BLOCK_EXPR@15..17
-      L_CURLY@15..16 "{"
-      R_CURLY@16..17 "}"
-  WHITESPACE@17..18 "\n"
-  FN@18..36
-    ABI@18..24
-      EXTERN_KW@18..24 "extern"
-    WHITESPACE@24..25 " "
-    FN_KW@25..27 "fn"
-    WHITESPACE@27..28 " "
-    NAME@28..31
-      IDENT@28..31 "foo"
-    PARAM_LIST@31..33
-      L_PAREN@31..32 "("
-      R_PAREN@32..33 ")"
-    WHITESPACE@33..34 " "
-    BLOCK_EXPR@34..36
-      L_CURLY@34..35 "{"
-      R_CURLY@35..36 "}"
-  WHITESPACE@36..37 "\n"
-  FN@37..54
-    CONST_KW@37..42 "const"
-    WHITESPACE@42..43 " "
-    FN_KW@43..45 "fn"
-    WHITESPACE@45..46 " "
-    NAME@46..49
-      IDENT@46..49 "foo"
-    PARAM_LIST@49..51
-      L_PAREN@49..50 "("
-      R_PAREN@50..51 ")"
-    WHITESPACE@51..52 " "
-    BLOCK_EXPR@52..54
-      L_CURLY@52..53 "{"
-      R_CURLY@53..54 "}"
-  WHITESPACE@54..55 "\n"
-  FN@55..79
-    CONST_KW@55..60 "const"
-    WHITESPACE@60..61 " "
-    UNSAFE_KW@61..67 "unsafe"
-    WHITESPACE@67..68 " "
-    FN_KW@68..70 "fn"
-    WHITESPACE@70..71 " "
-    NAME@71..74
-      IDENT@71..74 "foo"
-    PARAM_LIST@74..76
-      L_PAREN@74..75 "("
-      R_PAREN@75..76 ")"
-    WHITESPACE@76..77 " "
-    BLOCK_EXPR@77..79
-      L_CURLY@77..78 "{"
-      R_CURLY@78..79 "}"
-  WHITESPACE@79..80 "\n"
-  FN@80..109
-    UNSAFE_KW@80..86 "unsafe"
-    WHITESPACE@86..87 " "
-    ABI@87..97
-      EXTERN_KW@87..93 "extern"
-      WHITESPACE@93..94 " "
-      STRING@94..97 "\"C\""
-    WHITESPACE@97..98 " "
-    FN_KW@98..100 "fn"
-    WHITESPACE@100..101 " "
-    NAME@101..104
-      IDENT@101..104 "foo"
-    PARAM_LIST@104..106
-      L_PAREN@104..105 "("
-      R_PAREN@105..106 ")"
-    WHITESPACE@106..107 " "
-    BLOCK_EXPR@107..109
-      L_CURLY@107..108 "{"
-      R_CURLY@108..109 "}"
-  WHITESPACE@109..110 "\n"
-  FN@110..128
-    UNSAFE_KW@110..116 "unsafe"
-    WHITESPACE@116..117 " "
-    FN_KW@117..119 "fn"
-    WHITESPACE@119..120 " "
-    NAME@120..123
-      IDENT@120..123 "foo"
-    PARAM_LIST@123..125
-      L_PAREN@123..124 "("
-      R_PAREN@124..125 ")"
-    WHITESPACE@125..126 " "
-    BLOCK_EXPR@126..128
-      L_CURLY@126..127 "{"
-      R_CURLY@127..128 "}"
-  WHITESPACE@128..129 "\n"
-  FN@129..153
-    ASYNC_KW@129..134 "async"
-    WHITESPACE@134..135 " "
-    UNSAFE_KW@135..141 "unsafe"
-    WHITESPACE@141..142 " "
-    FN_KW@142..144 "fn"
-    WHITESPACE@144..145 " "
-    NAME@145..148
-      IDENT@145..148 "foo"
-    PARAM_LIST@148..150
-      L_PAREN@148..149 "("
-      R_PAREN@149..150 ")"
-    WHITESPACE@150..151 " "
-    BLOCK_EXPR@151..153
-      L_CURLY@151..152 "{"
-      R_CURLY@152..153 "}"
-  WHITESPACE@153..154 "\n"
-  FN@154..178
-    CONST_KW@154..159 "const"
-    WHITESPACE@159..160 " "
-    UNSAFE_KW@160..166 "unsafe"
-    WHITESPACE@166..167 " "
-    FN_KW@167..169 "fn"
-    WHITESPACE@169..170 " "
-    NAME@170..173
-      IDENT@170..173 "bar"
-    PARAM_LIST@173..175
-      L_PAREN@173..174 "("
-      R_PAREN@174..175 ")"
-    WHITESPACE@175..176 " "
-    BLOCK_EXPR@176..178
-      L_CURLY@176..177 "{"
-      R_CURLY@177..178 "}"
-  WHITESPACE@178..180 "\n\n"
-  TRAIT@180..197
-    UNSAFE_KW@180..186 "unsafe"
-    WHITESPACE@186..187 " "
-    TRAIT_KW@187..192 "trait"
-    WHITESPACE@192..193 " "
-    NAME@193..194
-      IDENT@193..194 "T"
-    WHITESPACE@194..195 " "
-    ASSOC_ITEM_LIST@195..197
-      L_CURLY@195..196 "{"
-      R_CURLY@196..197 "}"
-  WHITESPACE@197..198 "\n"
-  TRAIT@198..213
-    AUTO_KW@198..202 "auto"
-    WHITESPACE@202..203 " "
-    TRAIT_KW@203..208 "trait"
-    WHITESPACE@208..209 " "
-    NAME@209..210
-      IDENT@209..210 "T"
-    WHITESPACE@210..211 " "
-    ASSOC_ITEM_LIST@211..213
-      L_CURLY@211..212 "{"
-      R_CURLY@212..213 "}"
-  WHITESPACE@213..214 "\n"
-  TRAIT@214..236
-    UNSAFE_KW@214..220 "unsafe"
-    WHITESPACE@220..221 " "
-    AUTO_KW@221..225 "auto"
-    WHITESPACE@225..226 " "
-    TRAIT_KW@226..231 "trait"
-    WHITESPACE@231..232 " "
-    NAME@232..233
-      IDENT@232..233 "T"
-    WHITESPACE@233..234 " "
-    ASSOC_ITEM_LIST@234..236
-      L_CURLY@234..235 "{"
-      R_CURLY@235..236 "}"
-  WHITESPACE@236..238 "\n\n"
-  IMPL@238..256
-    UNSAFE_KW@238..244 "unsafe"
-    WHITESPACE@244..245 " "
-    IMPL_KW@245..249 "impl"
-    WHITESPACE@249..250 " "
-    PATH_TYPE@250..253
-      PATH@250..253
-        PATH_SEGMENT@250..253
-          NAME_REF@250..253
-            IDENT@250..253 "Foo"
-    WHITESPACE@253..254 " "
-    ASSOC_ITEM_LIST@254..256
-      L_CURLY@254..255 "{"
-      R_CURLY@255..256 "}"
-  WHITESPACE@256..257 "\n"
-  IMPL@257..276
-    DEFAULT_KW@257..264 "default"
-    WHITESPACE@264..265 " "
-    IMPL_KW@265..269 "impl"
-    WHITESPACE@269..270 " "
-    PATH_TYPE@270..273
-      PATH@270..273
-        PATH_SEGMENT@270..273
-          NAME_REF@270..273
-            IDENT@270..273 "Foo"
-    WHITESPACE@273..274 " "
-    ASSOC_ITEM_LIST@274..276
-      L_CURLY@274..275 "{"
-      R_CURLY@275..276 "}"
-  WHITESPACE@276..277 "\n"
-  IMPL@277..303
-    UNSAFE_KW@277..283 "unsafe"
-    WHITESPACE@283..284 " "
-    DEFAULT_KW@284..291 "default"
-    WHITESPACE@291..292 " "
-    IMPL_KW@292..296 "impl"
-    WHITESPACE@296..297 " "
-    PATH_TYPE@297..300
-      PATH@297..300
-        PATH_SEGMENT@297..300
-          NAME_REF@297..300
-            IDENT@297..300 "Foo"
-    WHITESPACE@300..301 " "
-    ASSOC_ITEM_LIST@301..303
-      L_CURLY@301..302 "{"
-      R_CURLY@302..303 "}"
-  WHITESPACE@303..304 "\n"
diff --git a/crates/ra_syntax/test_data/parser/ok/0068_item_modifiers.rs b/crates/ra_syntax/test_data/parser/ok/0068_item_modifiers.rs
deleted file mode 100644
index 8d697c04b9..0000000000
--- a/crates/ra_syntax/test_data/parser/ok/0068_item_modifiers.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-async fn foo() {}
-extern fn foo() {}
-const fn foo() {}
-const unsafe fn foo() {}
-unsafe extern "C" fn foo() {}
-unsafe fn foo() {}
-async unsafe fn foo() {}
-const unsafe fn bar() {}
-
-unsafe trait T {}
-auto trait T {}
-unsafe auto trait T {}
-
-unsafe impl Foo {}
-default impl Foo {}
-unsafe default impl Foo {}