Repository: rust-analyzer/rust-analyzer
Pull request #10402 (2021-09-30 16:16:12)

fix: Don't show flyimport completions in use renames
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10367
bors r+


Patch:
diff --git a/.gitignore b/.gitignore
index f3e3cab1d6..7e097c0158 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,5 +11,3 @@ generated_assists.adoc
 generated_features.adoc
 generated_diagnostic.adoc
 .DS_Store
-/out/
-/dump.lsif
diff --git a/Cargo.lock b/Cargo.lock
index 4728627701..9da1f56dea 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -862,9 +862,9 @@ dependencies = [
 
 [[package]]
 name = "lsp-types"
-version = "0.90.0"
+version = "0.89.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7404037aab080771c90b0a499836d9d8a10336ecd07badf969567b65c6d51a1"
+checksum = "852e0dedfd52cc32325598b2631e0eba31b7b708959676a9f837042f276b09a2"
 dependencies = [
  "bitflags",
  "serde",
diff --git a/crates/base_db/src/fixture.rs b/crates/base_db/src/fixture.rs
index 017684fc83..cc1de54dfb 100644
--- a/crates/base_db/src/fixture.rs
+++ b/crates/base_db/src/fixture.rs
@@ -10,8 +10,8 @@ use tt::Subtree;
 use vfs::{file_set::FileSet, VfsPath};
 
 use crate::{
-    input::CrateName, Change, CrateDisplayName, CrateGraph, CrateId, Dependency, Edition, Env,
-    FileId, FilePosition, FileRange, ProcMacro, ProcMacroExpander, ProcMacroExpansionError,
+    input::CrateName, Change, CrateDisplayName, CrateGraph, CrateId, Edition, Env, FileId,
+    FilePosition, FileRange, ProcMacro, ProcMacroExpander, ProcMacroExpansionError,
     SourceDatabaseExt, SourceRoot, SourceRootId,
 };
 
@@ -144,9 +144,8 @@ impl ChangeFixture {
                 let prev = crates.insert(crate_name.clone(), crate_id);
                 assert!(prev.is_none());
                 for dep in meta.deps {
-                    let prelude = meta.extern_prelude.contains(&dep);
                     let dep = CrateName::normalize_dashes(&dep);
-                    crate_deps.push((crate_name.clone(), dep, prelude))
+                    crate_deps.push((crate_name.clone(), dep))
                 }
             } else if meta.path == "/main.rs" || meta.path == "/lib.rs" {
                 assert!(default_crate_root.is_none());
@@ -174,15 +173,10 @@ impl ChangeFixture {
                 Default::default(),
             );
         } else {
-            for (from, to, prelude) in crate_deps {
+            for (from, to) in crate_deps {
                 let from_id = crates[&from];
                 let to_id = crates[&to];
-                crate_graph
-                    .add_dep(
-                        from_id,
-                        Dependency::with_prelude(CrateName::new(&to).unwrap(), to_id, prelude),
-                    )
-                    .unwrap();
+                crate_graph.add_dep(from_id, CrateName::new(&to).unwrap(), to_id).unwrap();
             }
         }
 
@@ -209,9 +203,7 @@ impl ChangeFixture {
             );
 
             for krate in all_crates {
-                crate_graph
-                    .add_dep(krate, Dependency::new(CrateName::new("core").unwrap(), core_crate))
-                    .unwrap();
+                crate_graph.add_dep(krate, CrateName::new("core").unwrap(), core_crate).unwrap();
             }
         }
 
@@ -243,10 +235,7 @@ impl ChangeFixture {
 
             for krate in all_crates {
                 crate_graph
-                    .add_dep(
-                        krate,
-                        Dependency::new(CrateName::new("proc_macros").unwrap(), proc_macros_crate),
-                    )
+                    .add_dep(krate, CrateName::new("proc_macros").unwrap(), proc_macros_crate)
                     .unwrap();
             }
         }
@@ -312,7 +301,6 @@ struct FileMeta {
     path: String,
     krate: Option<String>,
     deps: Vec<String>,
-    extern_prelude: Vec<String>,
     cfg: CfgOptions,
     edition: Edition,
     env: Env,
@@ -325,12 +313,10 @@ impl From<Fixture> for FileMeta {
         f.cfg_atoms.iter().for_each(|it| cfg.insert_atom(it.into()));
         f.cfg_key_values.iter().for_each(|(k, v)| cfg.insert_key_value(k.into(), v.into()));
 
-        let deps = f.deps;
         FileMeta {
             path: f.path,
             krate: f.krate,
-            extern_prelude: f.extern_prelude.unwrap_or_else(|| deps.clone()),
-            deps,
+            deps: f.deps,
             cfg,
             edition: f.edition.as_ref().map_or(Edition::CURRENT, |v| Edition::from_str(v).unwrap()),
             env: f.env.into_iter().collect(),
diff --git a/crates/base_db/src/input.rs b/crates/base_db/src/input.rs
index 1dd7783b0e..565d0c02cf 100644
--- a/crates/base_db/src/input.rs
+++ b/crates/base_db/src/input.rs
@@ -217,22 +217,6 @@ pub struct Env {
 pub struct Dependency {
     pub crate_id: CrateId,
     pub name: CrateName,
-    prelude: bool,
-}
-
-impl Dependency {
-    pub fn new(name: CrateName, crate_id: CrateId) -> Self {
-        Self { name, crate_id, prelude: true }
-    }
-
-    pub fn with_prelude(name: CrateName, crate_id: CrateId, prelude: bool) -> Self {
-        Self { name, crate_id, prelude }
-    }
-
-    /// Whether this dependency is to be added to the depending crate's extern prelude.
-    pub fn is_prelude(&self) -> bool {
-        self.prelude
-    }
 }
 
 impl CrateGraph {
@@ -265,21 +249,22 @@ impl CrateGraph {
     pub fn add_dep(
         &mut self,
         from: CrateId,
-        dep: Dependency,
+        name: CrateName,
+        to: CrateId,
     ) -> Result<(), CyclicDependenciesError> {
         let _p = profile::span("add_dep");
 
         // Check if adding a dep from `from` to `to` creates a cycle. To figure
         // that out, look for a  path in the *opposite* direction, from `to` to
         // `from`.
-        if let Some(path) = self.find_path(&mut FxHashSet::default(), dep.crate_id, from) {
+        if let Some(path) = self.find_path(&mut FxHashSet::default(), to, from) {
             let path = path.into_iter().map(|it| (it, self[it].display_name.clone())).collect();
             let err = CyclicDependenciesError { path };
-            assert!(err.from().0 == from && err.to().0 == dep.crate_id);
+            assert!(err.from().0 == from && err.to().0 == to);
             return Err(err);
         }
 
-        self.arena.get_mut(&from).unwrap().add_dep(dep);
+        self.arena.get_mut(&from).unwrap().add_dep(name, to);
         Ok(())
     }
 
@@ -424,7 +409,7 @@ impl CrateGraph {
                     .get_mut(&std)
                     .unwrap()
                     .dependencies
-                    .push(Dependency::new(CrateName::new("cfg_if").unwrap(), cfg_if));
+                    .push(Dependency { crate_id: cfg_if, name: CrateName::new("cfg_if").unwrap() });
                 true
             }
             _ => false,
@@ -450,8 +435,8 @@ impl CrateId {
 }
 
 impl CrateData {
-    fn add_dep(&mut self, dep: Dependency) {
-        self.dependencies.push(dep)
+    fn add_dep(&mut self, name: CrateName, crate_id: CrateId) {
+        self.dependencies.push(Dependency { crate_id, name })
     }
 }
 
@@ -577,15 +562,9 @@ mod tests {
             Env::default(),
             Default::default(),
         );
-        assert!(graph
-            .add_dep(crate1, Dependency::new(CrateName::new("crate2").unwrap(), crate2))
-            .is_ok());
-        assert!(graph
-            .add_dep(crate2, Dependency::new(CrateName::new("crate3").unwrap(), crate3))
-            .is_ok());
-        assert!(graph
-            .add_dep(crate3, Dependency::new(CrateName::new("crate1").unwrap(), crate1))
-            .is_err());
+        assert!(graph.add_dep(crate1, CrateName::new("crate2").unwrap(), crate2).is_ok());
+        assert!(graph.add_dep(crate2, CrateName::new("crate3").unwrap(), crate3).is_ok());
+        assert!(graph.add_dep(crate3, CrateName::new("crate1").unwrap(), crate1).is_err());
     }
 
     #[test]
@@ -609,12 +588,8 @@ mod tests {
             Env::default(),
             Default::default(),
         );
-        assert!(graph
-            .add_dep(crate1, Dependency::new(CrateName::new("crate2").unwrap(), crate2))
-            .is_ok());
-        assert!(graph
-            .add_dep(crate2, Dependency::new(CrateName::new("crate2").unwrap(), crate2))
-            .is_err());
+        assert!(graph.add_dep(crate1, CrateName::new("crate2").unwrap(), crate2).is_ok());
+        assert!(graph.add_dep(crate2, CrateName::new("crate2").unwrap(), crate2).is_err());
     }
 
     #[test]
@@ -647,12 +622,8 @@ mod tests {
             Env::default(),
             Default::default(),
         );
-        assert!(graph
-            .add_dep(crate1, Dependency::new(CrateName::new("crate2").unwrap(), crate2))
-            .is_ok());
-        assert!(graph
-            .add_dep(crate2, Dependency::new(CrateName::new("crate3").unwrap(), crate3))
-            .is_ok());
+        assert!(graph.add_dep(crate1, CrateName::new("crate2").unwrap(), crate2).is_ok());
+        assert!(graph.add_dep(crate2, CrateName::new("crate3").unwrap(), crate3).is_ok());
     }
 
     #[test]
@@ -677,14 +648,14 @@ mod tests {
             Default::default(),
         );
         assert!(graph
-            .add_dep(
-                crate1,
-                Dependency::new(CrateName::normalize_dashes("crate-name-with-dashes"), crate2)
-            )
+            .add_dep(crate1, CrateName::normalize_dashes("crate-name-with-dashes"), crate2)
             .is_ok());
         assert_eq!(
             graph[crate1].dependencies,
-            vec![Dependency::new(CrateName::new("crate_name_with_dashes").unwrap(), crate2)]
+            vec![Dependency {
+                crate_id: crate2,
+                name: CrateName::new("crate_name_with_dashes").unwrap()
+            }]
         );
     }
 }
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index ff795d85be..879124502a 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -2504,7 +2504,9 @@ impl Type {
 
     pub fn autoderef<'a>(&'a self, db: &'a dyn HirDatabase) -> impl Iterator<Item = Type> + 'a {
         // There should be no inference vars in types passed here
-        let canonical = hir_ty::replace_errors_with_variables(&self.ty);
+        // FIXME check that?
+        let canonical =
+            Canonical { value: self.ty.clone(), binders: CanonicalVarKinds::empty(&Interner) };
         let environment = self.env.env.clone();
         let ty = InEnvironment { goal: canonical, environment };
         autoderef(db, Some(self.krate), ty)
@@ -2598,7 +2600,10 @@ impl Type {
         callback: &mut dyn FnMut(&Ty, AssocItemId) -> ControlFlow<()>,
     ) {
         // There should be no inference vars in types passed here
-        let canonical = hir_ty::replace_errors_with_variables(&self.ty);
+        // FIXME check that?
+        // FIXME replace Unknown by bound vars here
+        let canonical =
+            Canonical { value: self.ty.clone(), binders: CanonicalVarKinds::empty(&Interner) };
 
         let env = self.env.clone();
         let krate = krate.id;
diff --git a/crates/hir_def/src/generics.rs b/crates/hir_def/src/generics.rs
index 8622357cd4..0921ecea6f 100644
--- a/crates/hir_def/src/generics.rs
+++ b/crates/hir_def/src/generics.rs
@@ -7,15 +7,13 @@ use base_db::FileId;
 use either::Either;
 use hir_expand::{
     name::{AsName, Name},
-    ExpandResult, HirFileId, InFile,
+    HirFileId, InFile,
 };
 use la_arena::{Arena, ArenaMap};
-use once_cell::unsync::Lazy;
-use std::ops::DerefMut;
 use syntax::ast::{self, HasGenericParams, HasName, HasTypeBounds};
 
 use crate::{
-    body::{Expander, LowerCtx},
+    body::LowerCtx,
     child_by_source::ChildBySource,
     db::DefDatabase,
     dyn_map::DynMap,
@@ -23,8 +21,8 @@ use crate::{
     keys,
     src::{HasChildSource, HasSource},
     type_ref::{LifetimeRef, TypeBound, TypeRef},
-    AdtId, ConstParamId, GenericDefId, HasModule, LifetimeParamId, LocalConstParamId,
-    LocalLifetimeParamId, LocalTypeParamId, Lookup, TypeParamId,
+    AdtId, ConstParamId, GenericDefId, LifetimeParamId, LocalConstParamId, LocalLifetimeParamId,
+    LocalTypeParamId, Lookup, TypeParamId,
 };
 
 /// Data about a generic type parameter (to a function, struct, impl, ...).
@@ -101,23 +99,10 @@ impl GenericParams {
 
         match def {
             GenericDefId::FunctionId(id) => {
-                let loc = id.lookup(db);
-                let tree = loc.id.item_tree(db);
-                let item = &tree[loc.id.value];
-
-                let mut generic_params = GenericParams::clone(&item.explicit_generic_params);
-
-                let module = loc.container.module(db);
-                let func_data = db.function_data(id);
-
-                // Don't create an `Expander` nor call `loc.source(db)` if not needed since this
-                // causes a reparse after the `ItemTree` has been created.
-                let mut expander = Lazy::new(|| Expander::new(db, loc.source(db).file_id, module));
-                for param in &func_data.params {
-                    generic_params.fill_implicit_impl_trait_args(db, &mut expander, param);
-                }
-
-                Interned::new(generic_params)
+                let id = id.lookup(db).id;
+                let tree = id.item_tree(db);
+                let item = &tree[id.value];
+                item.generic_params.clone()
             }
             GenericDefId::AdtId(AdtId::StructId(id)) => {
                 let id = id.lookup(db).id;
@@ -274,12 +259,7 @@ impl GenericParams {
         self.where_predicates.push(predicate);
     }
 
-    pub(crate) fn fill_implicit_impl_trait_args(
-        &mut self,
-        db: &dyn DefDatabase,
-        expander: &mut impl DerefMut<Target = Expander>,
-        type_ref: &TypeRef,
-    ) {
+    pub(crate) fn fill_implicit_impl_trait_args(&mut self, type_ref: &TypeRef) {
         type_ref.walk(&mut |type_ref| {
             if let TypeRef::ImplTrait(bounds) = type_ref {
                 let param = TypeParamData {
@@ -295,18 +275,6 @@ impl GenericParams {
                     });
                 }
             }
-            if let TypeRef::Macro(mc) = type_ref {
-                let macro_call = mc.to_node(db.upcast());
-                match expander.enter_expand::<ast::Type>(db, macro_call) {
-                    Ok(ExpandResult { value: Some((mark, expanded)), .. }) => {
-                        let ctx = LowerCtx::new(db, expander.current_file_id());
-                        let type_ref = TypeRef::from_ast(&ctx, expanded);
-                        self.fill_implicit_impl_trait_args(db, expander, &type_ref);
-                        expander.exit(db, mark);
-                    }
-                    _ => {}
-                }
-            }
         });
     }
 
diff --git a/crates/hir_def/src/item_tree.rs b/crates/hir_def/src/item_tree.rs
index 3900e7e97c..df46ceeaee 100644
--- a/crates/hir_def/src/item_tree.rs
+++ b/crates/hir_def/src/item_tree.rs
@@ -605,7 +605,7 @@ pub struct ExternBlock {
 pub struct Function {
     pub name: Name,
     pub visibility: RawVisibilityId,
-    pub explicit_generic_params: Interned<GenericParams>,
+    pub generic_params: Interned<GenericParams>,
     pub abi: Option<Interned<str>>,
     pub params: IdRange<Param>,
     pub ret_type: Interned<TypeRef>,
diff --git a/crates/hir_def/src/item_tree/lower.rs b/crates/hir_def/src/item_tree/lower.rs
index 9c278f5ac6..6d34556b3e 100644
--- a/crates/hir_def/src/item_tree/lower.rs
+++ b/crates/hir_def/src/item_tree/lower.rs
@@ -401,7 +401,7 @@ impl<'a> Ctx<'a> {
         let mut res = Function {
             name,
             visibility,
-            explicit_generic_params: Interned::new(GenericParams::default()),
+            generic_params: Interned::new(GenericParams::default()),
             abi,
             params,
             ret_type: Interned::new(ret_type),
@@ -409,8 +409,7 @@ impl<'a> Ctx<'a> {
             ast_id,
             flags,
         };
-        res.explicit_generic_params =
-            self.lower_generic_params(GenericsOwner::Function(&res), func);
+        res.generic_params = self.lower_generic_params(GenericsOwner::Function(&res), func);
 
         Some(id(self.data().functions.alloc(res)))
     }
@@ -665,8 +664,16 @@ impl<'a> Ctx<'a> {
     ) -> Interned<GenericParams> {
         let mut generics = GenericParams::default();
         match owner {
-            GenericsOwner::Function(_)
-            | GenericsOwner::Struct
+            GenericsOwner::Function(func) => {
+                generics.fill(&self.body_ctx, node);
+                // lower `impl Trait` in arguments
+                for id in func.params.clone() {
+                    if let Param::Normal(ty) = &self.data().params[id] {
+                        generics.fill_implicit_impl_trait_args(ty);
+                    }
+                }
+            }
+            GenericsOwner::Struct
             | GenericsOwner::Enum
             | GenericsOwner::Union
             | GenericsOwner::TypeAlias => {
diff --git a/crates/hir_def/src/item_tree/pretty.rs b/crates/hir_def/src/item_tree/pretty.rs
index 49dc1eef18..3e33b0c46c 100644
--- a/crates/hir_def/src/item_tree/pretty.rs
+++ b/crates/hir_def/src/item_tree/pretty.rs
@@ -234,7 +234,7 @@ impl<'a> Printer<'a> {
                 let Function {
                     name,
                     visibility,
-                    explicit_generic_params,
+                    generic_params,
                     abi,
                     params,
                     ret_type,
@@ -250,7 +250,7 @@ impl<'a> Printer<'a> {
                     w!(self, "extern \"{}\" ", abi);
                 }
                 w!(self, "fn {}", name);
-                self.print_generic_params(explicit_generic_params);
+                self.print_generic_params(generic_params);
                 w!(self, "(");
                 if !params.is_empty() {
                     self.indented(|this| {
@@ -271,7 +271,7 @@ impl<'a> Printer<'a> {
                 }
                 w!(self, ") -> ");
                 self.print_type_ref(ret_type);
-                self.print_where_clause(explicit_generic_params);
+                self.print_where_clause(generic_params);
                 wln!(self, ";");
             }
             ModItem::Struct(it) => {
diff --git a/crates/hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs
index 53ab87005c..d6762d1acf 100644
--- a/crates/hir_def/src/nameres/collector.rs
+++ b/crates/hir_def/src/nameres/collector.rs
@@ -61,17 +61,14 @@ pub(super) fn collect_defs(
 ) -> DefMap {
     let crate_graph = db.crate_graph();
 
-    let mut deps = FxHashMap::default();
-    // populate external prelude and dependency list
-    for dep in &crate_graph[def_map.krate].dependencies {
-        tracing::debug!("crate dep {:?} -> {:?}", dep.name, dep.crate_id);
-        let dep_def_map = db.crate_def_map(dep.crate_id);
-        let dep_root = dep_def_map.module_id(dep_def_map.root);
-
-        deps.insert(dep.as_name(), dep_root.into());
-
-        if dep.is_prelude() && block.is_none() {
-            def_map.extern_prelude.insert(dep.as_name(), dep_root.into());
+    if block.is_none() {
+        // populate external prelude
+        for dep in &crate_graph[def_map.krate].dependencies {
+            tracing::debug!("crate dep {:?} -> {:?}", dep.name, dep.crate_id);
+            let dep_def_map = db.crate_def_map(dep.crate_id);
+            def_map
+                .extern_prelude
+                .insert(dep.as_name(), dep_def_map.module_id(dep_def_map.root).into());
         }
     }
 
@@ -90,7 +87,6 @@ pub(super) fn collect_defs(
     let mut collector = DefCollector {
         db,
         def_map,
-        deps,
         glob_imports: FxHashMap::default(),
         unresolved_imports: Vec::new(),
         resolved_imports: Vec::new(),
@@ -243,7 +239,6 @@ struct DefData<'a> {
 struct DefCollector<'a> {
     db: &'a dyn DefDatabase,
     def_map: DefMap,
-    deps: FxHashMap<Name, ModuleDefId>,
     glob_imports: FxHashMap<LocalModuleId, Vec<(LocalModuleId, Visibility)>>,
     unresolved_imports: Vec<ImportDirective>,
     resolved_imports: Vec<ImportDirective>,
@@ -665,7 +660,7 @@ impl DefCollector<'_> {
             self.def_map.edition,
         );
 
-        let res = self.resolve_extern_crate(&extern_crate.name);
+        let res = self.def_map.resolve_name_in_extern_prelude(self.db, &extern_crate.name);
 
         if let Some(ModuleDefId::ModuleId(m)) = res.take_types() {
             if m == self.def_map.module_id(current_module_id) {
@@ -725,13 +720,13 @@ impl DefCollector<'_> {
     fn resolve_import(&self, module_id: LocalModuleId, import: &Import) -> PartialResolvedImport {
         tracing::debug!("resolving import: {:?} ({:?})", import, self.def_map.edition);
         if import.is_extern_crate {
-            let name = import
-                .path
-                .as_ident()
-                .expect("extern crate should have been desugared to one-element path");
-
-            let res = self.resolve_extern_crate(name);
-
+            let res = self.def_map.resolve_name_in_extern_prelude(
+                self.db,
+                import
+                    .path
+                    .as_ident()
+                    .expect("extern crate should have been desugared to one-element path"),
+            );
             if res.is_none() {
                 PartialResolvedImport::Unresolved
             } else {
@@ -771,24 +766,6 @@ impl DefCollector<'_> {
         }
     }
 
-    fn resolve_extern_crate(&self, name: &Name) -> PerNs {
-        let arc;
-        let root = match self.def_map.block {
-            Some(_) => {
-                arc = self.def_map.crate_root(self.db).def_map(self.db);
-                &*arc
-            }
-            None => &self.def_map,
-        };
-
-        if name == &name!(self) {
-            cov_mark::hit!(extern_crate_self_as);
-            PerNs::types(root.module_id(root.root()).into(), Visibility::Public)
-        } else {
-            self.deps.get(name).map_or(PerNs::none(), |&it| PerNs::types(it, Visibility::Public))
-        }
-    }
-
     fn record_resolved_import(&mut self, directive: &ImportDirective) {
         let module_id = directive.module_id;
         let import = &directive.import;
@@ -2032,7 +2009,6 @@ mod tests {
         let mut collector = DefCollector {
             db,
             def_map,
-            deps: FxHashMap::default(),
             glob_imports: FxHashMap::default(),
             unresolved_imports: Vec::new(),
             resolved_imports: Vec::new(),
diff --git a/crates/hir_def/src/nameres/path_resolution.rs b/crates/hir_def/src/nameres/path_resolution.rs
index 4fb81bde46..e71805bc8e 100644
--- a/crates/hir_def/src/nameres/path_resolution.rs
+++ b/crates/hir_def/src/nameres/path_resolution.rs
@@ -11,6 +11,7 @@
 //! `ReachedFixedPoint` signals about this.
 
 use base_db::Edition;
+use hir_expand::name;
 use hir_expand::name::Name;
 
 use crate::{
@@ -64,6 +65,11 @@ impl DefMap {
         db: &dyn DefDatabase,
         name: &Name,
     ) -> PerNs {
+        if name == &name!(self) {
+            cov_mark::hit!(extern_crate_self_as);
+            return PerNs::types(self.module_id(self.root).into(), Visibility::Public);
+        }
+
         let arc;
         let root = match self.block {
             Some(_) => {
diff --git a/crates/hir_expand/src/builtin_macro.rs b/crates/hir_expand/src/builtin_macro.rs
index 3d63e05195..297497ac1b 100644
--- a/crates/hir_expand/src/builtin_macro.rs
+++ b/crates/hir_expand/src/builtin_macro.rs
@@ -103,7 +103,6 @@ register_builtin! {
     (assert, Assert) => assert_expand,
     (stringify, Stringify) => stringify_expand,
     (format_args, FormatArgs) => format_args_expand,
-    (const_format_args, ConstFormatArgs) => format_args_expand,
     // format_args_nl only differs in that it adds a newline in the end,
     // so we use the same stub expansion for now
     (format_args_nl, FormatArgsNl) => format_args_expand,
@@ -181,29 +180,22 @@ fn assert_expand(
     _id: MacroCallId,
     tt: &tt::Subtree,
 ) -> ExpandResult<tt::Subtree> {
-    let krate = tt::Ident { text: "$crate".into(), id: tt::TokenId::unspecified() };
+    // A hacky implementation for goto def and hover
+    // We expand `assert!(cond, arg1, arg2)` to
+    // ```
+    // {(cond, &(arg1), &(arg2));}
+    // ```,
+    // which is wrong but useful.
+
     let args = parse_exprs_with_sep(tt, ',');
-    let expanded = match &*args {
-        [cond, panic_args @ ..] => {
-            let comma = tt::Subtree {
-                delimiter: None,
-                token_trees: vec![tt::TokenTree::Leaf(tt::Leaf::Punct(tt::Punct {
-                    char: ',',
-                    spacing: tt::Spacing::Alone,
-                    id: tt::TokenId::unspecified(),
-                }))],
-            };
-            let cond = cond.clone();
-            let panic_args = itertools::Itertools::intersperse(panic_args.iter().cloned(), comma);
-            quote! {{
-                if !#cond {
-                    #krate::panic!(##panic_args);
-                }
-            }}
-        }
-        [] => quote! {{}},
-    };
 
+    let arg_tts = args.into_iter().flat_map(|arg| {
+        quote! { &(#arg), }
+    }.token_trees);
+
+    let expanded = quote! {
+        { { (##arg_tts); } }
+    };
     ExpandResult::ok(expanded)
 }
 
@@ -739,7 +731,7 @@ mod tests {
             }
             assert!(true, "{} {:?}", arg1(a, b, c), arg2);
             "#,
-            expect![[r#"{if!true{$crate::panic!("{} {:?}",arg1(a,b,c),arg2);}}"#]],
+            expect![["{{(&(true), &(\"{} {:?}\"), &(arg1(a,b,c)), &(arg2),);}}"]],
         );
     }
 
diff --git a/crates/hir_expand/src/name.rs b/crates/hir_expand/src/name.rs
index 9c844c6138..4750d65d19 100644
--- a/crates/hir_expand/src/name.rs
+++ b/crates/hir_expand/src/name.rs
@@ -211,7 +211,6 @@ pub mod known {
         // Builtin macros
         file,
         column,
-        const_format_args,
         compile_error,
         line,
         module_path,
diff --git a/crates/ide/src/fixture.rs b/crates/ide/src/fixture.rs
index 2ea6f6a9ab..700f4dc955 100644
--- a/crates/ide/src/fixture.rs
+++ b/crates/ide/src/fixture.rs
@@ -66,22 +66,3 @@ pub(crate) fn annotations(ra_fixture: &str) -> (Analysis, FilePosition, Vec<(Fil
         .collect();
     (host.analysis(), FilePosition { file_id, offset }, annotations)
 }
-
-/// Creates analysis from a multi-file fixture with annonations without $0
-pub(crate) fn annotations_without_marker(ra_fixture: &str) -> (Analysis, Vec<(FileRange, String)>) {
-    let mut host = AnalysisHost::default();
-    let change_fixture = ChangeFixture::parse(ra_fixture);
-    host.db.set_enable_proc_attr_macros(true);
-    host.db.apply_change(change_fixture.change);
-
-    let annotations = change_fixture
-        .files
-        .iter()
-        .flat_map(|&file_id| {
-            let file_text = host.analysis().file_text(file_id).unwrap();
-            let annotations = extract_annotations(&file_text);
-            annotations.into_iter().map(move |(range, data)| (FileRange { file_id, range }, data))
-        })
-        .collect();
-    (host.analysis(), annotations)
-}
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs
index dbfa99bdf2..21872c81d1 100644
--- a/crates/ide/src/lib.rs
+++ b/crates/ide/src/lib.rs
@@ -46,7 +46,6 @@ mod references;
 mod rename;
 mod runnables;
 mod ssr;
-mod static_index;
 mod status;
 mod syntax_highlighting;
 mod syntax_tree;
@@ -87,7 +86,6 @@ pub use crate::{
     references::ReferenceSearchResult,
     rename::RenameError,
     runnables::{Runnable, RunnableKind, TestId},
-    static_index::{StaticIndex, StaticIndexedFile, TokenId, TokenStaticData},
     syntax_highlighting::{
         tags::{Highlight, HlMod, HlMods, HlOperator, HlPunct, HlTag},
         HlRange,
diff --git a/crates/ide/src/static_index.rs b/crates/ide/src/static_index.rs
deleted file mode 100644
index aa62e2eae5..0000000000
--- a/crates/ide/src/static_index.rs
+++ /dev/null
@@ -1,256 +0,0 @@
-//! This module provides `StaticIndex` which is used for powering
-//! read-only code browsers and emitting LSIF
-
-use std::collections::HashMap;
-
-use hir::Semantics;
-use hir::{db::HirDatabase, Crate, Module};
-use ide_db::base_db::{FileId, FileRange, SourceDatabaseExt};
-use ide_db::defs::Definition;
-use ide_db::RootDatabase;
-use rustc_hash::FxHashSet;
-use syntax::{AstNode, SyntaxKind::*, T};
-use syntax::{SyntaxToken, TextRange};
-
-use crate::display::TryToNav;
-use crate::hover::hover_for_definition;
-use crate::{Analysis, Fold, HoverConfig, HoverDocFormat, HoverResult};
-
-/// A static representation of fully analyzed source code.
-///
-/// The intended use-case is powering read-only code browsers and emitting LSIF
-pub struct StaticIndex<'a> {
-    pub files: Vec<StaticIndexedFile>,
-    pub tokens: TokenStore,
-    analysis: &'a Analysis,
-    db: &'a RootDatabase,
-    def_map: HashMap<Definition, TokenId>,
-}
-
-pub struct ReferenceData {
-    pub range: FileRange,
-    pub is_definition: bool,
-}
-
-pub struct TokenStaticData {
-    pub hover: Option<HoverResult>,
-    pub definition: Option<FileRange>,
-    pub references: Vec<ReferenceData>,
-}
-
-#[derive(Clone, Copy, PartialEq, Eq, Hash)]
-pub struct TokenId(usize);
-
-#[derive(Default)]
-pub struct TokenStore(Vec<TokenStaticData>);
-
-impl TokenStore {
-    pub fn insert(&mut self, data: TokenStaticData) -> TokenId {
-        let id = TokenId(self.0.len());
-        self.0.push(data);
-        id
-    }
-
-    pub fn get_mut(&mut self, id: TokenId) -> Option<&mut TokenStaticData> {
-        self.0.get_mut(id.0)
-    }
-
-    pub fn get(&self, id: TokenId) -> Option<&TokenStaticData> {
-        self.0.get(id.0)
-    }
-
-    pub fn iter(self) -> impl Iterator<Item = (TokenId, TokenStaticData)> {
-        self.0.into_iter().enumerate().map(|(i, x)| (TokenId(i), x))
-    }
-}
-
-pub struct StaticIndexedFile {
-    pub file_id: FileId,
-    pub folds: Vec<Fold>,
-    pub tokens: Vec<(TextRange, TokenId)>,
-}
-
-fn all_modules(db: &dyn HirDatabase) -> Vec<Module> {
-    let mut worklist: Vec<_> =
-        Crate::all(db).into_iter().map(|krate| krate.root_module(db)).collect();
-    let mut modules = Vec::new();
-
-    while let Some(module) = worklist.pop() {
-        modules.push(module);
-        worklist.extend(module.children(db));
-    }
-
-    modules
-}
-
-impl StaticIndex<'_> {
-    fn add_file(&mut self, file_id: FileId) {
-        let folds = self.analysis.folding_ranges(file_id).unwrap();
-        // hovers
-        let sema = hir::Semantics::new(self.db);
-        let tokens_or_nodes = sema.parse(file_id).syntax().clone();
-        let tokens = tokens_or_nodes.descendants_with_tokens().filter_map(|x| match x {
-            syntax::NodeOrToken::Node(_) => None,
-            syntax::NodeOrToken::Token(x) => Some(x),
-        });
-        let hover_config =
-            HoverConfig { links_in_hover: true, documentation: Some(HoverDocFormat::Markdown) };
-        let tokens = tokens.filter(|token| match token.kind() {
-            IDENT | INT_NUMBER | LIFETIME_IDENT | T![self] | T![super] | T![crate] => true,
-            _ => false,
-        });
-        let mut result = StaticIndexedFile { file_id, folds, tokens: vec![] };
-        for token in tokens {
-            let range = token.text_range();
-            let node = token.parent().unwrap();
-            let def = if let Some(x) = get_definition(&sema, token.clone()) {
-                x
-            } else {
-                continue;
-            };
-            let id = if let Some(x) = self.def_map.get(&def) {
-                *x
-            } else {
-                let x = self.tokens.insert(TokenStaticData {
-                    hover: hover_for_definition(&sema, file_id, def, &node, &hover_config),
-                    definition: def
-                        .try_to_nav(self.db)
-                        .map(|x| FileRange { file_id: x.file_id, range: x.focus_or_full_range() }),
-                    references: vec![],
-                });
-                self.def_map.insert(def, x);
-                x
-            };
-            let token = self.tokens.get_mut(id).unwrap();
-            token.references.push(ReferenceData {
-                range: FileRange { range, file_id },
-                is_definition: if let Some(x) = def.try_to_nav(self.db) {
-                    x.file_id == file_id && x.focus_or_full_range() == range
-                } else {
-                    false
-                },
-            });
-            result.tokens.push((range, id));
-        }
-        self.files.push(result);
-    }
-
-    pub fn compute<'a>(db: &'a RootDatabase, analysis: &'a Analysis) -> StaticIndex<'a> {
-        let work = all_modules(db).into_iter().filter(|module| {
-            let file_id = module.definition_source(db).file_id.original_file(db);
-            let source_root = db.file_source_root(file_id);
-            let source_root = db.source_root(source_root);
-            !source_root.is_library
-        });
-        let mut this = StaticIndex {
-            files: vec![],
-            tokens: Default::default(),
-            analysis,
-            db,
-            def_map: Default::default(),
-        };
-        let mut visited_files = FxHashSet::default();
-        for module in work {
-            let file_id = module.definition_source(db).file_id.original_file(db);
-            if visited_files.contains(&file_id) {
-                continue;
-            }
-            this.add_file(file_id);
-            // mark the file
-            visited_files.insert(file_id);
-        }
-        this
-    }
-}
-
-fn get_definition(sema: &Semantics<RootDatabase>, token: SyntaxToken) -> Option<Definition> {
-    for token in sema.descend_into_macros_many(token) {
-        let def = Definition::from_token(&sema, &token);
-        if let [x] = def.as_slice() {
-            return Some(*x);
-        } else {
-            continue;
-        };
-    }
-    None
-}
-
-#[cfg(test)]
-mod tests {
-    use crate::{fixture, StaticIndex};
-    use ide_db::base_db::FileRange;
-    use std::collections::HashSet;
-
-    fn check_all_ranges(ra_fixture: &str) {
-        let (analysis, ranges) = fixture::annotations_without_marker(ra_fixture);
-        let s = StaticIndex::compute(&*analysis.db, &analysis);
-        let mut range_set: HashSet<_> = ranges.iter().map(|x| x.0).collect();
-        for f in s.files {
-            for (range, _) in f.tokens {
-                let x = FileRange { file_id: f.file_id, range };
-                if !range_set.contains(&x) {
-                    panic!("additional range {:?}", x);
-                }
-                range_set.remove(&x);
-            }
-        }
-        if !range_set.is_empty() {
-            panic!("unfound ranges {:?}", range_set);
-        }
-    }
-
-    fn check_definitions(ra_fixture: &str) {
-        let (analysis, ranges) = fixture::annotations_without_marker(ra_fixture);
-        let s = StaticIndex::compute(&*analysis.db, &analysis);
-        let mut range_set: HashSet<_> = ranges.iter().map(|x| x.0).collect();
-        for (_, t) in s.tokens.iter() {
-            if let Some(x) = t.definition {
-                if !range_set.contains(&x) {
-                    panic!("additional definition {:?}", x);
-                }
-                range_set.remove(&x);
-            }
-        }
-        if !range_set.is_empty() {
-            panic!("unfound definitions {:?}", range_set);
-        }
-    }
-
-    #[test]
-    fn struct_and_enum() {
-        check_all_ranges(
-            r#"
-struct Foo;
-     //^^^
-enum E { X(Foo) }
-   //^   ^ ^^^
-"#,
-        );
-        check_definitions(
-            r#"
-struct Foo;
-     //^^^
-enum E { X(Foo) }
-   //^   ^
-"#,
-        );
-    }
-
-    #[test]
-    fn derives() {
-        check_all_ranges(
-            r#"
-#[rustc_builtin_macro]
-pub macro Copy {}
-        //^^^^
-#[rustc_builtin_macro]
-pub macro derive {}
-        //^^^^^^
-#[derive(Copy)]
-//^^^^^^ ^^^^
-struct Hello(i32);
-     //^^^^^ ^^^
-"#,
-        );
-    }
-}
diff --git a/crates/ide/src/syntax_highlighting/format.rs b/crates/ide/src/syntax_highlighting/format.rs
index b755a945cd..5bbadb0f45 100644
--- a/crates/ide/src/syntax_highlighting/format.rs
+++ b/crates/ide/src/syntax_highlighting/format.rs
@@ -31,19 +31,14 @@ fn is_format_string(string: &ast::String) -> Option<()> {
     let parent = string.syntax().parent()?;
 
     let name = parent.parent().and_then(ast::MacroCall::cast)?.path()?.segment()?.name_ref()?;
-    if !matches!(
-        name.text().as_str(),
-        "format_args" | "format_args_nl" | "const_format_args" | "panic_2015" | "panic_2021"
-    ) {
+    if !matches!(name.text().as_str(), "format_args" | "format_args_nl") {
         return None;
     }
 
-    // NB: we match against `panic_2015`/`panic_2021` here because they have a special-cased arm for
-    // `"{}"`, which otherwise wouldn't get highlighted.
-
     let first_literal = parent
         .children_with_tokens()
-        .find_map(|it| it.as_token().cloned().and_then(ast::String::cast))?;
+        .filter_map(|it| it.as_token().cloned().and_then(ast::String::cast))
+        .next()?;
     if &first_literal != string {
         return None;
     }
diff --git a/crates/ide_assists/src/handlers/inline_call.rs b/crates/ide_assists/src/handlers/inline_call.rs
index d252d61a69..14313fefa7 100644
--- a/crates/ide_assists/src/handlers/inline_call.rs
+++ b/crates/ide_assists/src/handlers/inline_call.rs
@@ -4,14 +4,14 @@ use hir::{db::HirDatabase, HasSource, PathResolution, Semantics, TypeInfo};
 use ide_db::{
     base_db::{FileId, FileRange},
     defs::Definition,
-    helpers::{insert_use::remove_path_if_in_use_stmt, node_ext::expr_as_name_ref},
+    helpers::insert_use::remove_path_if_in_use_stmt,
     path_transform::PathTransform,
     search::{FileReference, SearchScope},
     RootDatabase,
 };
 use itertools::{izip, Itertools};
 use syntax::{
-    ast::{self, edit_in_place::Indent, HasArgList, PathExpr},
+    ast::{self, edit_in_place::Indent, HasArgList},
     ted, AstNode, SyntaxNode,
 };
 
@@ -359,17 +359,11 @@ fn inline(
     }
     // Inline parameter expressions or generate `let` statements depending on whether inlining works or not.
     for ((pat, param_ty, _), usages, expr) in izip!(params, param_use_nodes, arguments).rev() {
-        let inline_direct = |usage, replacement: &ast::Expr| {
-            if let Some(field) = path_expr_as_record_field(usage) {
-                cov_mark::hit!(inline_call_inline_direct_field);
-                field.replace_expr(replacement.clone_for_update());
-            } else {
-                ted::replace(usage.syntax(), &replacement.syntax().clone_for_update());
-            }
-        };
-        // izip confuses RA due to our lack of hygiene info currently losing us typeinfo
-        let usages: &[ast::PathExpr] = &*usages;
-        match usages {
+        let expr_is_name_ref = matches!(&expr,
+            ast::Expr::PathExpr(expr)
+                if expr.path().and_then(|path| path.as_single_name_ref()).is_some()
+        );
+        match &*usages {
             // inline single use closure arguments
             [usage]
                 if matches!(expr, ast::Expr::ClosureExpr(_))
@@ -377,19 +371,21 @@ fn inline(
             {
                 cov_mark::hit!(inline_call_inline_closure);
                 let expr = make::expr_paren(expr.clone());
-                inline_direct(usage, &expr);
+                ted::replace(usage.syntax(), expr.syntax().clone_for_update());
             }
             // inline single use literals
             [usage] if matches!(expr, ast::Expr::Literal(_)) => {
                 cov_mark::hit!(inline_call_inline_literal);
-                inline_direct(usage, &expr);
+                ted::replace(usage.syntax(), expr.syntax().clone_for_update());
             }
             // inline direct local arguments
-            [_, ..] if expr_as_name_ref(&expr).is_some() => {
+            [_, ..] if expr_is_name_ref => {
                 cov_mark::hit!(inline_call_inline_locals);
-                usages.into_iter().for_each(|usage| inline_direct(usage, &expr));
+                usages.into_iter().for_each(|usage| {
+                    ted::replace(usage.syntax(), &expr.syntax().clone_for_update());
+                });
             }
-            // can't inline, emit a let statement
+            // cant inline, emit a let statement
             _ => {
                 let ty =
                     sema.type_of_expr(expr).filter(TypeInfo::has_adjustment).and(param_ty.clone());
@@ -425,12 +421,6 @@ fn inline(
     }
 }
 
-fn path_expr_as_record_field(usage: &PathExpr) -> Option<ast::RecordExprField> {
-    let path = usage.path()?;
-    let name_ref = path.as_single_name_ref()?;
-    ast::RecordExprField::for_name_ref(&name_ref)
-}
-
 #[cfg(test)]
 mod tests {
     use crate::tests::{check_assist, check_assist_not_applicable};
@@ -1032,61 +1022,6 @@ fn foo$0() {
 fn foo() {
     foo$0();
 }
-"#,
-        );
-    }
-
-    #[test]
-    fn inline_call_field_shorthand() {
-        cov_mark::check!(inline_call_inline_direct_field);
-        check_assist(
-            inline_call,
-            r#"
-struct Foo {
-    field: u32,
-    field1: u32,
-    field2: u32,
-    field3: u32,
-}
-fn foo(field: u32, field1: u32, val2: u32, val3: u32) -> Foo {
-    Foo {
-        field,
-        field1,
-        field2: val2,
-        field3: val3,
-    }
-}
-fn main() {
-    let bar = 0;
-    let baz = 0;
-    foo$0(bar, 0, baz, 0);
-}
-"#,
-            r#"
-struct Foo {
-    field: u32,
-    field1: u32,
-    field2: u32,
-    field3: u32,
-}
-fn foo(field: u32, field1: u32, val2: u32, val3: u32) -> Foo {
-    Foo {
-        field,
-        field1,
-        field2: val2,
-        field3: val3,
-    }
-}
-fn main() {
-    let bar = 0;
-    let baz = 0;
-    Foo {
-            field: bar,
-            field1: 0,
-            field2: baz,
-            field3: 0,
-        };
-}
 "#,
         );
     }
diff --git a/crates/ide_assists/src/handlers/move_from_mod_rs.rs b/crates/ide_assists/src/handlers/move_from_mod_rs.rs
deleted file mode 100644
index 026f4aaf6c..0000000000
--- a/crates/ide_assists/src/handlers/move_from_mod_rs.rs
+++ /dev/null
@@ -1,130 +0,0 @@
-use ide_db::{
-    assists::{AssistId, AssistKind},
-    base_db::AnchoredPathBuf,
-};
-use syntax::{ast, AstNode};
-
-use crate::{
-    assist_context::{AssistContext, Assists},
-    utils::trimmed_text_range,
-};
-
-// Assist: move_from_mod_rs
-//
-// Moves xxx/mod.rs to xxx.rs.
-//
-// ```
-// //- /main.rs
-// mod a;
-// //- /a/mod.rs
-// $0fn t() {}$0
-// ```
-// ->
-// ```
-// fn t() {}
-// ```
-pub(crate) fn move_from_mod_rs(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
-    let source_file = ctx.find_node_at_offset::<ast::SourceFile>()?;
-    let module = ctx.sema.to_module_def(ctx.frange.file_id)?;
-    // Enable this assist if the user select all "meaningful" content in the source file
-    let trimmed_selected_range = trimmed_text_range(&source_file, ctx.frange.range);
-    let trimmed_file_range = trimmed_text_range(&source_file, source_file.syntax().text_range());
-    if !module.is_mod_rs(ctx.db()) {
-        cov_mark::hit!(not_mod_rs);
-        return None;
-    }
-    if trimmed_selected_range != trimmed_file_range {
-        cov_mark::hit!(not_all_selected);
-        return None;
-    }
-
-    let target = source_file.syntax().text_range();
-    let module_name = module.name(ctx.db())?.to_string();
-    let path = format!("../{}.rs", module_name);
-    let dst = AnchoredPathBuf { anchor: ctx.frange.file_id, path };
-    acc.add(
-        AssistId("move_from_mod_rs", AssistKind::Refactor),
-        format!("Convert {}/mod.rs to {}.rs", module_name, module_name),
-        target,
-        |builder| {
-            builder.move_file(ctx.frange.file_id, dst);
-        },
-    )
-}
-
-#[cfg(test)]
-mod tests {
-    use crate::tests::{check_assist, check_assist_not_applicable};
-
-    use super::*;
-
-    #[test]
-    fn trivial() {
-        check_assist(
-            move_from_mod_rs,
-            r#"
-//- /main.rs
-mod a;
-//- /a/mod.rs
-$0fn t() {}
-$0"#,
-            r#"
-//- /a.rs
-fn t() {}
-"#,
-        );
-    }
-
-    #[test]
-    fn must_select_all_file() {
-        cov_mark::check!(not_all_selected);
-        check_assist_not_applicable(
-            move_from_mod_rs,
-            r#"
-//- /main.rs
-mod a;
-//- /a/mod.rs
-fn t() {}$0
-"#,
-        );
-        cov_mark::check!(not_all_selected);
-        check_assist_not_applicable(
-            move_from_mod_rs,
-            r#"
-//- /main.rs
-mod a;
-//- /a/mod.rs
-$0fn$0 t() {}
-"#,
-        );
-    }
-
-    #[test]
-    fn cannot_move_not_mod_rs() {
-        cov_mark::check!(not_mod_rs);
-        check_assist_not_applicable(
-            move_from_mod_rs,
-            r#"//- /main.rs
-mod a;
-//- /a.rs
-$0fn t() {}$0
-"#,
-        );
-    }
-
-    #[test]
-    fn cannot_downgrade_main_and_lib_rs() {
-        check_assist_not_applicable(
-            move_from_mod_rs,
-            r#"//- /main.rs
-$0fn t() {}$0
-"#,
-        );
-        check_assist_not_applicable(
-            move_from_mod_rs,
-            r#"//- /lib.rs
-$0fn t() {}$0
-"#,
-        );
-    }
-}
diff --git a/crates/ide_assists/src/handlers/move_to_mod_rs.rs b/crates/ide_assists/src/handlers/move_to_mod_rs.rs
index 6f505de4cf..9b060bb710 100644
--- a/crates/ide_assists/src/handlers/move_to_mod_rs.rs
+++ b/crates/ide_assists/src/handlers/move_to_mod_rs.rs
@@ -2,13 +2,39 @@ use ide_db::{
     assists::{AssistId, AssistKind},
     base_db::AnchoredPathBuf,
 };
-use syntax::{ast, AstNode};
-
-use crate::{
-    assist_context::{AssistContext, Assists},
-    utils::trimmed_text_range,
+use syntax::{
+    ast::{self, Whitespace},
+    AstNode, AstToken, SourceFile, TextRange, TextSize,
 };
 
+use crate::assist_context::{AssistContext, Assists};
+
+/// Trim(remove leading and trailing whitespace) `initial_range` in `source_file`, return the trimmed range.
+fn trimmed_text_range(source_file: &SourceFile, initial_range: TextRange) -> TextRange {
+    let mut trimmed_range = initial_range;
+    while source_file
+        .syntax()
+        .token_at_offset(trimmed_range.start())
+        .find_map(Whitespace::cast)
+        .is_some()
+        && trimmed_range.start() < trimmed_range.end()
+    {
+        let start = trimmed_range.start() + TextSize::from(1);
+        trimmed_range = TextRange::new(start, trimmed_range.end());
+    }
+    while source_file
+        .syntax()
+        .token_at_offset(trimmed_range.end())
+        .find_map(Whitespace::cast)
+        .is_some()
+        && trimmed_range.start() < trimmed_range.end()
+    {
+        let end = trimmed_range.end() - TextSize::from(1);
+        trimmed_range = TextRange::new(trimmed_range.start(), end);
+    }
+    trimmed_range
+}
+
 // Assist: move_to_mod_rs
 //
 // Moves xxx.rs to xxx/mod.rs.
@@ -38,13 +64,16 @@ pub(crate) fn move_to_mod_rs(acc: &mut Assists, ctx: &AssistContext) -> Option<(
         return None;
     }
 
-    let target = source_file.syntax().text_range();
+    let target = TextRange::new(
+        source_file.syntax().text_range().start(),
+        source_file.syntax().text_range().end(),
+    );
     let module_name = module.name(ctx.db())?.to_string();
     let path = format!("./{}/mod.rs", module_name);
     let dst = AnchoredPathBuf { anchor: ctx.frange.file_id, path };
     acc.add(
         AssistId("move_to_mod_rs", AssistKind::Refactor),
-        format!("Convert {}.rs to {}/mod.rs", module_name, module_name),
+        format!("Turn {}.rs to {}/mod.rs", module_name, module_name),
         target,
         |builder| {
             builder.move_file(ctx.frange.file_id, dst);
diff --git a/crates/ide_assists/src/lib.rs b/crates/ide_assists/src/lib.rs
index d41d06f2d9..255ff47b80 100644
--- a/crates/ide_assists/src/lib.rs
+++ b/crates/ide_assists/src/lib.rs
@@ -154,7 +154,6 @@ mod handlers {
     mod move_guard;
     mod move_module_to_file;
     mod move_to_mod_rs;
-    mod move_from_mod_rs;
     mod pull_assignment_up;
     mod qualify_path;
     mod raw_string;
@@ -230,7 +229,6 @@ mod handlers {
             move_guard::move_guard_to_arm_body,
             move_module_to_file::move_module_to_file,
             move_to_mod_rs::move_to_mod_rs,
-            move_from_mod_rs::move_from_mod_rs,
             pull_assignment_up::pull_assignment_up,
             qualify_path::qualify_path,
             raw_string::add_hash,
diff --git a/crates/ide_assists/src/utils.rs b/crates/ide_assists/src/utils.rs
index dfb22afc7e..9bc70bc3fe 100644
--- a/crates/ide_assists/src/utils.rs
+++ b/crates/ide_assists/src/utils.rs
@@ -14,11 +14,11 @@ use syntax::{
         self,
         edit::{self, AstNodeEdit},
         edit_in_place::AttrsOwnerEdit,
-        make, HasArgList, HasAttrs, HasGenericParams, HasName, HasTypeBounds, Whitespace,
+        make, HasArgList, HasAttrs, HasGenericParams, HasName, HasTypeBounds,
     },
-    ted, AstNode, AstToken, Direction, SmolStr, SourceFile,
+    ted, AstNode, Direction, SmolStr,
     SyntaxKind::*,
-    SyntaxNode, TextRange, TextSize, T,
+    SyntaxNode, TextSize, T,
 };
 
 use crate::assist_context::{AssistBuilder, AssistContext};
@@ -74,12 +74,7 @@ pub fn extract_trivial_expression(block_expr: &ast::BlockExpr) -> Option<ast::Ex
 pub fn test_related_attribute(fn_def: &ast::Fn) -> Option<ast::Attr> {
     fn_def.attrs().find_map(|attr| {
         let path = attr.path()?;
-        let text = path.syntax().text().to_string();
-        if text.starts_with("test") || text.ends_with("test") {
-            Some(attr)
-        } else {
-            None
-        }
+        path.syntax().text().to_string().contains("test").then(|| attr)
     })
 }
 
@@ -505,29 +500,3 @@ pub(crate) fn get_methods(items: &ast::AssocItemList) -> Vec<ast::Fn> {
         .filter(|f| f.name().is_some())
         .collect()
 }
-
-/// Trim(remove leading and trailing whitespace) `initial_range` in `source_file`, return the trimmed range.
-pub(crate) fn trimmed_text_range(source_file: &SourceFile, initial_range: TextRange) -> TextRange {
-    let mut trimmed_range = initial_range;
-    while source_file
-        .syntax()
-        .token_at_offset(trimmed_range.start())
-        .find_map(Whitespace::cast)
-        .is_some()
-        && trimmed_range.start() < trimmed_range.end()
-    {
-        let start = trimmed_range.start() + TextSize::from(1);
-        trimmed_range = TextRange::new(start, trimmed_range.end());
-    }
-    while source_file
-        .syntax()
-        .token_at_offset(trimmed_range.end())
-        .find_map(Whitespace::cast)
-        .is_some()
-        && trimmed_range.start() < trimmed_range.end()
-    {
-        let end = trimmed_range.end() - TextSize::from(1);
-        trimmed_range = TextRange::new(trimmed_range.start(), end);
-    }
-    trimmed_range
-}
diff --git a/crates/ide_completion/src/completions/dot.rs b/crates/ide_completion/src/completions/dot.rs
index 213cb70170..94a5ebabf9 100644
--- a/crates/ide_completion/src/completions/dot.rs
+++ b/crates/ide_completion/src/completions/dot.rs
@@ -697,26 +697,4 @@ fn f() {
             "#]],
         );
     }
-
-    #[test]
-    fn completes_method_call_when_receiver_type_has_errors_issue_10297() {
-        check(
-            r#"
-//- minicore: iterator, sized
-struct Vec<T>;
-impl<T> IntoIterator for Vec<T> {
-    type Item = ();
-    type IntoIter = ();
-    fn into_iter(self);
-}
-fn main() {
-    let x: Vec<_>;
-    x.$0;
-}
-"#,
-            expect![[r#"
-                me into_iter() (as IntoIterator) fn(self) -> <Self as IntoIterator>::IntoIter
-            "#]],
-        )
-    }
 }
diff --git a/crates/ide_completion/src/completions/flyimport.rs b/crates/ide_completion/src/completions/flyimport.rs
index 9e6d26640e..d7c8c54315 100644
--- a/crates/ide_completion/src/completions/flyimport.rs
+++ b/crates/ide_completion/src/completions/flyimport.rs
@@ -1220,4 +1220,17 @@ fn function() {
             "#]],
         );
     }
+
+    #[test]
+    fn flyimport_rename() {
+        check(
+            r#"
+mod module {
+    pub struct Struct;
+}
+use self as Str$0;
+    "#,
+            expect![[r#""#]],
+        );
+    }
 }
diff --git a/crates/ide_completion/src/completions/keyword.rs b/crates/ide_completion/src/completions/keyword.rs
index 31aabd98d3..9a4cd8628a 100644
--- a/crates/ide_completion/src/completions/keyword.rs
+++ b/crates/ide_completion/src/completions/keyword.rs
@@ -64,7 +64,6 @@ pub(crate) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte
         && (expects_item || ctx.expects_non_trait_assoc_item() || ctx.expect_field())
     {
         add_keyword("pub(crate)", "pub(crate)");
-        add_keyword("pub(super)", "pub(super)");
         add_keyword("pub", "pub");
     }
 
diff --git a/crates/ide_completion/src/context.rs b/crates/ide_completion/src/context.rs
index 9d3e894a3d..ddf8722bc8 100644
--- a/crates/ide_completion/src/context.rs
+++ b/crates/ide_completion/src/context.rs
@@ -383,6 +383,7 @@ impl<'a> CompletionContext<'a> {
                         | ImmediateLocation::ModDeclaration(_)
                         | ImmediateLocation::RecordPat(_)
                         | ImmediateLocation::RecordExpr(_)
+                        | ImmediateLocation::Rename
                 )
             )
     }
diff --git a/crates/ide_completion/src/patterns.rs b/crates/ide_completion/src/patterns.rs
index 381a6a83aa..d5d81bf2f1 100644
--- a/crates/ide_completion/src/patterns.rs
+++ b/crates/ide_completion/src/patterns.rs
@@ -32,6 +32,7 @@ pub(crate) enum ImmediatePrevSibling {
 pub(crate) enum ImmediateLocation {
     Use,
     UseTree,
+    Rename,
     Impl,
     Trait,
     RecordField,
@@ -201,6 +202,7 @@ pub(crate) fn determine_location(
             ast::Use(_it) => ImmediateLocation::Use,
             ast::UseTree(_it) => ImmediateLocation::UseTree,
             ast::UseTreeList(_it) => ImmediateLocation::UseTree,
+            ast::Rename(_it) => ImmediateLocation::Rename,
             ast::StmtList(_it) => ImmediateLocation::StmtList,
             ast::SourceFile(_it) => ImmediateLocation::ItemList,
             ast::ItemList(_it) => ImmediateLocation::ItemList,
diff --git a/crates/ide_db/src/helpers/node_ext.rs b/crates/ide_db/src/helpers/node_ext.rs
index 82178ed749..fe823f74f8 100644
--- a/crates/ide_db/src/helpers/node_ext.rs
+++ b/crates/ide_db/src/helpers/node_ext.rs
@@ -7,16 +7,18 @@ use syntax::{
 pub fn expr_as_name_ref(expr: &ast::Expr) -> Option<ast::NameRef> {
     if let ast::Expr::PathExpr(expr) = expr {
         let path = expr.path()?;
-        path.as_single_name_ref()
-    } else {
-        None
+        let segment = path.segment()?;
+        let name_ref = segment.name_ref()?;
+        if path.qualifier().is_none() {
+            return Some(name_ref);
+        }
     }
+    None
 }
 
 pub fn block_as_lone_tail(block: &ast::BlockExpr) -> Option<ast::Expr> {
     block.statements().next().is_none().then(|| block.tail_expr()).flatten()
 }
-
 /// Preorder walk all the expression's child expressions.
 pub fn walk_expr(expr: &ast::Expr, cb: &mut dyn FnMut(ast::Expr)) {
     preorder_expr(expr, &mut |ev| {
diff --git a/crates/project_model/src/project_json.rs b/crates/project_model/src/project_json.rs
index 75ad66a5cc..5db1aa1b4f 100644
--- a/crates/project_model/src/project_json.rs
+++ b/crates/project_model/src/project_json.rs
@@ -83,8 +83,9 @@ impl ProjectJson {
                         deps: crate_data
                             .deps
                             .into_iter()
-                            .map(|dep_data| {
-                                Dependency::new(dep_data.name, CrateId(dep_data.krate as u32))
+                            .map(|dep_data| Dependency {
+                                crate_id: CrateId(dep_data.krate as u32),
+                                name: dep_data.name,
                             })
                             .collect::<Vec<_>>(),
                         cfg: crate_data.cfg,
diff --git a/crates/project_model/src/sysroot.rs b/crates/project_model/src/sysroot.rs
index 153cbc1c84..6c17492948 100644
--- a/crates/project_model/src/sysroot.rs
+++ b/crates/project_model/src/sysroot.rs
@@ -4,7 +4,7 @@
 //! but we can't process `.rlib` and need source code instead. The source code
 //! is typically installed with `rustup component add rust-src` command.
 
-use std::{convert::TryFrom, env, fs, iter, ops, path::PathBuf, process::Command};
+use std::{convert::TryFrom, env, fs, ops, path::PathBuf, process::Command};
 
 use anyhow::{format_err, Result};
 use la_arena::{Arena, Idx};
@@ -39,15 +39,10 @@ impl Sysroot {
         &self.root
     }
 
-    pub fn public_deps(&self) -> impl Iterator<Item = (&'static str, SysrootCrate, bool)> + '_ {
+    pub fn public_deps(&self) -> impl Iterator<Item = (&'static str, SysrootCrate)> + '_ {
         // core is added as a dependency before std in order to
         // mimic rustcs dependency order
-        ["core", "alloc", "std"]
-            .iter()
-            .copied()
-            .zip(iter::repeat(true))
-            .chain(iter::once(("test", false)))
-            .filter_map(move |(name, prelude)| Some((name, self.by_name(name)?, prelude)))
+        ["core", "alloc", "std"].iter().filter_map(move |&it| Some((it, self.by_name(it)?)))
     }
 
     pub fn proc_macro(&self) -> Option<SysrootCrate> {
diff --git a/crates/project_model/src/workspace.rs b/crates/project_model/src/workspace.rs
index 714e2dd301..282116c297 100644
--- a/crates/project_model/src/workspace.rs
+++ b/crates/project_model/src/workspace.rs
@@ -5,9 +5,7 @@
 use std::{collections::VecDeque, convert::TryFrom, fmt, fs, process::Command};
 
 use anyhow::{format_err, Context, Result};
-use base_db::{
-    CrateDisplayName, CrateGraph, CrateId, CrateName, Dependency, Edition, Env, FileId, ProcMacro,
-};
+use base_db::{CrateDisplayName, CrateGraph, CrateId, CrateName, Edition, Env, FileId, ProcMacro};
 use cfg::{CfgDiff, CfgOptions};
 use paths::{AbsPath, AbsPathBuf};
 use rustc_hash::{FxHashMap, FxHashSet};
@@ -470,7 +468,9 @@ fn project_json_to_crate_graph(
     for (from, krate) in project.crates() {
         if let Some(&from) = crates.get(&from) {
             if let Some((public_deps, libproc_macro)) = &sysroot_deps {
-                public_deps.add(from, &mut crate_graph);
+                for (name, to) in public_deps.iter() {
+                    add_dep(&mut crate_graph, from, name.clone(), *to)
+                }
                 if krate.is_proc_macro {
                     if let Some(proc_macro) = libproc_macro {
                         add_dep(
@@ -507,7 +507,7 @@ fn cargo_to_crate_graph(
     let mut crate_graph = CrateGraph::default();
     let (public_deps, libproc_macro) = match sysroot {
         Some(sysroot) => sysroot_to_crate_graph(&mut crate_graph, sysroot, rustc_cfg.clone(), load),
-        None => (SysrootPublicDeps::default(), None),
+        None => (Vec::new(), None),
     };
 
     let mut cfg_options = CfgOptions::default();
@@ -588,7 +588,9 @@ fn cargo_to_crate_graph(
                     add_dep(&mut crate_graph, *from, name, to);
                 }
             }
-            public_deps.add(*from, &mut crate_graph);
+            for (name, krate) in public_deps.iter() {
+                add_dep(&mut crate_graph, *from, name.clone(), *krate);
+            }
         }
     }
 
@@ -670,7 +672,9 @@ fn detached_files_to_crate_graph(
             Vec::new(),
         );
 
-        public_deps.add(detached_file_crate, &mut crate_graph);
+        for (name, krate) in public_deps.iter() {
+            add_dep(&mut crate_graph, detached_file_crate, name.clone(), *krate);
+        }
     }
     crate_graph
 }
@@ -682,7 +686,7 @@ fn handle_rustc_crates(
     cfg_options: &CfgOptions,
     load_proc_macro: &mut dyn FnMut(&AbsPath) -> Vec<ProcMacro>,
     pkg_to_lib_crate: &mut FxHashMap<la_arena::Idx<crate::PackageData>, CrateId>,
-    public_deps: &SysrootPublicDeps,
+    public_deps: &[(CrateName, CrateId)],
     cargo: &CargoWorkspace,
     pkg_crates: &FxHashMap<la_arena::Idx<crate::PackageData>, Vec<(CrateId, TargetKind)>>,
 ) {
@@ -722,7 +726,9 @@ fn handle_rustc_crates(
                     );
                     pkg_to_lib_crate.insert(pkg, crate_id);
                     // Add dependencies on core / std / alloc for this crate
-                    public_deps.add(crate_id, crate_graph);
+                    for (name, krate) in public_deps.iter() {
+                        add_dep(crate_graph, crate_id, name.clone(), *krate);
+                    }
                     rustc_pkg_crates.entry(pkg).or_insert_with(Vec::new).push(crate_id);
                 }
             }
@@ -820,26 +826,12 @@ fn add_target_crate_root(
     )
 }
 
-#[derive(Default)]
-struct SysrootPublicDeps {
-    deps: Vec<(CrateName, CrateId, bool)>,
-}
-
-impl SysrootPublicDeps {
-    /// Makes `from` depend on the public sysroot crates.
-    fn add(&self, from: CrateId, crate_graph: &mut CrateGraph) {
-        for (name, krate, prelude) in &self.deps {
-            add_dep_with_prelude(crate_graph, from, name.clone(), *krate, *prelude);
-        }
-    }
-}
-
 fn sysroot_to_crate_graph(
     crate_graph: &mut CrateGraph,
     sysroot: &Sysroot,
     rustc_cfg: Vec<CfgFlag>,
     load: &mut dyn FnMut(&AbsPath) -> Option<FileId>,
-) -> (SysrootPublicDeps, Option<CrateId>) {
+) -> (Vec<(CrateName, CrateId)>, Option<CrateId>) {
     let _p = profile::span("sysroot_to_crate_graph");
     let mut cfg_options = CfgOptions::default();
     cfg_options.extend(rustc_cfg);
@@ -873,35 +865,17 @@ fn sysroot_to_crate_graph(
         }
     }
 
-    let public_deps = SysrootPublicDeps {
-        deps: sysroot
-            .public_deps()
-            .map(|(name, idx, prelude)| {
-                (CrateName::new(name).unwrap(), sysroot_crates[&idx], prelude)
-            })
-            .collect::<Vec<_>>(),
-    };
+    let public_deps = sysroot
+        .public_deps()
+        .map(|(name, idx)| (CrateName::new(name).unwrap(), sysroot_crates[&idx]))
+        .collect::<Vec<_>>();
 
     let libproc_macro = sysroot.proc_macro().and_then(|it| sysroot_crates.get(&it).copied());
     (public_deps, libproc_macro)
 }
 
 fn add_dep(graph: &mut CrateGraph, from: CrateId, name: CrateName, to: CrateId) {
-    add_dep_inner(graph, from, Dependency::new(name, to))
-}
-
-fn add_dep_with_prelude(
-    graph: &mut CrateGraph,
-    from: CrateId,
-    name: CrateName,
-    to: CrateId,
-    prelude: bool,
-) {
-    add_dep_inner(graph, from, Dependency::with_prelude(name, to, prelude))
-}
-
-fn add_dep_inner(graph: &mut CrateGraph, from: CrateId, dep: Dependency) {
-    if let Err(err) = graph.add_dep(from, dep) {
+    if let Err(err) = graph.add_dep(from, name, to) {
         tracing::error!("{}", err)
     }
 }
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml
index 29a3fbb67e..1dfa23414d 100644
--- a/crates/rust-analyzer/Cargo.toml
+++ b/crates/rust-analyzer/Cargo.toml
@@ -22,7 +22,7 @@ crossbeam-channel = "0.5.0"
 dissimilar = "1.0.2"
 itertools = "0.10.0"
 jod-thread = "0.1.0"
-lsp-types = { version = "0.90.0", features = ["proposed"] }
+lsp-types = { version = "0.89.0", features = ["proposed"] }
 parking_lot = "0.11.0"
 xflags = "0.2.1"
 oorandom = "11.1.2"
diff --git a/crates/rust-analyzer/src/bin/main.rs b/crates/rust-analyzer/src/bin/main.rs
index 74c041020b..2390bee824 100644
--- a/crates/rust-analyzer/src/bin/main.rs
+++ b/crates/rust-analyzer/src/bin/main.rs
@@ -87,7 +87,6 @@ fn try_main() -> Result<()> {
         flags::RustAnalyzerCmd::Diagnostics(cmd) => cmd.run()?,
         flags::RustAnalyzerCmd::Ssr(cmd) => cmd.run()?,
         flags::RustAnalyzerCmd::Search(cmd) => cmd.run()?,
-        flags::RustAnalyzerCmd::Lsif(cmd) => cmd.run()?,
     }
     Ok(())
 }
diff --git a/crates/rust-analyzer/src/cli.rs b/crates/rust-analyzer/src/cli.rs
index 6ccdaa86dd..efd8a2aa9f 100644
--- a/crates/rust-analyzer/src/cli.rs
+++ b/crates/rust-analyzer/src/cli.rs
@@ -8,7 +8,6 @@ mod highlight;
 mod analysis_stats;
 mod diagnostics;
 mod ssr;
-mod lsif;
 
 mod progress_report;
 
diff --git a/crates/rust-analyzer/src/cli/analysis_stats.rs b/crates/rust-analyzer/src/cli/analysis_stats.rs
index 55a542c3c1..a2dc842e75 100644
--- a/crates/rust-analyzer/src/cli/analysis_stats.rs
+++ b/crates/rust-analyzer/src/cli/analysis_stats.rs
@@ -367,6 +367,8 @@ fn expr_syntax_range(
 ) -> Option<(VfsPath, LineCol, LineCol)> {
     let src = sm.expr_syntax(expr_id);
     if let Ok(src) = src {
+        // FIXME: it might be nice to have a function (on Analysis?) that goes from Source<T> -> (LineCol, LineCol) directly
+        // But also, we should just turn the type mismatches into diagnostics and provide these
         let root = db.parse_or_expand(src.file_id).unwrap();
         let node = src.map(|e| e.to_node(&root).syntax().clone());
         let original_range = node.as_ref().original_file_range(db);
diff --git a/crates/rust-analyzer/src/cli/flags.rs b/crates/rust-analyzer/src/cli/flags.rs
index b759d912c9..e2e250143c 100644
--- a/crates/rust-analyzer/src/cli/flags.rs
+++ b/crates/rust-analyzer/src/cli/flags.rs
@@ -102,10 +102,6 @@ xflags::xflags! {
         }
 
         cmd proc-macro {}
-
-        cmd lsif
-            required path: PathBuf
-        {}
     }
 }
 
@@ -133,7 +129,6 @@ pub enum RustAnalyzerCmd {
     Ssr(Ssr),
     Search(Search),
     ProcMacro(ProcMacro),
-    Lsif(Lsif),
 }
 
 #[derive(Debug)]
@@ -195,11 +190,6 @@ pub struct Search {
 #[derive(Debug)]
 pub struct ProcMacro;
 
-#[derive(Debug)]
-pub struct Lsif {
-    pub path: PathBuf,
-}
-
 impl RustAnalyzer {
     pub const HELP: &'static str = Self::HELP_;
 
diff --git a/crates/rust-analyzer/src/cli/lsif.rs b/crates/rust-analyzer/src/cli/lsif.rs
deleted file mode 100644
index a235443146..0000000000
--- a/crates/rust-analyzer/src/cli/lsif.rs
+++ /dev/null
@@ -1,268 +0,0 @@
-//! LSIF (language server index format) generator
-
-use std::collections::HashMap;
-use std::env;
-use std::time::Instant;
-
-use ide::{
-    Analysis, FileId, FileRange, RootDatabase, StaticIndex, StaticIndexedFile, TokenId,
-    TokenStaticData,
-};
-use ide_db::LineIndexDatabase;
-
-use ide_db::base_db::salsa::{self, ParallelDatabase};
-use lsp_types::{self, lsif};
-use project_model::{CargoConfig, ProjectManifest, ProjectWorkspace};
-use vfs::{AbsPathBuf, Vfs};
-
-use crate::cli::{
-    flags,
-    load_cargo::{load_workspace, LoadCargoConfig},
-    Result,
-};
-use crate::line_index::{LineEndings, LineIndex, OffsetEncoding};
-use crate::to_proto;
-
-/// Need to wrap Snapshot to provide `Clone` impl for `map_with`
-struct Snap<DB>(DB);
-impl<DB: ParallelDatabase> Clone for Snap<salsa::Snapshot<DB>> {
-    fn clone(&self) -> Snap<salsa::Snapshot<DB>> {
-        Snap(self.0.snapshot())
-    }
-}
-
-struct LsifManager<'a> {
-    count: i32,
-    token_map: HashMap<TokenId, Id>,
-    range_map: HashMap<FileRange, Id>,
-    file_map: HashMap<FileId, Id>,
-    analysis: &'a Analysis,
-    db: &'a RootDatabase,
-    vfs: &'a Vfs,
-}
-
-#[derive(Clone, Copy)]
-struct Id(i32);
-
-impl From<Id> for lsp_types::NumberOrString {
-    fn from(Id(x): Id) -> Self {
-        lsp_types::NumberOrString::Number(x)
-    }
-}
-
-impl LsifManager<'_> {
-    fn new<'a>(analysis: &'a Analysis, db: &'a RootDatabase, vfs: &'a Vfs) -> LsifManager<'a> {
-        LsifManager {
-            count: 0,
-            token_map: HashMap::default(),
-            range_map: HashMap::default(),
-            file_map: HashMap::default(),
-            analysis,
-            db,
-            vfs,
-        }
-    }
-
-    fn add(&mut self, data: lsif::Element) -> Id {
-        let id = Id(self.count);
-        self.emit(&serde_json::to_string(&lsif::Entry { id: id.into(), data }).unwrap());
-        self.count += 1;
-        id
-    }
-
-    fn add_vertex(&mut self, vertex: lsif::Vertex) -> Id {
-        self.add(lsif::Element::Vertex(vertex))
-    }
-
-    fn add_edge(&mut self, edge: lsif::Edge) -> Id {
-        self.add(lsif::Element::Edge(edge))
-    }
-
-    // FIXME: support file in addition to stdout here
-    fn emit(&self, data: &str) {
-        println!("{}", data);
-    }
-
-    fn get_token_id(&mut self, id: TokenId) -> Id {
-        if let Some(x) = self.token_map.get(&id) {
-            return *x;
-        }
-        let result_set_id = self.add_vertex(lsif::Vertex::ResultSet(lsif::ResultSet { key: None }));
-        self.token_map.insert(id, result_set_id);
-        result_set_id
-    }
-
-    fn get_range_id(&mut self, id: FileRange) -> Id {
-        if let Some(x) = self.range_map.get(&id) {
-            return *x;
-        }
-        let file_id = id.file_id;
-        let doc_id = self.get_file_id(file_id);
-        let line_index = self.db.line_index(file_id);
-        let line_index = LineIndex {
-            index: line_index.clone(),
-            encoding: OffsetEncoding::Utf16,
-            endings: LineEndings::Unix,
-        };
-        let range_id = self.add_vertex(lsif::Vertex::Range {
-            range: to_proto::range(&line_index, id.range),
-            tag: None,
-        });
-        self.add_edge(lsif::Edge::Contains(lsif::EdgeDataMultiIn {
-            in_vs: vec![range_id.into()],
-            out_v: doc_id.into(),
-        }));
-        range_id
-    }
-
-    fn get_file_id(&mut self, id: FileId) -> Id {
-        if let Some(x) = self.file_map.get(&id) {
-            return *x;
-        }
-        let path = self.vfs.file_path(id);
-        let path = path.as_path().unwrap();
-        let doc_id = self.add_vertex(lsif::Vertex::Document(lsif::Document {
-            language_id: "rust".to_string(),
-            uri: lsp_types::Url::from_file_path(path).unwrap(),
-        }));
-        self.file_map.insert(id, doc_id);
-        doc_id
-    }
-
-    fn add_token(&mut self, id: TokenId, token: TokenStaticData) {
-        let result_set_id = self.get_token_id(id);
-        if let Some(hover) = token.hover {
-            let hover_id = self.add_vertex(lsif::Vertex::HoverResult {
-                result: lsp_types::Hover {
-                    contents: lsp_types::HoverContents::Markup(to_proto::markup_content(
-                        hover.markup,
-                    )),
-                    range: None,
-                },
-            });
-            self.add_edge(lsif::Edge::Hover(lsif::EdgeData {
-                in_v: hover_id.into(),
-                out_v: result_set_id.into(),
-            }));
-        }
-        if let Some(def) = token.definition {
-            let result_id = self.add_vertex(lsif::Vertex::DefinitionResult);
-            let def_vertex = self.get_range_id(def);
-            self.add_edge(lsif::Edge::Item(lsif::Item {
-                document: (*self.file_map.get(&def.file_id).unwrap()).into(),
-                property: None,
-                edge_data: lsif::EdgeDataMultiIn {
-                    in_vs: vec![def_vertex.into()],
-                    out_v: result_id.into(),
-                },
-            }));
-            self.add_edge(lsif::Edge::Definition(lsif::EdgeData {
-                in_v: result_id.into(),
-                out_v: result_set_id.into(),
-            }));
-        }
-        if !token.references.is_empty() {
-            let result_id = self.add_vertex(lsif::Vertex::ReferenceResult);
-            self.add_edge(lsif::Edge::References(lsif::EdgeData {
-                in_v: result_id.into(),
-                out_v: result_set_id.into(),
-            }));
-            for x in token.references {
-                let vertex = *self.range_map.get(&x.range).unwrap();
-                self.add_edge(lsif::Edge::Item(lsif::Item {
-                    document: (*self.file_map.get(&x.range.file_id).unwrap()).into(),
-                    property: Some(if x.is_definition {
-                        lsif::ItemKind::Definitions
-                    } else {
-                        lsif::ItemKind::References
-                    }),
-                    edge_data: lsif::EdgeDataMultiIn {
-                        in_vs: vec![vertex.into()],
-                        out_v: result_id.into(),
-                    },
-                }));
-            }
-        }
-    }
-
-    fn add_file(&mut self, file: StaticIndexedFile) {
-        let StaticIndexedFile { file_id, tokens, folds } = file;
-        let doc_id = self.get_file_id(file_id);
-        let text = self.analysis.file_text(file_id).unwrap();
-        let line_index = self.db.line_index(file_id);
-        let line_index = LineIndex {
-            index: line_index.clone(),
-            encoding: OffsetEncoding::Utf16,
-            endings: LineEndings::Unix,
-        };
-        let result = folds
-            .into_iter()
-            .map(|it| to_proto::folding_range(&*text, &line_index, false, it))
-            .collect();
-        let folding_id = self.add_vertex(lsif::Vertex::FoldingRangeResult { result });
-        self.add_edge(lsif::Edge::FoldingRange(lsif::EdgeData {
-            in_v: folding_id.into(),
-            out_v: doc_id.into(),
-        }));
-        let tokens_id = tokens
-            .into_iter()
-            .map(|(range, id)| {
-                let range_id = self.add_vertex(lsif::Vertex::Range {
-                    range: to_proto::range(&line_index, range),
-                    tag: None,
-                });
-                self.range_map.insert(FileRange { file_id, range }, range_id);
-                let result_set_id = self.get_token_id(id);
-                self.add_edge(lsif::Edge::Next(lsif::EdgeData {
-                    in_v: result_set_id.into(),
-                    out_v: range_id.into(),
-                }));
-                range_id.into()
-            })
-            .collect();
-        self.add_edge(lsif::Edge::Contains(lsif::EdgeDataMultiIn {
-            in_vs: tokens_id,
-            out_v: doc_id.into(),
-        }));
-    }
-}
-
-impl flags::Lsif {
-    pub fn run(self) -> Result<()> {
-        eprintln!("Generating LSIF started...");
-        let now = Instant::now();
-        let cargo_config = CargoConfig::default();
-        let no_progress = &|_| ();
-        let load_cargo_config = LoadCargoConfig {
-            load_out_dirs_from_check: true,
-            with_proc_macro: true,
-            prefill_caches: false,
-        };
-        let path = AbsPathBuf::assert(env::current_dir()?.join(&self.path));
-        let manifest = ProjectManifest::discover_single(&path)?;
-
-        let workspace = ProjectWorkspace::load(manifest, &cargo_config, no_progress)?;
-
-        let (host, vfs, _proc_macro) = load_workspace(workspace, &load_cargo_config)?;
-        let db = host.raw_database();
-        let analysis = host.analysis();
-
-        let si = StaticIndex::compute(db, &analysis);
-
-        let mut lsif = LsifManager::new(&analysis, db, &vfs);
-        lsif.add_vertex(lsif::Vertex::MetaData(lsif::MetaData {
-            version: String::from("0.5.0"),
-            project_root: lsp_types::Url::from_file_path(path).unwrap(),
-            position_encoding: lsif::Encoding::Utf16,
-            tool_info: None,
-        }));
-        for file in si.files {
-            lsif.add_file(file);
-        }
-        for (id, token) in si.tokens.iter() {
-            lsif.add_token(id, token);
-        }
-        eprintln!("Generating LSIF finished in {:?}", now.elapsed());
-        Ok(())
-    }
-}
diff --git a/crates/syntax/src/ast/edit_in_place.rs b/crates/syntax/src/ast/edit_in_place.rs
index d271b5f836..4b354f7b32 100644
--- a/crates/syntax/src/ast/edit_in_place.rs
+++ b/crates/syntax/src/ast/edit_in_place.rs
@@ -451,35 +451,6 @@ impl ast::RecordExprFieldList {
     }
 }
 
-impl ast::RecordExprField {
-    /// This will either replace the initializer, or in the case that this is a shorthand convert
-    /// the initializer into the name ref and insert the expr as the new initializer.
-    pub fn replace_expr(&self, expr: ast::Expr) {
-        if let Some(_) = self.name_ref() {
-            match self.expr() {
-                Some(prev) => ted::replace(prev.syntax(), expr.syntax()),
-                None => ted::append_child(self.syntax(), expr.syntax()),
-            }
-            return;
-        }
-        // this is a shorthand
-        if let Some(ast::Expr::PathExpr(path_expr)) = self.expr() {
-            if let Some(path) = path_expr.path() {
-                if let Some(name_ref) = path.as_single_name_ref() {
-                    path_expr.syntax().detach();
-                    let children = vec![
-                        name_ref.syntax().clone().into(),
-                        ast::make::token(T![:]).into(),
-                        ast::make::tokens::single_space().into(),
-                        expr.syntax().clone().into(),
-                    ];
-                    ted::insert_all_raw(Position::last_child_of(self.syntax()), children);
-                }
-            }
-        }
-    }
-}
-
 impl ast::StmtList {
     pub fn push_front(&self, statement: ast::Stmt) {
         ted::insert(Position::after(self.l_curly_token().unwrap()), statement.syntax());
diff --git a/crates/vfs/src/vfs_path.rs b/crates/vfs/src/vfs_path.rs
index ffd673573a..0ad56e00d7 100644
--- a/crates/vfs/src/vfs_path.rs
+++ b/crates/vfs/src/vfs_path.rs
@@ -359,7 +359,6 @@ impl VirtualPath {
             }
             path = &path["../".len()..]
         }
-        path = path.trim_start_matches("./");
         res.0 = format!("{}/{}", res.0, path);
         Some(res)
     }
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index da04eec92b..a595814635 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -63,8 +63,6 @@ async function tryActivate(context: vscode.ExtensionContext) {
     activateInlayHints(ctx);
     warnAboutExtensionConflicts();
 
-    ctx.pushCleanup(configureLanguage());
-
     vscode.workspace.onDidChangeConfiguration(
         _ => ctx?.client?.sendNotification('workspace/didChangeConfiguration', { settings: "" }),
         null,
@@ -476,54 +474,3 @@ function warnAboutExtensionConflicts() {
             .then(() => { }, console.error);
     };
 }
-
-/**
- * Sets up additional language configuration that's impossible to do via a
- * separate language-configuration.json file. See [1] for more information.
- *
- * [1]: https://github.com/Microsoft/vscode/issues/11514#issuecomment-244707076
- */
-function configureLanguage(): vscode.Disposable {
-    const indentAction = vscode.IndentAction.None;
-    return vscode.languages.setLanguageConfiguration('rust', {
-        onEnterRules: [
-            {
-                // Doc single-line comment
-                // e.g. ///|
-                beforeText: /^\s*\/{3}.*$/,
-                action: { indentAction, appendText: '/// ' },
-            },
-            {
-                // Parent doc single-line comment
-                // e.g. //!|
-                beforeText: /^\s*\/{2}\!.*$/,
-                action: { indentAction, appendText: '//! ' },
-            },
-            {
-                // Begins an auto-closed multi-line comment (standard or parent doc)
-                // e.g. /** | */ or /*! | */
-                beforeText: /^\s*\/\*(\*|\!)(?!\/)([^\*]|\*(?!\/))*$/,
-                afterText: /^\s*\*\/$/,
-                action: { indentAction: vscode.IndentAction.IndentOutdent, appendText: ' * ' },
-            },
-            {
-                // Begins a multi-line comment (standard or parent doc)
-                // e.g. /** ...| or /*! ...|
-                beforeText: /^\s*\/\*(\*|\!)(?!\/)([^\*]|\*(?!\/))*$/,
-                action: { indentAction, appendText: ' * ' },
-            },
-            {
-                // Continues a multi-line comment
-                // e.g.  * ...|
-                beforeText: /^(\ \ )*\ \*(\ ([^\*]|\*(?!\/))*)?$/,
-                action: { indentAction, appendText: '* ' },
-            },
-            {
-                // Dedents after closing a multi-line comment
-                // e.g.  */|
-                beforeText: /^(\ \ )*\ \*\/\s*$/,
-                action: { indentAction, removeText: 1 },
-            },
-        ],
-    });
-}


Test patch:
diff --git a/crates/hir_def/src/item_tree/tests.rs b/crates/hir_def/src/item_tree/tests.rs
index 7671ccefd1..a153e17b17 100644
--- a/crates/hir_def/src/item_tree/tests.rs
+++ b/crates/hir_def/src/item_tree/tests.rs
@@ -340,11 +340,12 @@ trait Tr<'a, T: 'a>: Super where Self: for<'a> Tr<'a, T> {}
                 T: 'b
             {
                 // flags = 0x2
-                pub(self) fn f<G>(
+                pub(self) fn f<G, _anon_1>(
                     _: impl Copy,
                 ) -> impl Copy
                 where
-                    G: 'a;
+                    G: 'a,
+                    _anon_1: Copy;
             }
 
             pub(self) enum Enum<'a, T, const U: u8> {
diff --git a/crates/hir_def/src/nameres/tests.rs b/crates/hir_def/src/nameres/tests.rs
index 37336ce1e9..ff34b4a9f2 100644
--- a/crates/hir_def/src/nameres/tests.rs
+++ b/crates/hir_def/src/nameres/tests.rs
@@ -860,33 +860,3 @@ pub const settings: () = ();
         "#]],
     )
 }
-
-#[test]
-fn non_prelude_deps() {
-    check(
-        r#"
-//- /lib.rs crate:lib deps:dep extern-prelude:
-use dep::Struct;
-//- /dep.rs crate:dep
-pub struct Struct;
-        "#,
-        expect![[r#"
-            crate
-            Struct: _
-        "#]],
-    );
-    check(
-        r#"
-//- /lib.rs crate:lib deps:dep extern-prelude:
-extern crate dep;
-use dep::Struct;
-//- /dep.rs crate:dep
-pub struct Struct;
-        "#,
-        expect![[r#"
-            crate
-            Struct: t v
-            dep: t
-        "#]],
-    );
-}
diff --git a/crates/hir_ty/src/tests/regression.rs b/crates/hir_ty/src/tests/regression.rs
index 67952edca3..618499fdc1 100644
--- a/crates/hir_ty/src/tests/regression.rs
+++ b/crates/hir_ty/src/tests/regression.rs
@@ -1177,47 +1177,3 @@ fn multiexp_inner() {
         "#,
     );
 }
-
-#[test]
-fn macro_expands_to_impl_trait() {
-    check_no_mismatches(
-        r#"
-trait Foo {}
-
-macro_rules! ty {
-    () => {
-        impl Foo
-    }
-}
-
-fn foo(_: ty!()) {}
-
-fn bar() {
-    foo(());
-}
-    "#,
-    )
-}
-
-#[test]
-fn nested_macro_in_fn_params() {
-    check_no_mismatches(
-        r#"
-macro_rules! U32Inner {
-    () => {
-        u32
-    };
-}
-
-macro_rules! U32 {
-    () => {
-        U32Inner!()
-    };
-}
-
-fn mamba(a: U32!(), p: u32) -> u32 {
-    a
-}
-    "#,
-    )
-}
diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html b/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html
index f6d9d9aa14..9c20c8ae4b 100644
--- a/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html
+++ b/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html
@@ -46,46 +46,9 @@ pre                 { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
     <span class="brace">}</span><span class="parenthesis">)</span>
 <span class="brace">}</span>
 <span class="attribute attribute">#</span><span class="attribute attribute">[</span><span class="builtin_attr attribute">rustc_builtin_macro</span><span class="attribute attribute">]</span>
-<span class="attribute attribute">#</span><span class="attribute attribute">[</span><span class="builtin_attr attribute">macro_export</span><span class="attribute attribute">]</span>
-<span class="keyword">macro_rules</span><span class="punctuation">!</span> <span class="macro declaration">format_args</span> <span class="brace">{</span><span class="brace">}</span>
-<span class="attribute attribute">#</span><span class="attribute attribute">[</span><span class="builtin_attr attribute">rustc_builtin_macro</span><span class="attribute attribute">]</span>
-<span class="attribute attribute">#</span><span class="attribute attribute">[</span><span class="builtin_attr attribute">macro_export</span><span class="attribute attribute">]</span>
-<span class="keyword">macro_rules</span><span class="punctuation">!</span> <span class="macro declaration">const_format_args</span> <span class="brace">{</span><span class="brace">}</span>
-<span class="attribute attribute">#</span><span class="attribute attribute">[</span><span class="builtin_attr attribute">rustc_builtin_macro</span><span class="attribute attribute">]</span>
-<span class="attribute attribute">#</span><span class="attribute attribute">[</span><span class="builtin_attr attribute">macro_export</span><span class="attribute attribute">]</span>
-<span class="keyword">macro_rules</span><span class="punctuation">!</span> <span class="macro declaration">format_args_nl</span> <span class="brace">{</span><span class="brace">}</span>
-
-<span class="keyword">mod</span> <span class="module declaration">panic</span> <span class="brace">{</span>
-    <span class="keyword">pub</span> <span class="keyword">macro</span> <span class="macro declaration">panic_2015</span> <span class="brace">{</span>
-        <span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="operator">=</span><span class="angle">&gt;</span> <span class="parenthesis">(</span>
-            <span class="punctuation">$</span>crate<span class="colon">:</span><span class="colon">:</span>panicking<span class="colon">:</span><span class="colon">:</span>panic<span class="parenthesis">(</span><span class="string_literal">"explicit panic"</span><span class="parenthesis">)</span>
-        <span class="parenthesis">)</span><span class="comma">,</span>
-        <span class="parenthesis">(</span><span class="punctuation">$</span>msg<span class="colon">:</span>literal <span class="punctuation">$</span><span class="parenthesis">(</span><span class="comma">,</span><span class="parenthesis">)</span><span class="operator control">?</span><span class="parenthesis">)</span> <span class="operator">=</span><span class="angle">&gt;</span> <span class="parenthesis">(</span>
-            <span class="punctuation">$</span>crate<span class="colon">:</span><span class="colon">:</span>panicking<span class="colon">:</span><span class="colon">:</span>panic<span class="parenthesis">(</span><span class="punctuation">$</span>msg<span class="parenthesis">)</span>
-        <span class="parenthesis">)</span><span class="comma">,</span>
-        <span class="comment">// Use `panic_str` instead of `panic_display::&lt;&str&gt;` for non_fmt_panic lint.</span>
-        <span class="parenthesis">(</span><span class="punctuation">$</span>msg<span class="colon">:</span>expr <span class="punctuation">$</span><span class="parenthesis">(</span><span class="comma">,</span><span class="parenthesis">)</span><span class="operator control">?</span><span class="parenthesis">)</span> <span class="operator">=</span><span class="angle">&gt;</span> <span class="parenthesis">(</span>
-            <span class="punctuation">$</span>crate<span class="colon">:</span><span class="colon">:</span>panicking<span class="colon">:</span><span class="colon">:</span>panic_str<span class="parenthesis">(</span><span class="punctuation">$</span>msg<span class="parenthesis">)</span>
-        <span class="parenthesis">)</span><span class="comma">,</span>
-        <span class="comment">// Special-case the single-argument case for const_panic.</span>
-        <span class="parenthesis">(</span><span class="string_literal">"{}"</span><span class="comma">,</span> <span class="punctuation">$</span>arg<span class="colon">:</span>expr <span class="punctuation">$</span><span class="parenthesis">(</span><span class="comma">,</span><span class="parenthesis">)</span><span class="operator control">?</span><span class="parenthesis">)</span> <span class="operator">=</span><span class="angle">&gt;</span> <span class="parenthesis">(</span>
-            <span class="punctuation">$</span>crate<span class="colon">:</span><span class="colon">:</span>panicking<span class="colon">:</span><span class="colon">:</span>panic_display<span class="parenthesis">(</span><span class="operator">&</span><span class="punctuation">$</span>arg<span class="parenthesis">)</span>
-        <span class="parenthesis">)</span><span class="comma">,</span>
-        <span class="parenthesis">(</span><span class="punctuation">$</span>fmt<span class="colon">:</span>expr<span class="comma">,</span> <span class="punctuation">$</span><span class="parenthesis">(</span><span class="punctuation">$</span>arg<span class="colon">:</span>tt<span class="parenthesis">)</span><span class="punctuation">+</span><span class="parenthesis">)</span> <span class="operator">=</span><span class="angle">&gt;</span> <span class="parenthesis">(</span>
-            <span class="punctuation">$</span>crate<span class="colon">:</span><span class="colon">:</span>panicking<span class="colon">:</span><span class="colon">:</span>panic_fmt<span class="parenthesis">(</span><span class="punctuation">$</span>crate<span class="colon">:</span><span class="colon">:</span>const_format_args<span class="punctuation">!</span><span class="parenthesis">(</span><span class="punctuation">$</span>fmt<span class="comma">,</span> <span class="punctuation">$</span><span class="parenthesis">(</span><span class="punctuation">$</span>arg<span class="parenthesis">)</span><span class="punctuation">+</span><span class="parenthesis">)</span><span class="parenthesis">)</span>
-        <span class="parenthesis">)</span><span class="comma">,</span>
-    <span class="brace">}</span>
-<span class="brace">}</span>
-
-<span class="attribute attribute">#</span><span class="attribute attribute">[</span><span class="builtin_attr attribute">rustc_builtin_macro</span><span class="parenthesis attribute">(</span><span class="none attribute">std_panic</span><span class="parenthesis attribute">)</span><span class="attribute attribute">]</span>
-<span class="attribute attribute">#</span><span class="attribute attribute">[</span><span class="builtin_attr attribute">macro_export</span><span class="attribute attribute">]</span>
-<span class="keyword">macro_rules</span><span class="punctuation">!</span> <span class="macro declaration">panic</span> <span class="brace">{</span><span class="brace">}</span>
-<span class="attribute attribute">#</span><span class="attribute attribute">[</span><span class="builtin_attr attribute">rustc_builtin_macro</span><span class="attribute attribute">]</span>
-<span class="keyword">macro_rules</span><span class="punctuation">!</span> <span class="macro declaration">assert</span> <span class="brace">{</span><span class="brace">}</span>
-
-<span class="keyword">macro_rules</span><span class="punctuation">!</span> <span class="macro declaration">toho</span> <span class="brace">{</span>
-    <span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="operator">=</span><span class="angle">&gt;</span> <span class="parenthesis">(</span><span class="punctuation">$</span>crate<span class="colon">:</span><span class="colon">:</span>panic<span class="punctuation">!</span><span class="parenthesis">(</span><span class="string_literal">"not yet implemented"</span><span class="parenthesis">)</span><span class="parenthesis">)</span><span class="semicolon">;</span>
-    <span class="parenthesis">(</span><span class="punctuation">$</span><span class="parenthesis">(</span><span class="punctuation">$</span>arg<span class="colon">:</span>tt<span class="parenthesis">)</span><span class="punctuation">+</span><span class="parenthesis">)</span> <span class="operator">=</span><span class="angle">&gt;</span> <span class="parenthesis">(</span><span class="punctuation">$</span>crate<span class="colon">:</span><span class="colon">:</span>panic<span class="punctuation">!</span><span class="parenthesis">(</span><span class="string_literal">"not yet implemented: {}"</span><span class="comma">,</span> <span class="punctuation">$</span>crate<span class="colon">:</span><span class="colon">:</span>format_args<span class="punctuation">!</span><span class="parenthesis">(</span><span class="punctuation">$</span><span class="parenthesis">(</span><span class="punctuation">$</span>arg<span class="parenthesis">)</span><span class="punctuation">+</span><span class="parenthesis">)</span><span class="parenthesis">)</span><span class="parenthesis">)</span><span class="semicolon">;</span>
+<span class="keyword">macro_rules</span><span class="punctuation">!</span> <span class="macro declaration">format_args_nl</span> <span class="brace">{</span>
+    <span class="parenthesis">(</span><span class="punctuation">$</span>fmt<span class="colon">:</span>expr<span class="parenthesis">)</span> <span class="operator">=</span><span class="angle">&gt;</span> <span class="brace">{</span><span class="brace">{</span> <span class="comment">/* compiler built-in */</span> <span class="brace">}</span><span class="brace">}</span><span class="semicolon">;</span>
+    <span class="parenthesis">(</span><span class="punctuation">$</span>fmt<span class="colon">:</span>expr<span class="comma">,</span> <span class="punctuation">$</span><span class="parenthesis">(</span><span class="punctuation">$</span>args<span class="colon">:</span>tt<span class="parenthesis">)</span><span class="punctuation">*</span><span class="parenthesis">)</span> <span class="operator">=</span><span class="angle">&gt;</span> <span class="brace">{</span><span class="brace">{</span> <span class="comment">/* compiler built-in */</span> <span class="brace">}</span><span class="brace">}</span><span class="semicolon">;</span>
 <span class="brace">}</span>
 
 <span class="keyword">fn</span> <span class="function declaration">main</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="brace">{</span>
@@ -113,7 +76,7 @@ pre                 { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
     <span class="macro">println!</span><span class="parenthesis">(</span><span class="string_literal">"Hello </span><span class="format_specifier">{</span><span class="format_specifier">:</span><span class="format_specifier">+</span><span class="format_specifier">}</span><span class="string_literal">!"</span><span class="comma">,</span> <span class="numeric_literal">5</span><span class="parenthesis">)</span><span class="semicolon">;</span>
     <span class="macro">println!</span><span class="parenthesis">(</span><span class="string_literal">"</span><span class="format_specifier">{</span><span class="format_specifier">:</span><span class="format_specifier">#</span><span class="variable">x</span><span class="format_specifier">}</span><span class="string_literal">!"</span><span class="comma">,</span> <span class="numeric_literal">27</span><span class="parenthesis">)</span><span class="semicolon">;</span>
     <span class="macro">println!</span><span class="parenthesis">(</span><span class="string_literal">"Hello </span><span class="format_specifier">{</span><span class="format_specifier">:</span><span class="numeric_literal">0</span><span class="numeric_literal">5</span><span class="format_specifier">}</span><span class="string_literal">!"</span><span class="comma">,</span> <span class="numeric_literal">5</span><span class="parenthesis">)</span><span class="semicolon">;</span>
-    <span class="macro">println!</span><span class="parenthesis">(</span><span class="string_literal">"Hello </span><span class="format_specifier">{</span><span class="format_specifier">:</span><span class="numeric_literal">0</span><span class="numeric_literal">5</span><span class="format_specifier">}</span><span class="string_literal">!"</span><span class="comma">,</span> <span class="numeric_literal">-</span><span class="numeric_literal">5</span><span class="parenthesis">)</span><span class="semicolon">;</span>
+    <span class="macro">println!</span><span class="parenthesis">(</span><span class="string_literal">"Hello </span><span class="format_specifier">{</span><span class="format_specifier">:</span><span class="numeric_literal">0</span><span class="numeric_literal">5</span><span class="format_specifier">}</span><span class="string_literal">!"</span><span class="comma">,</span> <span class="punctuation">-</span><span class="numeric_literal">5</span><span class="parenthesis">)</span><span class="semicolon">;</span>
     <span class="macro">println!</span><span class="parenthesis">(</span><span class="string_literal">"</span><span class="format_specifier">{</span><span class="format_specifier">:</span><span class="format_specifier">#</span><span class="numeric_literal">0</span><span class="numeric_literal">10</span><span class="variable">x</span><span class="format_specifier">}</span><span class="string_literal">!"</span><span class="comma">,</span> <span class="numeric_literal">27</span><span class="parenthesis">)</span><span class="semicolon">;</span>
     <span class="macro">println!</span><span class="parenthesis">(</span><span class="string_literal">"Hello </span><span class="format_specifier">{</span><span class="numeric_literal">0</span><span class="format_specifier">}</span><span class="string_literal"> is </span><span class="format_specifier">{</span><span class="numeric_literal">1</span><span class="format_specifier">:</span><span class="format_specifier">.</span><span class="numeric_literal">5</span><span class="format_specifier">}</span><span class="string_literal">"</span><span class="comma">,</span> <span class="string_literal">"x"</span><span class="comma">,</span> <span class="numeric_literal">0.01</span><span class="parenthesis">)</span><span class="semicolon">;</span>
     <span class="macro">println!</span><span class="parenthesis">(</span><span class="string_literal">"Hello </span><span class="format_specifier">{</span><span class="numeric_literal">1</span><span class="format_specifier">}</span><span class="string_literal"> is </span><span class="format_specifier">{</span><span class="numeric_literal">2</span><span class="format_specifier">:</span><span class="format_specifier">.</span><span class="numeric_literal">0</span><span class="format_specifier">$</span><span class="format_specifier">}</span><span class="string_literal">"</span><span class="comma">,</span> <span class="numeric_literal">5</span><span class="comma">,</span> <span class="string_literal">"x"</span><span class="comma">,</span> <span class="numeric_literal">0.01</span><span class="parenthesis">)</span><span class="semicolon">;</span>
@@ -136,10 +99,5 @@ pre                 { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
     <span class="macro">println!</span><span class="parenthesis">(</span><span class="string_literal">"</span><span class="format_specifier">{</span><span class="escape_sequence">\x41</span><span class="format_specifier">}</span><span class="string_literal">"</span><span class="comma">,</span> A <span class="operator">=</span> <span class="numeric_literal">92</span><span class="parenthesis">)</span><span class="semicolon">;</span>
     <span class="macro">println!</span><span class="parenthesis">(</span><span class="string_literal">"</span><span class="format_specifier">{</span><span class="variable">ничоси</span><span class="format_specifier">}</span><span class="string_literal">"</span><span class="comma">,</span> ничоси <span class="operator">=</span> <span class="numeric_literal">92</span><span class="parenthesis">)</span><span class="semicolon">;</span>
 
-    <span class="macro">println!</span><span class="parenthesis">(</span><span class="string_literal">"</span><span class="format_specifier">{</span><span class="format_specifier">:</span><span class="variable">x</span><span class="format_specifier">?</span><span class="format_specifier">}</span><span class="string_literal"> </span><span class="format_specifier">{</span><span class="format_specifier">}</span><span class="string_literal"> "</span><span class="comma">,</span> <span class="unresolved_reference">thingy</span><span class="comma">,</span> <span class="unresolved_reference">n2</span><span class="parenthesis">)</span><span class="semicolon">;</span>
-    <span class="macro">panic!</span><span class="parenthesis">(</span><span class="string_literal">"</span><span class="format_specifier">{</span><span class="format_specifier">}</span><span class="string_literal">"</span><span class="comma">,</span> <span class="numeric_literal">0</span><span class="parenthesis">)</span><span class="semicolon">;</span>
-    <span class="macro">panic!</span><span class="parenthesis">(</span><span class="string_literal">"more </span><span class="format_specifier">{</span><span class="format_specifier">}</span><span class="string_literal">"</span><span class="comma">,</span> <span class="numeric_literal">1</span><span class="parenthesis">)</span><span class="semicolon">;</span>
-    <span class="macro">assert!</span><span class="parenthesis">(</span><span class="bool_literal">true</span><span class="comma">,</span> <span class="string_literal">"</span><span class="format_specifier">{</span><span class="format_specifier">}</span><span class="string_literal">"</span><span class="comma">,</span> <span class="numeric_literal">1</span><span class="parenthesis">)</span><span class="semicolon">;</span>
-    <span class="macro">assert!</span><span class="parenthesis">(</span><span class="bool_literal">true</span><span class="comma">,</span> <span class="string_literal">"</span><span class="format_specifier">{</span><span class="format_specifier">}</span><span class="string_literal"> asdasd"</span><span class="comma">,</span> <span class="numeric_literal">1</span><span class="parenthesis">)</span><span class="semicolon">;</span>
-    <span class="macro">toho!</span><span class="parenthesis">(</span><span class="string_literal">"</span><span class="format_specifier">{</span><span class="format_specifier">}</span><span class="string_literal">fmt"</span><span class="comma">,</span> <span class="numeric_literal">0</span><span class="parenthesis">)</span><span class="semicolon">;</span>
+    <span class="macro">println!</span><span class="parenthesis">(</span><span class="string_literal">"</span><span class="format_specifier">{</span><span class="format_specifier">:</span><span class="variable">x</span><span class="format_specifier">?</span><span class="format_specifier">}</span><span class="string_literal"> </span><span class="format_specifier">{</span><span class="format_specifier">}</span><span class="string_literal"> "</span><span class="comma">,</span> thingy<span class="comma">,</span> n2<span class="parenthesis">)</span><span class="semicolon">;</span>
 <span class="brace">}</span></code></pre>
\ No newline at end of file
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs
index f5f7d8fe95..9fc730e007 100644
--- a/crates/ide/src/syntax_highlighting/tests.rs
+++ b/crates/ide/src/syntax_highlighting/tests.rs
@@ -441,46 +441,9 @@ macro_rules! println {
     })
 }
 #[rustc_builtin_macro]
-#[macro_export]
-macro_rules! format_args {}
-#[rustc_builtin_macro]
-#[macro_export]
-macro_rules! const_format_args {}
-#[rustc_builtin_macro]
-#[macro_export]
-macro_rules! format_args_nl {}
-
-mod panic {
-    pub macro panic_2015 {
-        () => (
-            $crate::panicking::panic("explicit panic")
-        ),
-        ($msg:literal $(,)?) => (
-            $crate::panicking::panic($msg)
-        ),
-        // Use `panic_str` instead of `panic_display::<&str>` for non_fmt_panic lint.
-        ($msg:expr $(,)?) => (
-            $crate::panicking::panic_str($msg)
-        ),
-        // Special-case the single-argument case for const_panic.
-        ("{}", $arg:expr $(,)?) => (
-            $crate::panicking::panic_display(&$arg)
-        ),
-        ($fmt:expr, $($arg:tt)+) => (
-            $crate::panicking::panic_fmt($crate::const_format_args!($fmt, $($arg)+))
-        ),
-    }
-}
-
-#[rustc_builtin_macro(std_panic)]
-#[macro_export]
-macro_rules! panic {}
-#[rustc_builtin_macro]
-macro_rules! assert {}
-
-macro_rules! toho {
-    () => ($crate::panic!("not yet implemented"));
-    ($($arg:tt)+) => ($crate::panic!("not yet implemented: {}", $crate::format_args!($($arg)+)));
+macro_rules! format_args_nl {
+    ($fmt:expr) => {{ /* compiler built-in */ }};
+    ($fmt:expr, $($args:tt)*) => {{ /* compiler built-in */ }};
 }
 
 fn main() {
@@ -532,11 +495,6 @@ fn main() {
     println!("{ничоси}", ничоси = 92);
 
     println!("{:x?} {} ", thingy, n2);
-    panic!("{}", 0);
-    panic!("more {}", 1);
-    assert!(true, "{}", 1);
-    assert!(true, "{} asdasd", 1);
-    toho!("{}fmt", 0);
 }"#
         .trim(),
         expect_file!["./test_data/highlight_strings.html"],
diff --git a/crates/ide_assists/src/tests.rs b/crates/ide_assists/src/tests.rs
index 7f3c93d740..e211b09987 100644
--- a/crates/ide_assists/src/tests.rs
+++ b/crates/ide_assists/src/tests.rs
@@ -169,7 +169,7 @@ fn check(handler: Handler, before: &str, expected: ExpectedResult, assist_label:
                 let sr = db.source_root(sr);
                 let mut base = sr.path_for_file(&dst.anchor).unwrap().clone();
                 base.pop();
-                let created_file_path = base.join(&dst.path).unwrap();
+                let created_file_path = format!("{}{}", base.to_string(), &dst.path[1..]);
                 format_to!(buf, "//- {}\n", created_file_path);
                 buf.push_str(&contents);
             }
diff --git a/crates/ide_assists/src/tests/generated.rs b/crates/ide_assists/src/tests/generated.rs
index 9ad7b6097a..87b3be3498 100644
--- a/crates/ide_assists/src/tests/generated.rs
+++ b/crates/ide_assists/src/tests/generated.rs
@@ -1296,22 +1296,6 @@ fn apply<T, U, F>(f: F, x: T) -> U where F: FnOnce(T) -> U {
     )
 }
 
-#[test]
-fn doctest_move_from_mod_rs() {
-    check_doc_test(
-        "move_from_mod_rs",
-        r#####"
-//- /main.rs
-mod a;
-//- /a/mod.rs
-$0fn t() {}$0
-"#####,
-        r#####"
-fn t() {}
-"#####,
-    )
-}
-
 #[test]
 fn doctest_move_guard_to_arm_body() {
     check_doc_test(
diff --git a/crates/ide_completion/src/tests/item.rs b/crates/ide_completion/src/tests/item.rs
index d94fab2f5f..e77082ebb8 100644
--- a/crates/ide_completion/src/tests/item.rs
+++ b/crates/ide_completion/src/tests/item.rs
@@ -87,7 +87,6 @@ fn after_struct_name() {
         r"struct Struct $0",
         expect![[r##"
             kw pub(crate)
-            kw pub(super)
             kw pub
             kw unsafe
             kw fn
@@ -121,7 +120,6 @@ fn after_fn_name() {
         r"fn func() $0",
         expect![[r##"
             kw pub(crate)
-            kw pub(super)
             kw pub
             kw unsafe
             kw fn
@@ -159,7 +157,6 @@ struct Foo {
 "#,
         expect![[r#"
             kw pub(crate)
-            kw pub(super)
             kw pub
         "#]],
     )
diff --git a/crates/ide_completion/src/tests/item_list.rs b/crates/ide_completion/src/tests/item_list.rs
index 4c76963054..f355d37afc 100644
--- a/crates/ide_completion/src/tests/item_list.rs
+++ b/crates/ide_completion/src/tests/item_list.rs
@@ -14,7 +14,6 @@ fn in_mod_item_list() {
         r#"mod tests { $0 }"#,
         expect![[r##"
             kw pub(crate)
-            kw pub(super)
             kw pub
             kw unsafe
             kw fn
@@ -46,7 +45,6 @@ fn in_source_file_item_list() {
         r#"$0"#,
         expect![[r##"
             kw pub(crate)
-            kw pub(super)
             kw pub
             kw unsafe
             kw fn
@@ -79,7 +77,6 @@ fn in_item_list_after_attr() {
         r#"#[attr] $0"#,
         expect![[r#"
             kw pub(crate)
-            kw pub(super)
             kw pub
             kw unsafe
             kw fn
@@ -164,7 +161,6 @@ fn in_impl_assoc_item_list() {
         r#"impl Struct { $0 }"#,
         expect![[r##"
             kw pub(crate)
-            kw pub(super)
             kw pub
             kw unsafe
             kw fn
@@ -185,7 +181,6 @@ fn in_impl_assoc_item_list_after_attr() {
         r#"impl Struct { #[attr] $0 }"#,
         expect![[r#"
             kw pub(crate)
-            kw pub(super)
             kw pub
             kw unsafe
             kw fn
@@ -235,7 +230,6 @@ impl Test for () {
 "#,
         expect![[r##"
             kw pub(crate)
-            kw pub(super)
             kw pub
             kw unsafe
             kw fn
diff --git a/crates/ide_completion/src/tests/type_pos.rs b/crates/ide_completion/src/tests/type_pos.rs
index a03f1e7ff8..b6cf8945e2 100644
--- a/crates/ide_completion/src/tests/type_pos.rs
+++ b/crates/ide_completion/src/tests/type_pos.rs
@@ -44,7 +44,6 @@ struct Foo<'lt, T, const C: usize>(f$0);
 "#,
         expect![[r##"
             kw pub(crate)
-            kw pub(super)
             kw pub
             kw self
             kw super
diff --git a/crates/project_model/src/tests.rs b/crates/project_model/src/tests.rs
index 647d30605d..0e37624f31 100644
--- a/crates/project_model/src/tests.rs
+++ b/crates/project_model/src/tests.rs
@@ -166,7 +166,6 @@ fn cargo_hello_world_project_model_with_wildcard_overrides() {
                                 name: CrateName(
                                     "libc",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -232,7 +231,6 @@ fn cargo_hello_world_project_model_with_wildcard_overrides() {
                                 name: CrateName(
                                     "libc",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -289,7 +287,6 @@ fn cargo_hello_world_project_model_with_wildcard_overrides() {
                                 name: CrateName(
                                     "hello_world",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -298,7 +295,6 @@ fn cargo_hello_world_project_model_with_wildcard_overrides() {
                                 name: CrateName(
                                     "libc",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -411,7 +407,6 @@ fn cargo_hello_world_project_model_with_wildcard_overrides() {
                                 name: CrateName(
                                     "hello_world",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -420,7 +415,6 @@ fn cargo_hello_world_project_model_with_wildcard_overrides() {
                                 name: CrateName(
                                     "libc",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -533,7 +527,6 @@ fn cargo_hello_world_project_model_with_wildcard_overrides() {
                                 name: CrateName(
                                     "hello_world",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -542,7 +535,6 @@ fn cargo_hello_world_project_model_with_wildcard_overrides() {
                                 name: CrateName(
                                     "libc",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -623,7 +615,6 @@ fn cargo_hello_world_project_model_with_selective_overrides() {
                                 name: CrateName(
                                     "libc",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -689,7 +680,6 @@ fn cargo_hello_world_project_model_with_selective_overrides() {
                                 name: CrateName(
                                     "libc",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -748,7 +738,6 @@ fn cargo_hello_world_project_model_with_selective_overrides() {
                                 name: CrateName(
                                     "hello_world",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -757,7 +746,6 @@ fn cargo_hello_world_project_model_with_selective_overrides() {
                                 name: CrateName(
                                     "libc",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -872,7 +860,6 @@ fn cargo_hello_world_project_model_with_selective_overrides() {
                                 name: CrateName(
                                     "hello_world",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -881,7 +868,6 @@ fn cargo_hello_world_project_model_with_selective_overrides() {
                                 name: CrateName(
                                     "libc",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -996,7 +982,6 @@ fn cargo_hello_world_project_model_with_selective_overrides() {
                                 name: CrateName(
                                     "hello_world",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -1005,7 +990,6 @@ fn cargo_hello_world_project_model_with_selective_overrides() {
                                 name: CrateName(
                                     "libc",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -1077,7 +1061,6 @@ fn cargo_hello_world_project_model() {
                                 name: CrateName(
                                     "libc",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -1145,7 +1128,6 @@ fn cargo_hello_world_project_model() {
                                 name: CrateName(
                                     "libc",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -1204,7 +1186,6 @@ fn cargo_hello_world_project_model() {
                                 name: CrateName(
                                     "hello_world",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -1213,7 +1194,6 @@ fn cargo_hello_world_project_model() {
                                 name: CrateName(
                                     "libc",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -1330,7 +1310,6 @@ fn cargo_hello_world_project_model() {
                                 name: CrateName(
                                     "hello_world",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -1339,7 +1318,6 @@ fn cargo_hello_world_project_model() {
                                 name: CrateName(
                                     "libc",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -1456,7 +1434,6 @@ fn cargo_hello_world_project_model() {
                                 name: CrateName(
                                     "hello_world",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -1465,7 +1442,6 @@ fn cargo_hello_world_project_model() {
                                 name: CrateName(
                                     "libc",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -1515,7 +1491,6 @@ fn rust_project_hello_world_project_model() {
                                 name: CrateName(
                                     "core",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -1606,7 +1581,6 @@ fn rust_project_hello_world_project_model() {
                                 name: CrateName(
                                     "std",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
@@ -1670,7 +1644,6 @@ fn rust_project_hello_world_project_model() {
                                 name: CrateName(
                                     "core",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -1679,7 +1652,6 @@ fn rust_project_hello_world_project_model() {
                                 name: CrateName(
                                     "alloc",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -1688,16 +1660,6 @@ fn rust_project_hello_world_project_model() {
                                 name: CrateName(
                                     "std",
                                 ),
-                                prelude: true,
-                            },
-                            Dependency {
-                                crate_id: CrateId(
-                                    9,
-                                ),
-                                name: CrateName(
-                                    "test",
-                                ),
-                                prelude: false,
                             },
                         ],
                         proc_macro: [],
@@ -1842,7 +1804,6 @@ fn rust_project_hello_world_project_model() {
                                 name: CrateName(
                                     "alloc",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -1851,7 +1812,6 @@ fn rust_project_hello_world_project_model() {
                                 name: CrateName(
                                     "core",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -1860,7 +1820,6 @@ fn rust_project_hello_world_project_model() {
                                 name: CrateName(
                                     "panic_abort",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -1869,7 +1828,6 @@ fn rust_project_hello_world_project_model() {
                                 name: CrateName(
                                     "panic_unwind",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -1878,7 +1836,6 @@ fn rust_project_hello_world_project_model() {
                                 name: CrateName(
                                     "profiler_builtins",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -1887,7 +1844,6 @@ fn rust_project_hello_world_project_model() {
                                 name: CrateName(
                                     "std_detect",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -1896,7 +1852,6 @@ fn rust_project_hello_world_project_model() {
                                 name: CrateName(
                                     "term",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -1905,7 +1860,6 @@ fn rust_project_hello_world_project_model() {
                                 name: CrateName(
                                     "test",
                                 ),
-                                prelude: true,
                             },
                             Dependency {
                                 crate_id: CrateId(
@@ -1914,7 +1868,6 @@ fn rust_project_hello_world_project_model() {
                                 name: CrateName(
                                     "unwind",
                                 ),
-                                prelude: true,
                             },
                         ],
                         proc_macro: [],
diff --git a/crates/test_utils/src/fixture.rs b/crates/test_utils/src/fixture.rs
index f2013b34c5..71cc67a9ca 100644
--- a/crates/test_utils/src/fixture.rs
+++ b/crates/test_utils/src/fixture.rs
@@ -70,7 +70,6 @@ pub struct Fixture {
     pub text: String,
     pub krate: Option<String>,
     pub deps: Vec<String>,
-    pub extern_prelude: Option<Vec<String>>,
     pub cfg_atoms: Vec<String>,
     pub cfg_key_values: Vec<(String, String)>,
     pub edition: Option<String>,
@@ -172,7 +171,6 @@ impl Fixture {
 
         let mut krate = None;
         let mut deps = Vec::new();
-        let mut extern_prelude = None;
         let mut edition = None;
         let mut cfg_atoms = Vec::new();
         let mut cfg_key_values = Vec::new();
@@ -185,14 +183,6 @@ impl Fixture {
             match key {
                 "crate" => krate = Some(value.to_string()),
                 "deps" => deps = value.split(',').map(|it| it.to_string()).collect(),
-                "extern-prelude" => {
-                    if value.is_empty() {
-                        extern_prelude = Some(Vec::new());
-                    } else {
-                        extern_prelude =
-                            Some(value.split(',').map(|it| it.to_string()).collect::<Vec<_>>());
-                    }
-                }
                 "edition" => edition = Some(value.to_string()),
                 "cfg" => {
                     for entry in value.split(',') {
@@ -214,21 +204,11 @@ impl Fixture {
             }
         }
 
-        for prelude_dep in extern_prelude.iter().flatten() {
-            assert!(
-                deps.contains(prelude_dep),
-                "extern-prelude {:?} must be a subset of deps {:?}",
-                extern_prelude,
-                deps
-            );
-        }
-
         Fixture {
             path,
             text: String::new(),
             krate,
             deps,
-            extern_prelude,
             cfg_atoms,
             cfg_key_values,
             edition,