Repository: rust-lang/rust-analyzer
Pull request #19063 (2025-01-28 16:16:30)

internal: backout `hir-*` changes from #19001
As [discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/185405-t-compiler.2Frust-analyzer/topic/Porting.20to.20Salsa.203.2E0/near/496210322), the `hir-*` changes in #19001 make rebasing https://github.com/rust-lang/rust-analyzer/pull/18964 difficult because new Salsa switches `DefWithBodyId` a [`#[salsa::supertype]`](https://github.com/salsa-rs/salsa/issues/578). Since `FieldId` was added as a variant to `DefWithBodyId`, `FieldId` would need to become either Salsa struct, or `DefWithBodyId` would need to stop being a `#[salsa::supertype]`, both of which would regress memory usage.

Given that we'll be redoing large parts of `hir-*` anyways, it made more sense to revert everything _but_ the parser changes.


Patch:
diff --git a/crates/hir-def/src/data/adt.rs b/crates/hir-def/src/data/adt.rs
index aaa260a358..8fc1985403 100644
--- a/crates/hir-def/src/data/adt.rs
+++ b/crates/hir-def/src/data/adt.rs
@@ -85,7 +85,6 @@ pub struct FieldData {
     pub name: Name,
     pub type_ref: TypeRefId,
     pub visibility: RawVisibility,
-    pub has_default: bool,
 }
 
 fn repr_from_value(
@@ -479,6 +478,5 @@ fn lower_field(
         name: field.name.clone(),
         type_ref: field.type_ref,
         visibility: item_tree[override_visibility.unwrap_or(field.visibility)].clone(),
-        has_default: field.has_default,
     }
 }
diff --git a/crates/hir-def/src/expr_store.rs b/crates/hir-def/src/expr_store.rs
index d0695d0eac..9df6eaade7 100644
--- a/crates/hir-def/src/expr_store.rs
+++ b/crates/hir-def/src/expr_store.rs
@@ -25,7 +25,7 @@ use crate::{
     db::DefDatabase,
     hir::{
         Array, AsmOperand, Binding, BindingId, Expr, ExprId, ExprOrPatId, Label, LabelId, Pat,
-        PatId, RecordFieldPat, Spread, Statement,
+        PatId, RecordFieldPat, Statement,
     },
     nameres::DefMap,
     path::{ModPath, Path},
@@ -362,7 +362,7 @@ impl ExpressionStore {
                 for field in fields.iter() {
                     f(field.expr);
                 }
-                if let &Spread::Base(expr) = spread {
+                if let &Some(expr) = spread {
                     f(expr);
                 }
             }
@@ -490,7 +490,7 @@ impl ExpressionStore {
                 for field in fields.iter() {
                     f(field.expr);
                 }
-                if let &Spread::Base(expr) = spread {
+                if let &Some(expr) = spread {
                     f(expr);
                 }
             }
diff --git a/crates/hir-def/src/expr_store/body.rs b/crates/hir-def/src/expr_store/body.rs
index 3177b2c74a..a55fec4f8b 100644
--- a/crates/hir-def/src/expr_store/body.rs
+++ b/crates/hir-def/src/expr_store/body.rs
@@ -122,9 +122,6 @@ impl Body {
                     src.map(|it| it.expr())
                 }
                 DefWithBodyId::InTypeConstId(c) => c.lookup(db).id.map(|_| c.source(db).expr()),
-                DefWithBodyId::FieldId(f) => {
-                    f.record_field_source(db).map(|it| it.and_then(|it| it.expr()))
-                }
             }
         };
         let module = def.module(db);
diff --git a/crates/hir-def/src/expr_store/lower.rs b/crates/hir-def/src/expr_store/lower.rs
index 811fecf91f..88f770da02 100644
--- a/crates/hir-def/src/expr_store/lower.rs
+++ b/crates/hir-def/src/expr_store/lower.rs
@@ -45,7 +45,7 @@ use crate::{
         },
         Array, Binding, BindingAnnotation, BindingId, BindingProblems, CaptureBy, ClosureKind,
         Expr, ExprId, Item, Label, LabelId, Literal, LiteralOrConst, MatchArm, Movability,
-        OffsetOf, Pat, PatId, RecordFieldPat, RecordLitField, Spread, Statement,
+        OffsetOf, Pat, PatId, RecordFieldPat, RecordLitField, Statement,
     },
     item_scope::BuiltinShadowMode,
     lang_item::LangItem,
@@ -90,7 +90,6 @@ pub(super) fn lower_body(
         DefWithBodyId::ConstId(it) => db.attrs(it.into()),
         DefWithBodyId::InTypeConstId(_) => Attrs::EMPTY,
         DefWithBodyId::VariantId(it) => db.attrs(it.into()),
-        DefWithBodyId::FieldId(it) => db.attrs(it.into()),
     }
     .rust_analyzer_tool()
     .any(|attr| *attr.path() == tool_path![skip]);
@@ -169,7 +168,6 @@ pub(super) fn lower_body(
                     Awaitable::No("constant")
                 }
                 DefWithBodyId::VariantId(..) => Awaitable::No("enum variant"),
-                DefWithBodyId::FieldId(..) => Awaitable::No("field"),
             }
         },
     );
@@ -602,13 +600,10 @@ impl ExprCollector<'_> {
                             Some(RecordLitField { name, expr })
                         })
                         .collect();
-                    let spread = nfl.spread().map(|s| self.collect_expr(s)).map_or_else(
-                        || if nfl.dotdot_token().is_some() { Spread::Yes } else { Spread::No },
-                        Spread::Base,
-                    );
+                    let spread = nfl.spread().map(|s| self.collect_expr(s));
                     Expr::RecordLit { path, fields, spread }
                 } else {
-                    Expr::RecordLit { path, fields: Box::default(), spread: Spread::No }
+                    Expr::RecordLit { path, fields: Box::default(), spread: None }
                 };
 
                 self.alloc_expr(record_lit, syntax_ptr)
diff --git a/crates/hir-def/src/expr_store/pretty.rs b/crates/hir-def/src/expr_store/pretty.rs
index 1b3a1bb4dc..6a0b1e5197 100644
--- a/crates/hir-def/src/expr_store/pretty.rs
+++ b/crates/hir-def/src/expr_store/pretty.rs
@@ -8,10 +8,9 @@ use span::Edition;
 use crate::{
     hir::{
         Array, BindingAnnotation, CaptureBy, ClosureKind, Literal, LiteralOrConst, Movability,
-        Spread, Statement,
+        Statement,
     },
     pretty::{print_generic_args, print_path, print_type_ref},
-    VariantId,
 };
 
 use super::*;
@@ -57,32 +56,6 @@ pub(super) fn print_body_hir(
                 loc.id.item_tree(db)[loc.id.value].name.display(db.upcast(), edition),
             )
         }
-        DefWithBodyId::FieldId(it) => {
-            let parent_name: String = match it.parent {
-                VariantId::EnumVariantId(it) => {
-                    let loc = it.lookup(db);
-                    let enum_loc = loc.parent.lookup(db);
-                    format!(
-                        "{}::{}",
-                        enum_loc.id.item_tree(db)[enum_loc.id.value]
-                            .name
-                            .display(db.upcast(), edition),
-                        loc.id.item_tree(db)[loc.id.value].name.display(db.upcast(), edition),
-                    )
-                }
-                VariantId::StructId(it) => it
-                    .lookup(db)
-                    .id
-                    .resolved(db, |it| it.name.display(db.upcast(), edition).to_string()),
-                VariantId::UnionId(it) => it
-                    .lookup(db)
-                    .id
-                    .resolved(db, |it| it.name.display(db.upcast(), edition).to_string()),
-            };
-            let variant_data = it.parent.variant_data(db);
-            let field_name = &variant_data.fields()[it.local_id].name;
-            format!("field {}.{}", parent_name, field_name.display(db.upcast(), edition),)
-        }
     };
 
     let mut p = Printer {
@@ -412,16 +385,10 @@ impl Printer<'_> {
                         p.print_expr(field.expr);
                         wln!(p, ",");
                     }
-                    match spread {
-                        Spread::No => {}
-                        Spread::Yes => {
-                            w!(p, "..");
-                        }
-                        Spread::Base(expr) => {
-                            w!(p, "..");
-                            p.print_expr(*expr);
-                            wln!(p);
-                        }
+                    if let Some(spread) = spread {
+                        w!(p, "..");
+                        p.print_expr(*spread);
+                        wln!(p);
                     }
                 });
                 w!(self, "}}");
diff --git a/crates/hir-def/src/hir.rs b/crates/hir-def/src/hir.rs
index e09ce67a89..0dcddf162b 100644
--- a/crates/hir-def/src/hir.rs
+++ b/crates/hir-def/src/hir.rs
@@ -251,7 +251,7 @@ pub enum Expr {
     RecordLit {
         path: Option<Box<Path>>,
         fields: Box<[RecordLitField]>,
-        spread: Spread,
+        spread: Option<ExprId>,
     },
     Field {
         expr: ExprId,
@@ -478,13 +478,6 @@ pub struct RecordLitField {
     pub expr: ExprId,
 }
 
-#[derive(Debug, Clone, Eq, PartialEq)]
-pub enum Spread {
-    No,
-    Yes,
-    Base(ExprId),
-}
-
 #[derive(Debug, Clone, Eq, PartialEq)]
 pub enum Statement {
     Let {
diff --git a/crates/hir-def/src/item_tree.rs b/crates/hir-def/src/item_tree.rs
index 82e6ff821b..8d5b3eeb28 100644
--- a/crates/hir-def/src/item_tree.rs
+++ b/crates/hir-def/src/item_tree.rs
@@ -1007,7 +1007,6 @@ pub struct Field {
     pub name: Name,
     pub type_ref: TypeRefId,
     pub visibility: RawVisibilityId,
-    pub has_default: bool,
 }
 
 #[derive(Debug, Clone, Eq, PartialEq)]
diff --git a/crates/hir-def/src/item_tree/lower.rs b/crates/hir-def/src/item_tree/lower.rs
index 69a1933079..71848845a8 100644
--- a/crates/hir-def/src/item_tree/lower.rs
+++ b/crates/hir-def/src/item_tree/lower.rs
@@ -319,9 +319,8 @@ impl<'a> Ctx<'a> {
         };
         let visibility = self.lower_visibility(field);
         let type_ref = TypeRef::from_ast_opt(body_ctx, field.ty());
-        let has_default = field.expr().is_some();
 
-        Field { name, type_ref, visibility, has_default }
+        Field { name, type_ref, visibility }
     }
 
     fn lower_tuple_field(
@@ -333,7 +332,7 @@ impl<'a> Ctx<'a> {
         let name = Name::new_tuple_field(idx);
         let visibility = self.lower_visibility(field);
         let type_ref = TypeRef::from_ast_opt(body_ctx, field.ty());
-        Field { name, type_ref, visibility, has_default: false }
+        Field { name, type_ref, visibility }
     }
 
     fn lower_union(&mut self, union: &ast::Union) -> Option<FileItemTreeId<Union>> {
diff --git a/crates/hir-def/src/item_tree/pretty.rs b/crates/hir-def/src/item_tree/pretty.rs
index 1e765ac78e..70bf2f13c8 100644
--- a/crates/hir-def/src/item_tree/pretty.rs
+++ b/crates/hir-def/src/item_tree/pretty.rs
@@ -135,9 +135,7 @@ impl Printer<'_> {
                 self.whitespace();
                 w!(self, "{{");
                 self.indented(|this| {
-                    for (idx, Field { name, type_ref, visibility, has_default: _ }) in
-                        fields.iter().enumerate()
-                    {
+                    for (idx, Field { name, type_ref, visibility }) in fields.iter().enumerate() {
                         this.print_attrs_of(
                             AttrOwner::Field(parent, Idx::from_raw(RawIdx::from(idx as u32))),
                             "\n",
@@ -153,9 +151,7 @@ impl Printer<'_> {
             FieldsShape::Tuple => {
                 w!(self, "(");
                 self.indented(|this| {
-                    for (idx, Field { name, type_ref, visibility, has_default: _ }) in
-                        fields.iter().enumerate()
-                    {
+                    for (idx, Field { name, type_ref, visibility }) in fields.iter().enumerate() {
                         this.print_attrs_of(
                             AttrOwner::Field(parent, Idx::from_raw(RawIdx::from(idx as u32))),
                             "\n",
diff --git a/crates/hir-def/src/lib.rs b/crates/hir-def/src/lib.rs
index 6bc8741c33..c8efd90432 100644
--- a/crates/hir-def/src/lib.rs
+++ b/crates/hir-def/src/lib.rs
@@ -55,7 +55,6 @@ pub mod visibility;
 
 use intern::Interned;
 pub use rustc_abi as layout;
-use src::HasSource;
 use triomphe::Arc;
 
 #[cfg(test)]
@@ -78,7 +77,6 @@ use hir_expand::{
     builtin::{BuiltinAttrExpander, BuiltinDeriveExpander, BuiltinFnLikeExpander, EagerExpander},
     db::ExpandDatabase,
     eager::expand_eager_macro_input,
-    files::InFileWrapper,
     impl_intern_lookup,
     name::Name,
     proc_macro::{CustomProcMacroExpander, ProcMacroKind},
@@ -521,41 +519,6 @@ pub struct FieldId {
     pub local_id: LocalFieldId,
 }
 
-impl FieldId {
-    pub fn record_field_source(
-        &self,
-        db: &dyn DefDatabase,
-    ) -> InFileWrapper<HirFileId, Option<ast::RecordField>> {
-        let field_list = match self.parent {
-            crate::VariantId::EnumVariantId(it) => {
-                let s = it.lookup(db);
-                s.source(db).map(|it| {
-                    it.field_list().and_then(|it| match it {
-                        ast::FieldList::RecordFieldList(it) => Some(it),
-                        _ => None,
-                    })
-                })
-            }
-            crate::VariantId::StructId(it) => {
-                let s = it.lookup(db);
-                s.source(db).map(|it| {
-                    it.field_list().and_then(|it| match it {
-                        ast::FieldList::RecordFieldList(it) => Some(it),
-                        _ => None,
-                    })
-                })
-            }
-            crate::VariantId::UnionId(it) => {
-                let s = it.lookup(db);
-                s.source(db).map(|it| it.record_field_list())
-            }
-        };
-        field_list.map(|it| {
-            it.and_then(|it| it.fields().nth(self.local_id.into_raw().into_u32() as usize))
-        })
-    }
-}
-
 pub type LocalFieldId = Idx<data::adt::FieldData>;
 
 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
@@ -723,7 +686,6 @@ pub enum TypeOwnerId {
     TypeAliasId(TypeAliasId),
     ImplId(ImplId),
     EnumVariantId(EnumVariantId),
-    FieldId(FieldId),
 }
 
 impl TypeOwnerId {
@@ -741,11 +703,6 @@ impl TypeOwnerId {
                 GenericDefId::AdtId(AdtId::EnumId(it.lookup(db).parent))
             }
             TypeOwnerId::InTypeConstId(_) => return None,
-            TypeOwnerId::FieldId(it) => GenericDefId::AdtId(match it.parent {
-                VariantId::EnumVariantId(it) => AdtId::EnumId(it.lookup(db).parent),
-                VariantId::StructId(it) => it.into(),
-                VariantId::UnionId(it) => it.into(),
-            }),
         })
     }
 }
@@ -760,8 +717,7 @@ impl_from!(
     TraitAliasId,
     TypeAliasId,
     ImplId,
-    EnumVariantId,
-    FieldId
+    EnumVariantId
     for TypeOwnerId
 );
 
@@ -774,7 +730,6 @@ impl From<DefWithBodyId> for TypeOwnerId {
             DefWithBodyId::ConstId(it) => it.into(),
             DefWithBodyId::InTypeConstId(it) => it.into(),
             DefWithBodyId::VariantId(it) => it.into(),
-            DefWithBodyId::FieldId(it) => it.into(),
         }
     }
 }
@@ -930,7 +885,6 @@ pub enum DefWithBodyId {
     ConstId(ConstId),
     InTypeConstId(InTypeConstId),
     VariantId(EnumVariantId),
-    FieldId(FieldId),
 }
 
 impl_from!(FunctionId, ConstId, StaticId, InTypeConstId for DefWithBodyId);
@@ -951,7 +905,6 @@ impl DefWithBodyId {
             // FIXME: stable rust doesn't allow generics in constants, but we should
             // use `TypeOwnerId::as_generic_def_id` when it does.
             DefWithBodyId::InTypeConstId(_) => None,
-            DefWithBodyId::FieldId(_) => None,
         }
     }
 }
@@ -1356,12 +1309,6 @@ impl HasModule for VariantId {
     }
 }
 
-impl HasModule for FieldId {
-    fn module(&self, db: &dyn DefDatabase) -> ModuleId {
-        self.parent.module(db)
-    }
-}
-
 impl HasModule for MacroId {
     fn module(&self, db: &dyn DefDatabase) -> ModuleId {
         match *self {
@@ -1385,7 +1332,6 @@ impl HasModule for TypeOwnerId {
             TypeOwnerId::ImplId(it) => it.module(db),
             TypeOwnerId::EnumVariantId(it) => it.module(db),
             TypeOwnerId::InTypeConstId(it) => it.lookup(db).owner.module(db),
-            TypeOwnerId::FieldId(it) => it.module(db),
         }
     }
 }
@@ -1398,7 +1344,6 @@ impl HasModule for DefWithBodyId {
             DefWithBodyId::ConstId(it) => it.module(db),
             DefWithBodyId::VariantId(it) => it.module(db),
             DefWithBodyId::InTypeConstId(it) => it.lookup(db).owner.module(db),
-            DefWithBodyId::FieldId(it) => it.module(db),
         }
     }
 }
diff --git a/crates/hir-def/src/resolver.rs b/crates/hir-def/src/resolver.rs
index b415efafa6..7e13ae2f7a 100644
--- a/crates/hir-def/src/resolver.rs
+++ b/crates/hir-def/src/resolver.rs
@@ -27,11 +27,10 @@ use crate::{
     type_ref::{LifetimeRef, TypesMap},
     visibility::{RawVisibility, Visibility},
     AdtId, ConstId, ConstParamId, CrateRootModuleId, DefWithBodyId, EnumId, EnumVariantId,
-    ExternBlockId, ExternCrateId, FieldId, FunctionId, FxIndexMap, GenericDefId, GenericParamId,
-    HasModule, ImplId, ItemContainerId, ItemTreeLoc, LifetimeParamId, LocalModuleId, Lookup,
-    Macro2Id, MacroId, MacroRulesId, ModuleDefId, ModuleId, ProcMacroId, StaticId, StructId,
-    TraitAliasId, TraitId, TypeAliasId, TypeOrConstParamId, TypeOwnerId, TypeParamId, UseId,
-    VariantId,
+    ExternBlockId, ExternCrateId, FunctionId, FxIndexMap, GenericDefId, GenericParamId, HasModule,
+    ImplId, ItemContainerId, ItemTreeLoc, LifetimeParamId, LocalModuleId, Lookup, Macro2Id,
+    MacroId, MacroRulesId, ModuleDefId, ModuleId, ProcMacroId, StaticId, StructId, TraitAliasId,
+    TraitId, TypeAliasId, TypeOrConstParamId, TypeOwnerId, TypeParamId, UseId, VariantId,
 };
 
 #[derive(Debug, Clone)]
@@ -1228,7 +1227,6 @@ impl HasResolver for TypeOwnerId {
             TypeOwnerId::TypeAliasId(it) => it.resolver(db),
             TypeOwnerId::ImplId(it) => it.resolver(db),
             TypeOwnerId::EnumVariantId(it) => it.resolver(db),
-            TypeOwnerId::FieldId(it) => it.resolver(db),
         }
     }
 }
@@ -1241,7 +1239,6 @@ impl HasResolver for DefWithBodyId {
             DefWithBodyId::StaticId(s) => s.resolver(db),
             DefWithBodyId::VariantId(v) => v.resolver(db),
             DefWithBodyId::InTypeConstId(c) => c.lookup(db).owner.resolver(db),
-            DefWithBodyId::FieldId(f) => f.resolver(db),
         }
     }
 }
@@ -1288,12 +1285,6 @@ impl HasResolver for VariantId {
     }
 }
 
-impl HasResolver for FieldId {
-    fn resolver(self, db: &dyn DefDatabase) -> Resolver {
-        self.parent.resolver(db)
-    }
-}
-
 impl HasResolver for MacroId {
     fn resolver(self, db: &dyn DefDatabase) -> Resolver {
         match self {
diff --git a/crates/hir-expand/src/builtin/derive_macro.rs b/crates/hir-expand/src/builtin/derive_macro.rs
index f8fb700d55..28b6812139 100644
--- a/crates/hir-expand/src/builtin/derive_macro.rs
+++ b/crates/hir-expand/src/builtin/derive_macro.rs
@@ -80,15 +80,9 @@ pub fn find_builtin_derive(ident: &name::Name) -> Option<BuiltinDeriveExpander>
     BuiltinDeriveExpander::find_by_name(ident)
 }
 
-#[derive(Clone, Copy)]
-enum HasDefault {
-    Yes,
-    No,
-}
-
 #[derive(Clone)]
 enum VariantShape {
-    Struct(Vec<(tt::Ident, HasDefault)>),
+    Struct(Vec<tt::Ident>),
     Tuple(usize),
     Unit,
 }
@@ -104,7 +98,7 @@ impl VariantShape {
 
     fn field_names(&self, span: Span) -> Vec<tt::Ident> {
         match self {
-            VariantShape::Struct(s) => s.iter().map(|(ident, _)| ident.clone()).collect(),
+            VariantShape::Struct(s) => s.clone(),
             VariantShape::Tuple(n) => tuple_field_iterator(span, *n).collect(),
             VariantShape::Unit => vec![],
         }
@@ -118,7 +112,7 @@ impl VariantShape {
     ) -> tt::TopSubtree {
         match self {
             VariantShape::Struct(fields) => {
-                let fields = fields.iter().map(|(it, _)| {
+                let fields = fields.iter().map(|it| {
                     let mapped = field_map(it);
                     quote! {span => #it : #mapped , }
                 });
@@ -141,63 +135,6 @@ impl VariantShape {
         }
     }
 
-    fn default_expand(
-        &self,
-        path: tt::TopSubtree,
-        span: Span,
-        field_map: impl Fn(&tt::Ident) -> tt::TopSubtree,
-    ) -> tt::TopSubtree {
-        match self {
-            VariantShape::Struct(fields) => {
-                let contains_default = fields.iter().any(|it| matches!(it.1, HasDefault::Yes));
-                let fields = fields
-                    .iter()
-                    .filter_map(|(it, has_default)| match has_default {
-                        HasDefault::Yes => None,
-                        HasDefault::No => Some(it),
-                    })
-                    .map(|it| {
-                        let mapped = field_map(it);
-                        quote! {span => #it : #mapped , }
-                    });
-                if contains_default {
-                    let mut double_dots =
-                        tt::TopSubtreeBuilder::new(tt::Delimiter::invisible_spanned(span));
-                    double_dots.push(tt::Leaf::Punct(tt::Punct {
-                        char: '.',
-                        spacing: tt::Spacing::Joint,
-                        span,
-                    }));
-                    double_dots.push(tt::Leaf::Punct(tt::Punct {
-                        char: '.',
-                        spacing: tt::Spacing::Alone,
-                        span,
-                    }));
-                    let double_dots = double_dots.build();
-                    quote! {span =>
-                        #path { ##fields #double_dots }
-                    }
-                } else {
-                    quote! {span =>
-                        #path { ##fields }
-                    }
-                }
-            }
-            &VariantShape::Tuple(n) => {
-                let fields = tuple_field_iterator(span, n).map(|it| {
-                    let mapped = field_map(&it);
-                    quote! {span =>
-                        #mapped ,
-                    }
-                });
-                quote! {span =>
-                    #path ( ##fields )
-                }
-            }
-            VariantShape::Unit => path,
-        }
-    }
-
     fn from(
         call_site: Span,
         tm: &ExpansionSpanMap,
@@ -207,15 +144,8 @@ impl VariantShape {
             None => VariantShape::Unit,
             Some(FieldList::RecordFieldList(it)) => VariantShape::Struct(
                 it.fields()
-                    .map(|it| {
-                        (
-                            it.name(),
-                            if it.expr().is_some() { HasDefault::Yes } else { HasDefault::No },
-                        )
-                    })
-                    .map(|(it, has_default)| {
-                        name_to_token(call_site, tm, it).map(|ident| (ident, has_default))
-                    })
+                    .map(|it| it.name())
+                    .map(|it| name_to_token(call_site, tm, it))
                     .collect::<Result<_, _>>()?,
             ),
             Some(FieldList::TupleFieldList(it)) => VariantShape::Tuple(it.fields().count()),
@@ -671,7 +601,7 @@ fn default_expand(
         let body = match &adt.shape {
             AdtShape::Struct(fields) => {
                 let name = &adt.name;
-                fields.default_expand(
+                fields.as_pattern_map(
                     quote!(span =>#name),
                     span,
                     |_| quote!(span =>#krate::default::Default::default()),
@@ -681,7 +611,7 @@ fn default_expand(
                 if let Some(d) = default_variant {
                     let (name, fields) = &variants[*d];
                     let adt_name = &adt.name;
-                    fields.default_expand(
+                    fields.as_pattern_map(
                         quote!(span =>#adt_name :: #name),
                         span,
                         |_| quote!(span =>#krate::default::Default::default()),
@@ -713,7 +643,7 @@ fn debug_expand(
     expand_simple_derive(db, span, tt, quote! {span => #krate::fmt::Debug }, |adt| {
         let for_variant = |name: String, v: &VariantShape| match v {
             VariantShape::Struct(fields) => {
-                let for_fields = fields.iter().map(|(it, _)| {
+                let for_fields = fields.iter().map(|it| {
                     let x_string = it.to_string();
                     quote! {span =>
                         .field(#x_string, & #it)
diff --git a/crates/hir-ty/src/autoderef.rs b/crates/hir-ty/src/autoderef.rs
index e0e366f450..62feca5f8c 100644
--- a/crates/hir-ty/src/autoderef.rs
+++ b/crates/hir-ty/src/autoderef.rs
@@ -194,11 +194,7 @@ pub(crate) fn deref_by_trait(
     }
 
     let trait_id = || {
-        // FIXME: Remove the `false` once `Receiver` needs to be stabilized, doing so will
-        // effectively bump the MSRV of rust-analyzer to 1.84 due to 1.83 and below lacking the
-        // blanked impl on `Deref`.
-        #[expect(clippy::overly_complex_bool_expr)]
-        if use_receiver_trait && false {
+        if use_receiver_trait {
             if let Some(receiver) =
                 db.lang_item(table.trait_env.krate, LangItem::Receiver).and_then(|l| l.as_trait())
             {
diff --git a/crates/hir-ty/src/diagnostics/expr.rs b/crates/hir-ty/src/diagnostics/expr.rs
index d744fe64c0..0b5f131924 100644
--- a/crates/hir-ty/src/diagnostics/expr.rs
+++ b/crates/hir-ty/src/diagnostics/expr.rs
@@ -8,7 +8,6 @@ use base_db::CrateId;
 use chalk_solve::rust_ir::AdtKind;
 use either::Either;
 use hir_def::{
-    hir::Spread,
     lang_item::LangItem,
     resolver::{HasResolver, ValueNs},
     AdtId, AssocItemId, DefWithBodyId, HasModule, ItemContainerId, Lookup,
@@ -547,11 +546,9 @@ pub fn record_literal_missing_fields(
     infer: &InferenceResult,
     id: ExprId,
     expr: &Expr,
-) -> Option<(VariantId, Vec<LocalFieldId>, /*has spread expr*/ bool)> {
-    let (fields, has_spread_expr, has_ellipsis) = match expr {
-        Expr::RecordLit { fields, spread, .. } => {
-            (fields, !matches!(spread, Spread::Base(_)), matches!(spread, Spread::Yes))
-        }
+) -> Option<(VariantId, Vec<LocalFieldId>, /*exhaustive*/ bool)> {
+    let (fields, exhaustive) = match expr {
+        Expr::RecordLit { fields, spread, .. } => (fields, spread.is_none()),
         _ => return None,
     };
 
@@ -566,18 +563,12 @@ pub fn record_literal_missing_fields(
     let missed_fields: Vec<LocalFieldId> = variant_data
         .fields()
         .iter()
-        .filter_map(|(f, d)| {
-            if (has_ellipsis && d.has_default) || specified_fields.contains(&d.name) {
-                None
-            } else {
-                Some(f)
-            }
-        })
+        .filter_map(|(f, d)| if specified_fields.contains(&d.name) { None } else { Some(f) })
         .collect();
     if missed_fields.is_empty() {
         return None;
     }
-    Some((variant_def, missed_fields, has_spread_expr))
+    Some((variant_def, missed_fields, exhaustive))
 }
 
 pub fn record_pattern_missing_fields(
diff --git a/crates/hir-ty/src/diagnostics/unsafe_check.rs b/crates/hir-ty/src/diagnostics/unsafe_check.rs
index 2aca99c93b..ac849b0762 100644
--- a/crates/hir-ty/src/diagnostics/unsafe_check.rs
+++ b/crates/hir-ty/src/diagnostics/unsafe_check.rs
@@ -35,8 +35,7 @@ pub fn missing_unsafe(db: &dyn HirDatabase, def: DefWithBodyId) -> MissingUnsafe
         DefWithBodyId::StaticId(_)
         | DefWithBodyId::ConstId(_)
         | DefWithBodyId::VariantId(_)
-        | DefWithBodyId::InTypeConstId(_)
-        | DefWithBodyId::FieldId(_) => false,
+        | DefWithBodyId::InTypeConstId(_) => false,
     };
 
     let mut res = MissingUnsafeResult { fn_is_unsafe: is_unsafe, ..MissingUnsafeResult::default() };
diff --git a/crates/hir-ty/src/infer.rs b/crates/hir-ty/src/infer.rs
index 1b2ef2aef3..3c258e3c4c 100644
--- a/crates/hir-ty/src/infer.rs
+++ b/crates/hir-ty/src/infer.rs
@@ -134,9 +134,6 @@ pub(crate) fn infer_query(db: &dyn HirDatabase, def: DefWithBodyId) -> Arc<Infer
                 .unwrap()
                 .0;
         }
-        DefWithBodyId::FieldId(f) => {
-            ctx.collect_field(f);
-        }
     }
 
     ctx.infer_body();
@@ -913,19 +910,6 @@ impl<'a> InferenceContext<'a> {
         self.return_ty = return_ty;
     }
 
-    fn collect_field(&mut self, field: FieldId) {
-        let variant_data = field.parent.variant_data(self.db.upcast());
-        let field_data = &variant_data.fields()[field.local_id];
-        let types_map = variant_data.types_map();
-        let return_ty =
-            self.make_ty(field_data.type_ref, types_map, InferenceTyDiagnosticSource::Signature);
-
-        // Field default value exprs might be defining usage sites of TAITs.
-        self.make_tait_coercion_table(iter::once(&return_ty));
-
-        self.return_ty = return_ty;
-    }
-
     fn collect_fn(&mut self, func: FunctionId) {
         let data = self.db.function_data(func);
         let mut param_tys =
diff --git a/crates/hir-ty/src/infer/closure.rs b/crates/hir-ty/src/infer/closure.rs
index 0e9aed4160..9283c46d0f 100644
--- a/crates/hir-ty/src/infer/closure.rs
+++ b/crates/hir-ty/src/infer/closure.rs
@@ -12,7 +12,7 @@ use hir_def::{
     data::adt::VariantData,
     hir::{
         Array, AsmOperand, BinaryOp, BindingId, CaptureBy, Expr, ExprId, ExprOrPatId, Pat, PatId,
-        Spread, Statement, UnaryOp,
+        Statement, UnaryOp,
     },
     lang_item::LangItem,
     path::Path,
@@ -796,7 +796,7 @@ impl InferenceContext<'_> {
                 self.consume_expr(expr);
             }
             Expr::RecordLit { fields, spread, .. } => {
-                if let &Spread::Base(expr) = spread {
+                if let &Some(expr) = spread {
                     self.consume_expr(expr);
                 }
                 self.consume_exprs(fields.iter().map(|it| it.expr));
diff --git a/crates/hir-ty/src/infer/expr.rs b/crates/hir-ty/src/infer/expr.rs
index 179565440c..b951443897 100644
--- a/crates/hir-ty/src/infer/expr.rs
+++ b/crates/hir-ty/src/infer/expr.rs
@@ -10,7 +10,7 @@ use either::Either;
 use hir_def::{
     hir::{
         ArithOp, Array, AsmOperand, AsmOptions, BinaryOp, ClosureKind, Expr, ExprId, ExprOrPatId,
-        LabelId, Literal, Pat, PatId, Spread, Statement, UnaryOp,
+        LabelId, Literal, Pat, PatId, Statement, UnaryOp,
     },
     lang_item::{LangItem, LangItemTarget},
     path::{GenericArg, GenericArgs, Path},
@@ -775,7 +775,7 @@ impl InferenceContext<'_> {
                         }
                     }
                 }
-                if let Spread::Base(expr) = spread {
+                if let Some(expr) = spread {
                     self.infer_expr(*expr, &Expectation::has_type(ty.clone()), ExprIsRead::Yes);
                 }
                 ty
@@ -1746,14 +1746,12 @@ impl InferenceContext<'_> {
                     });
                 }
                 TyKind::Adt(AdtId(hir_def::AdtId::StructId(s)), parameters) => {
-                    let vd = &self.db.struct_data(*s).variant_data;
-                    let local_id = vd.field(name)?;
+                    let local_id = self.db.struct_data(*s).variant_data.field(name)?;
                     let field = FieldId { parent: (*s).into(), local_id };
                     (field, parameters.clone())
                 }
                 TyKind::Adt(AdtId(hir_def::AdtId::UnionId(u)), parameters) => {
-                    let vd = &self.db.union_data(*u).variant_data;
-                    let local_id = vd.field(name)?;
+                    let local_id = self.db.union_data(*u).variant_data.field(name)?;
                     let field = FieldId { parent: (*u).into(), local_id };
                     (field, parameters.clone())
                 }
diff --git a/crates/hir-ty/src/infer/mutability.rs b/crates/hir-ty/src/infer/mutability.rs
index e95a425498..d74a383f44 100644
--- a/crates/hir-ty/src/infer/mutability.rs
+++ b/crates/hir-ty/src/infer/mutability.rs
@@ -4,8 +4,8 @@
 use chalk_ir::{cast::Cast, Mutability};
 use hir_def::{
     hir::{
-        Array, AsmOperand, BinaryOp, BindingAnnotation, Expr, ExprId, Pat, PatId, Spread,
-        Statement, UnaryOp,
+        Array, AsmOperand, BinaryOp, BindingAnnotation, Expr, ExprId, Pat, PatId, Statement,
+        UnaryOp,
     },
     lang_item::LangItem,
 };
@@ -122,11 +122,7 @@ impl InferenceContext<'_> {
                 self.infer_mut_expr(*expr, Mutability::Not);
             }
             Expr::RecordLit { path: _, fields, spread } => {
-                let spread_expr = match spread {
-                    Spread::Base(expr) => Some(*expr),
-                    _ => None,
-                };
-                self.infer_mut_not_expr_iter(fields.iter().map(|it| it.expr).chain(spread_expr))
+                self.infer_mut_not_expr_iter(fields.iter().map(|it| it.expr).chain(*spread))
             }
             &Expr::Index { base, index } => {
                 if mutability == Mutability::Mut {
diff --git a/crates/hir-ty/src/mir/lower.rs b/crates/hir-ty/src/mir/lower.rs
index 940d992001..cc6ed122af 100644
--- a/crates/hir-ty/src/mir/lower.rs
+++ b/crates/hir-ty/src/mir/lower.rs
@@ -9,7 +9,7 @@ use hir_def::{
     expr_store::{Body, HygieneId},
     hir::{
         ArithOp, Array, BinaryOp, BindingAnnotation, BindingId, ExprId, LabelId, Literal,
-        LiteralOrConst, MatchArm, Pat, PatId, RecordFieldPat, RecordLitField, Spread,
+        LiteralOrConst, MatchArm, Pat, PatId, RecordFieldPat, RecordLitField,
     },
     lang_item::{LangItem, LangItemTarget},
     path::Path,
@@ -825,14 +825,14 @@ impl<'ctx> MirLowerCtx<'ctx> {
             Expr::Yield { .. } => not_supported!("yield"),
             Expr::RecordLit { fields, path, spread } => {
                 let spread_place = match spread {
-                    &Spread::Base(it) => {
+                    &Some(it) => {
                         let Some((p, c)) = self.lower_expr_as_place(current, it, true)? else {
                             return Ok(None);
                         };
                         current = c;
                         Some(p)
                     }
-                    _ => None,
+                    None => None,
                 };
                 let variant_id =
                     self.infer.variant_resolution_for_expr(expr_id).ok_or_else(|| match path {
@@ -870,12 +870,12 @@ impl<'ctx> MirLowerCtx<'ctx> {
                                     .map(|(i, it)| match it {
                                         Some(it) => it,
                                         None => {
-                                            let local_id =
-                                                LocalFieldId::from_raw(RawIdx::from(i as u32));
                                             let p = sp.project(
                                                 ProjectionElem::Field(Either::Left(FieldId {
                                                     parent: variant_id,
-                                                    local_id,
+                                                    local_id: LocalFieldId::from_raw(RawIdx::from(
+                                                        i as u32,
+                                                    )),
                                                 })),
                                                 &mut self.result.projection_store,
                                             );
@@ -2130,10 +2130,6 @@ pub fn mir_body_query(db: &dyn HirDatabase, def: DefWithBodyId) -> Result<Arc<Mi
             db.enum_variant_data(it).name.display(db.upcast(), edition).to_string()
         }
         DefWithBodyId::InTypeConstId(it) => format!("in type const {it:?}"),
-        DefWithBodyId::FieldId(it) => it.parent.variant_data(db.upcast()).fields()[it.local_id]
-            .name
-            .display(db.upcast(), edition)
-            .to_string(),
     };
     let _p = tracing::info_span!("mir_body_query", ?detail).entered();
     let body = db.body(def);
diff --git a/crates/hir-ty/src/mir/pretty.rs b/crates/hir-ty/src/mir/pretty.rs
index 193b7bcd97..2a26101ac4 100644
--- a/crates/hir-ty/src/mir/pretty.rs
+++ b/crates/hir-ty/src/mir/pretty.rs
@@ -6,7 +6,7 @@ use std::{
 };
 
 use either::Either;
-use hir_def::{expr_store::Body, hir::BindingId, VariantId};
+use hir_def::{expr_store::Body, hir::BindingId};
 use hir_expand::{name::Name, Lookup};
 use la_arena::ArenaMap;
 use span::Edition;
@@ -79,38 +79,6 @@ impl MirBody {
             hir_def::DefWithBodyId::InTypeConstId(id) => {
                 w!(this, "in type const {id:?} = ");
             }
-            hir_def::DefWithBodyId::FieldId(id) => {
-                w!(this, "field ");
-                match id.parent {
-                    VariantId::EnumVariantId(it) => {
-                        let loc = it.lookup(db.upcast());
-                        let enum_loc = loc.parent.lookup(db.upcast());
-                        w!(
-                            this,
-                            "{}::{}",
-                            enum_loc.id.item_tree(db.upcast())[enum_loc.id.value]
-                                .name
-                                .display(db.upcast(), Edition::LATEST),
-                            loc.id.item_tree(db.upcast())[loc.id.value]
-                                .name
-                                .display(db.upcast(), Edition::LATEST),
-                        );
-                    }
-                    VariantId::StructId(id) => {
-                        id.lookup(db.upcast()).id.resolved(db.upcast(), |it| {
-                            w!(this, "{}", it.name.display(db.upcast(), Edition::LATEST));
-                        });
-                    }
-                    VariantId::UnionId(id) => {
-                        id.lookup(db.upcast()).id.resolved(db.upcast(), |it| {
-                            w!(this, "{}", it.name.display(db.upcast(), Edition::LATEST));
-                        });
-                    }
-                };
-                let variant_data = id.parent.variant_data(db.upcast());
-                let field_name = &variant_data.fields()[id.local_id].name;
-                w!(this, ".{}: _ = ", field_name.display(db.upcast(), Edition::LATEST));
-            }
         });
         ctx.result
     }
diff --git a/crates/hir/src/from_id.rs b/crates/hir/src/from_id.rs
index dd26e894d7..537401afdc 100644
--- a/crates/hir/src/from_id.rs
+++ b/crates/hir/src/from_id.rs
@@ -147,7 +147,6 @@ impl From<DefWithBody> for DefWithBodyId {
             DefWithBody::Const(it) => DefWithBodyId::ConstId(it.id),
             DefWithBody::Variant(it) => DefWithBodyId::VariantId(it.into()),
             DefWithBody::InTypeConst(it) => DefWithBodyId::InTypeConstId(it.id),
-            DefWithBody::Field(it) => DefWithBodyId::FieldId(it.into()),
         }
     }
 }
@@ -160,7 +159,6 @@ impl From<DefWithBodyId> for DefWithBody {
             DefWithBodyId::ConstId(it) => DefWithBody::Const(it.into()),
             DefWithBodyId::VariantId(it) => DefWithBody::Variant(it.into()),
             DefWithBodyId::InTypeConstId(it) => DefWithBody::InTypeConst(it.into()),
-            DefWithBodyId::FieldId(it) => DefWithBody::Field(it.into()),
         }
     }
 }
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index a38c0211e8..56090bc6b6 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -415,28 +415,6 @@ impl ModuleDef {
             def.diagnostics(db, &mut acc);
         }
 
-        let vd: Option<(VariantDef, Arc<VariantData>)> = match self {
-            ModuleDef::Adt(Adt::Struct(it)) => {
-                Some((it.into(), db.struct_data(it.id).variant_data.clone()))
-            }
-            ModuleDef::Adt(Adt::Union(it)) => {
-                Some((it.into(), db.union_data(it.id).variant_data.clone()))
-            }
-            ModuleDef::Variant(it) => {
-                Some((it.into(), db.enum_variant_data(it.id).variant_data.clone()))
-            }
-            _ => None,
-        };
-        if let Some((parent, vd)) = vd {
-            for (id, fd) in vd.fields().iter() {
-                if !fd.has_default {
-                    continue;
-                }
-                let def: DefWithBody = DefWithBody::Field(Field { parent, id });
-                def.diagnostics(db, &mut acc, style_lints);
-            }
-        }
-
         acc
     }
 
@@ -1248,12 +1226,6 @@ impl HasVisibility for Module {
     }
 }
 
-impl From<&Field> for DefWithBodyId {
-    fn from(&f: &Field) -> Self {
-        DefWithBodyId::FieldId(f.into())
-    }
-}
-
 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
 pub struct Field {
     pub(crate) parent: VariantDef,
@@ -1319,10 +1291,6 @@ impl AstNode for FieldSource {
 }
 
 impl Field {
-    pub fn module(self, db: &dyn HirDatabase) -> Module {
-        self.parent.module(db)
-    }
-
     pub fn name(&self, db: &dyn HirDatabase) -> Name {
         self.parent.variant_data(db).fields()[self.id].name.clone()
     }
@@ -1385,14 +1353,6 @@ impl Field {
     pub fn parent_def(&self, _db: &dyn HirDatabase) -> VariantDef {
         self.parent
     }
-
-    pub fn default_value_source(
-        &self,
-        db: &dyn HirDatabase,
-    ) -> Option<InFileWrapper<HirFileId, ast::Expr>> {
-        let id: hir_def::FieldId = (*self).into();
-        id.record_field_source(db.upcast()).map(|it| it.and_then(|it| it.expr())).transpose()
-    }
 }
 
 impl HasVisibility for Field {
@@ -1829,9 +1789,8 @@ pub enum DefWithBody {
     Const(Const),
     Variant(Variant),
     InTypeConst(InTypeConst),
-    Field(Field),
 }
-impl_from!(Function, Const, Static, Variant, InTypeConst, Field for DefWithBody);
+impl_from!(Function, Const, Static, Variant, InTypeConst for DefWithBody);
 
 impl DefWithBody {
     pub fn module(self, db: &dyn HirDatabase) -> Module {
@@ -1841,7 +1800,6 @@ impl DefWithBody {
             DefWithBody::Static(s) => s.module(db),
             DefWithBody::Variant(v) => v.module(db),
             DefWithBody::InTypeConst(c) => c.module(db),
-            DefWithBody::Field(f) => f.module(db),
         }
     }
 
@@ -1852,7 +1810,6 @@ impl DefWithBody {
             DefWithBody::Const(c) => c.name(db),
             DefWithBody::Variant(v) => Some(v.name(db)),
             DefWithBody::InTypeConst(_) => None,
-            DefWithBody::Field(f) => Some(f.name(db)),
         }
     }
 
@@ -1868,7 +1825,6 @@ impl DefWithBody {
                 &DefWithBodyId::from(it.id).resolver(db.upcast()),
                 TyKind::Error.intern(Interner),
             ),
-            DefWithBody::Field(it) => it.ty(db),
         }
     }
 
@@ -1879,7 +1835,6 @@ impl DefWithBody {
             DefWithBody::Const(it) => it.id.into(),
             DefWithBody::Variant(it) => it.into(),
             DefWithBody::InTypeConst(it) => it.id.into(),
-            DefWithBody::Field(it) => it.into(),
         }
     }
 
@@ -1925,23 +1880,6 @@ impl DefWithBody {
                 item_tree_source_maps.konst(konst.value)
             }
             DefWithBody::Variant(_) | DefWithBody::InTypeConst(_) => &TypesSourceMap::EMPTY,
-            DefWithBody::Field(field) => match field.parent {
-                VariantDef::Struct(strukt) => {
-                    let strukt = strukt.id.lookup(db.upcast()).id;
-                    item_tree_source_maps = strukt.item_tree_with_source_map(db.upcast()).1;
-                    item_tree_source_maps.strukt(strukt.value).item()
-                }
-                VariantDef::Union(union) => {
-                    let union = union.id.lookup(db.upcast()).id;
-                    item_tree_source_maps = union.item_tree_with_source_map(db.upcast()).1;
-                    item_tree_source_maps.union(union.value).item()
-                }
-                VariantDef::Variant(variant) => {
-                    let variant = variant.id.lookup(db.upcast()).id;
-                    item_tree_source_maps = variant.item_tree_with_source_map(db.upcast()).1;
-                    item_tree_source_maps.variant(variant.value)
-                }
-            },
         };
 
         for (_, def_map) in body.blocks(db.upcast()) {
@@ -2197,8 +2135,8 @@ impl DefWithBody {
             DefWithBody::Static(it) => it.into(),
             DefWithBody::Const(it) => it.into(),
             DefWithBody::Variant(it) => it.into(),
-            // FIXME: don't ignore diagnostics for in type const and default field value exprs
-            DefWithBody::InTypeConst(_) | DefWithBody::Field(_) => return,
+            // FIXME: don't ignore diagnostics for in type const
+            DefWithBody::InTypeConst(_) => return,
         };
         for diag in hir_ty::diagnostics::incorrect_case(db, def.into()) {
             acc.push(diag.into())
@@ -3331,10 +3269,7 @@ impl AsAssocItem for DefWithBody {
         match self {
             DefWithBody::Function(it) => it.as_assoc_item(db),
             DefWithBody::Const(it) => it.as_assoc_item(db),
-            DefWithBody::Static(_)
-            | DefWithBody::Variant(_)
-            | DefWithBody::InTypeConst(_)
-            | DefWithBody::Field(_) => None,
+            DefWithBody::Static(_) | DefWithBody::Variant(_) | DefWithBody::InTypeConst(_) => None,
         }
     }
 }
diff --git a/crates/hir/src/source_analyzer.rs b/crates/hir/src/source_analyzer.rs
index 7d6f110181..ca239826d4 100644
--- a/crates/hir/src/source_analyzer.rs
+++ b/crates/hir/src/source_analyzer.rs
@@ -630,8 +630,7 @@ impl SourceAnalyzer {
         let (adt, subst) = self.infer.as_ref()?.type_of_expr_or_pat(expr_id)?.as_adt()?;
         let variant = self.infer.as_ref()?.variant_resolution_for_expr_or_pat(expr_id)?;
         let variant_data = variant.variant_data(db.upcast());
-        let local_id = variant_data.field(&local_name)?;
-        let field = FieldId { parent: variant, local_id };
+        let field = FieldId { parent: variant, local_id: variant_data.field(&local_name)? };
         let field_ty =
             db.field_types(variant).get(field.local_id)?.clone().substitute(Interner, subst);
         Some((
@@ -652,8 +651,7 @@ impl SourceAnalyzer {
         let pat_id = self.pat_id(&record_pat.into())?;
         let variant = self.infer.as_ref()?.variant_resolution_for_pat(pat_id)?;
         let variant_data = variant.variant_data(db.upcast());
-        let local_id = variant_data.field(&field_name)?;
-        let field = FieldId { parent: variant, local_id };
+        let field = FieldId { parent: variant, local_id: variant_data.field(&field_name)? };
         let (adt, subst) = self.infer.as_ref()?.type_of_pat.get(pat_id)?.as_adt()?;
         let field_ty =
             db.field_types(variant).get(field.local_id)?.clone().substitute(Interner, subst);
@@ -1025,7 +1023,7 @@ impl SourceAnalyzer {
         let expr_id = self.expr_id(db, &literal.clone().into())?;
         let substs = infer[expr_id].as_adt()?.1;
 
-        let (variant, missing_fields, _) = match expr_id {
+        let (variant, missing_fields, _exhaustive) = match expr_id {
             ExprOrPatId::ExprId(expr_id) => {
                 record_literal_missing_fields(db, infer, expr_id, &body[expr_id])?
             }
diff --git a/crates/ide-completion/src/completions/dot.rs b/crates/ide-completion/src/completions/dot.rs
index b38b9ac1f5..0557265f23 100644
--- a/crates/ide-completion/src/completions/dot.rs
+++ b/crates/ide-completion/src/completions/dot.rs
@@ -1500,7 +1500,9 @@ fn main() {
     bar.$0
 }
 "#,
-            expect![[r#""#]],
+            expect![[r#"
+    me foo() fn(self: Bar)
+"#]],
         );
     }
 
diff --git a/crates/ide-db/src/defs.rs b/crates/ide-db/src/defs.rs
index 6925880ba9..bad5360805 100644
--- a/crates/ide-db/src/defs.rs
+++ b/crates/ide-db/src/defs.rs
@@ -972,7 +972,6 @@ impl TryFrom<DefWithBody> for Definition {
             DefWithBody::Const(it) => Ok(it.into()),
             DefWithBody::Variant(it) => Ok(it.into()),
             DefWithBody::InTypeConst(_) => Err(()),
-            DefWithBody::Field(it) => Ok(it.into()),
         }
     }
 }
diff --git a/crates/ide-db/src/search.rs b/crates/ide-db/src/search.rs
index d2a237a5c0..7963e8ae4f 100644
--- a/crates/ide-db/src/search.rs
+++ b/crates/ide-db/src/search.rs
@@ -310,9 +310,6 @@ impl Definition {
                 DefWithBody::Variant(v) => v.source(db).map(|src| src.syntax().cloned()),
                 // FIXME: implement
                 DefWithBody::InTypeConst(_) => return SearchScope::empty(),
-                DefWithBody::Field(f) => {
-                    f.default_value_source(db).map(|src| src.syntax().cloned())
-                }
             };
             return match def {
                 Some(def) => SearchScope::file_range(
@@ -330,9 +327,6 @@ impl Definition {
                 DefWithBody::Variant(v) => v.source(db).map(|src| src.syntax().cloned()),
                 // FIXME: implement
                 DefWithBody::InTypeConst(_) => return SearchScope::empty(),
-                DefWithBody::Field(f) => {
-                    f.default_value_source(db).map(|src| src.syntax().cloned())
-                }
             };
             return match def {
                 Some(def) => SearchScope::file_range(
diff --git a/crates/ide-diagnostics/src/handlers/missing_fields.rs b/crates/ide-diagnostics/src/handlers/missing_fields.rs
index c495df9daa..938b7182bc 100644
--- a/crates/ide-diagnostics/src/handlers/missing_fields.rs
+++ b/crates/ide-diagnostics/src/handlers/missing_fields.rs
@@ -846,35 +846,4 @@ pub struct Claims {
         "#,
         );
     }
-
-    #[test]
-    fn default_field_values() {
-        check_diagnostics(
-            r#"
-struct F {
-    field1: i32 = 4,
-    field2: bool,
-}
-
-fn f() {
-    let _f = F {
-        field2: true,
-        ..
-    };
-
-    let _f = F {
-           //^ 💡 error: missing structure fields:
-           //| - field1
-        field2: true,
-    };
-
-    let _f = F {
-           //^ 💡 error: missing structure fields:
-           //| - field2
-        ..
-    };
-}
-"#,
-        );
-    }
 }
diff --git a/crates/ide-diagnostics/src/handlers/type_mismatch.rs b/crates/ide-diagnostics/src/handlers/type_mismatch.rs
index 4080b5f12e..73dcbc13b7 100644
--- a/crates/ide-diagnostics/src/handlers/type_mismatch.rs
+++ b/crates/ide-diagnostics/src/handlers/type_mismatch.rs
@@ -1232,21 +1232,6 @@ fn f() {
     let (_, _, _, ..) = (true, 42);
      // ^^^^^^^^^^^^^ error: expected (bool, i32), found (bool, i32, {unknown})
 }
-"#,
-        );
-    }
-
-    #[test]
-    fn diagnostics_inside_field_default_expr() {
-        check_diagnostics(
-            r#"
-struct Foo {
-    foo: i32 = {
-        let x = false;
-        x
-     // ^ error: expected i32, found bool
-    },
-}
 "#,
         );
     }
diff --git a/crates/ide/src/view_syntax_tree.rs b/crates/ide/src/view_syntax_tree.rs
index 80c3a40e71..218ee15a7d 100644
--- a/crates/ide/src/view_syntax_tree.rs
+++ b/crates/ide/src/view_syntax_tree.rs
@@ -1,15 +1,11 @@
 use hir::Semantics;
-use ide_db::{
-    line_index::{LineCol, LineIndex},
-    FileId, LineIndexDatabase, RootDatabase,
-};
-use span::{TextRange, TextSize};
+use ide_db::{FileId, RootDatabase};
+use span::TextRange;
 use stdx::format_to;
 use syntax::{
     ast::{self, IsString},
     AstNode, AstToken, NodeOrToken, SourceFile, SyntaxNode, SyntaxToken, WalkEvent,
 };
-use triomphe::Arc;
 
 // Feature: Show Syntax Tree
 //
@@ -22,31 +18,24 @@ use triomphe::Arc;
 // |===
 pub(crate) fn view_syntax_tree(db: &RootDatabase, file_id: FileId) -> String {
     let sema = Semantics::new(db);
-    let line_index = db.line_index(file_id);
     let parse = sema.parse_guess_edition(file_id);
-
-    let ctx = SyntaxTreeCtx { line_index, in_string: None };
-
-    syntax_node_to_json(parse.syntax(), &ctx)
+    syntax_node_to_json(parse.syntax(), None)
 }
 
-fn syntax_node_to_json(node: &SyntaxNode, ctx: &SyntaxTreeCtx) -> String {
+fn syntax_node_to_json(node: &SyntaxNode, ctx: Option<InStringCtx>) -> String {
     let mut result = String::new();
     for event in node.preorder_with_tokens() {
         match event {
             WalkEvent::Enter(it) => {
                 let kind = it.kind();
-                let (text_range, inner_range_str) = match &ctx.in_string {
-                    Some(in_string) => {
-                        let start_pos = TextPosition::new(&ctx.line_index, it.text_range().start());
-                        let end_pos = TextPosition::new(&ctx.line_index, it.text_range().end());
-
+                let (text_range, inner_range_str) = match &ctx {
+                    Some(ctx) => {
                         let inner_start: u32 = it.text_range().start().into();
-                        let inner_end: u32 = it.text_range().start().into();
+                        let inner_end: u32 = it.text_range().end().into();
 
-                        let mut true_start = inner_start + in_string.offset;
-                        let mut true_end = inner_end + in_string.offset;
-                        for pos in &in_string.marker_positions {
+                        let mut true_start = inner_start + ctx.offset;
+                        let mut true_end = inner_end + ctx.offset;
+                        for pos in &ctx.marker_positions {
                             if *pos >= inner_end {
                                 break;
                             }
@@ -59,33 +48,39 @@ fn syntax_node_to_json(node: &SyntaxNode, ctx: &SyntaxTreeCtx) -> String {
 
                         let true_range = TextRange::new(true_start.into(), true_end.into());
 
-                        (true_range, format!(r#","istart":{start_pos},"iend":{end_pos}"#,))
+                        (
+                            true_range,
+                            format!(
+                                r#","istart":{:?},"iend":{:?}"#,
+                                it.text_range().start(),
+                                it.text_range().end()
+                            ),
+                        )
                     }
                     None => (it.text_range(), "".to_owned()),
                 };
-
-                let start = TextPosition::new(&ctx.line_index, text_range.start());
-                let end = TextPosition::new(&ctx.line_index, text_range.end());
+                let start = text_range.start();
+                let end = text_range.end();
 
                 match it {
                     NodeOrToken::Node(_) => {
                         format_to!(
                             result,
-                            r#"{{"type":"Node","kind":"{kind:?}","start":{start},"end":{end}{inner_range_str},"children":["#
+                            r#"{{"type":"Node","kind":"{kind:?}","start":{start:?},"end":{end:?}{inner_range_str},"children":["#
                         );
                     }
                     NodeOrToken::Token(token) => {
                         let comma = if token.next_sibling_or_token().is_some() { "," } else { "" };
-                        match parse_rust_string(token, ctx) {
+                        match parse_rust_string(token) {
                             Some(parsed) => {
                                 format_to!(
                                     result,
-                                    r#"{{"type":"Node","kind":"{kind:?}","start":{start},"end":{end}{inner_range_str},"children":[{parsed}]}}{comma}"#
+                                    r#"{{"type":"Node","kind":"{kind:?}","start":{start:?},"end":{end:?}{inner_range_str},"children":[{parsed}]}}{comma}"#
                                 );
                             }
                             None => format_to!(
                                 result,
-                                r#"{{"type":"Token","kind":"{kind:?}","start":{start},"end":{end}{inner_range_str}}}{comma}"#
+                                r#"{{"type":"Token","kind":"{kind:?}","start":{start:?},"end":{end:?}{inner_range_str}}}{comma}"#
                             ),
                         }
                     }
@@ -104,26 +99,7 @@ fn syntax_node_to_json(node: &SyntaxNode, ctx: &SyntaxTreeCtx) -> String {
     result
 }
 
-struct TextPosition {
-    offset: TextSize,
-    line: u32,
-    col: u32,
-}
-
-impl std::fmt::Display for TextPosition {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        write!(f, "[{:?},{},{}]", self.offset, self.line, self.col)
-    }
-}
-
-impl TextPosition {
-    pub(crate) fn new(line_index: &LineIndex, offset: TextSize) -> Self {
-        let LineCol { line, col } = line_index.line_col(offset);
-        Self { offset, line, col }
-    }
-}
-
-fn parse_rust_string(token: SyntaxToken, ctx: &SyntaxTreeCtx) -> Option<String> {
+fn parse_rust_string(token: SyntaxToken) -> Option<String> {
     let string_node = ast::String::cast(token)?;
     let text = string_node.value().ok()?;
 
@@ -152,20 +128,13 @@ fn parse_rust_string(token: SyntaxToken, ctx: &SyntaxTreeCtx) -> Option<String>
         return None;
     }
 
-    let ctx = SyntaxTreeCtx {
-        line_index: ctx.line_index.clone(),
-        in_string: Some(InStringCtx {
+    Some(syntax_node_to_json(
+        node,
+        Some(InStringCtx {
             offset: string_node.text_range_between_quotes()?.start().into(),
             marker_positions,
         }),
-    };
-
-    Some(syntax_node_to_json(node, &ctx))
-}
-
-struct SyntaxTreeCtx {
-    line_index: Arc<LineIndex>,
-    in_string: Option<InStringCtx>,
+    ))
 }
 
 struct InStringCtx {
@@ -191,7 +160,7 @@ mod tests {
         check(
             r#"fn foo() {}"#,
             expect![[
-                r#"{"type":"Node","kind":"SOURCE_FILE","start":[0,0,0],"end":[11,0,11],"children":[{"type":"Node","kind":"FN","start":[0,0,0],"end":[11,0,11],"children":[{"type":"Token","kind":"FN_KW","start":[0,0,0],"end":[2,0,2]},{"type":"Token","kind":"WHITESPACE","start":[2,0,2],"end":[3,0,3]},{"type":"Node","kind":"NAME","start":[3,0,3],"end":[6,0,6],"children":[{"type":"Token","kind":"IDENT","start":[3,0,3],"end":[6,0,6]}]},{"type":"Node","kind":"PARAM_LIST","start":[6,0,6],"end":[8,0,8],"children":[{"type":"Token","kind":"L_PAREN","start":[6,0,6],"end":[7,0,7]},{"type":"Token","kind":"R_PAREN","start":[7,0,7],"end":[8,0,8]}]},{"type":"Token","kind":"WHITESPACE","start":[8,0,8],"end":[9,0,9]},{"type":"Node","kind":"BLOCK_EXPR","start":[9,0,9],"end":[11,0,11],"children":[{"type":"Node","kind":"STMT_LIST","start":[9,0,9],"end":[11,0,11],"children":[{"type":"Token","kind":"L_CURLY","start":[9,0,9],"end":[10,0,10]},{"type":"Token","kind":"R_CURLY","start":[10,0,10],"end":[11,0,11]}]}]}]}]}"#
+                r#"{"type":"Node","kind":"SOURCE_FILE","start":0,"end":11,"children":[{"type":"Node","kind":"FN","start":0,"end":11,"children":[{"type":"Token","kind":"FN_KW","start":0,"end":2},{"type":"Token","kind":"WHITESPACE","start":2,"end":3},{"type":"Node","kind":"NAME","start":3,"end":6,"children":[{"type":"Token","kind":"IDENT","start":3,"end":6}]},{"type":"Node","kind":"PARAM_LIST","start":6,"end":8,"children":[{"type":"Token","kind":"L_PAREN","start":6,"end":7},{"type":"Token","kind":"R_PAREN","start":7,"end":8}]},{"type":"Token","kind":"WHITESPACE","start":8,"end":9},{"type":"Node","kind":"BLOCK_EXPR","start":9,"end":11,"children":[{"type":"Node","kind":"STMT_LIST","start":9,"end":11,"children":[{"type":"Token","kind":"L_CURLY","start":9,"end":10},{"type":"Token","kind":"R_CURLY","start":10,"end":11}]}]}]}]}"#
             ]],
         );
 
@@ -204,7 +173,7 @@ fn test() {
     ", "");
 }"#,
             expect![[
-                r#"{"type":"Node","kind":"SOURCE_FILE","start":[0,0,0],"end":[60,5,1],"children":[{"type":"Node","kind":"FN","start":[0,0,0],"end":[60,5,1],"children":[{"type":"Token","kind":"FN_KW","start":[0,0,0],"end":[2,0,2]},{"type":"Token","kind":"WHITESPACE","start":[2,0,2],"end":[3,0,3]},{"type":"Node","kind":"NAME","start":[3,0,3],"end":[7,0,7],"children":[{"type":"Token","kind":"IDENT","start":[3,0,3],"end":[7,0,7]}]},{"type":"Node","kind":"PARAM_LIST","start":[7,0,7],"end":[9,0,9],"children":[{"type":"Token","kind":"L_PAREN","start":[7,0,7],"end":[8,0,8]},{"type":"Token","kind":"R_PAREN","start":[8,0,8],"end":[9,0,9]}]},{"type":"Token","kind":"WHITESPACE","start":[9,0,9],"end":[10,0,10]},{"type":"Node","kind":"BLOCK_EXPR","start":[10,0,10],"end":[60,5,1],"children":[{"type":"Node","kind":"STMT_LIST","start":[10,0,10],"end":[60,5,1],"children":[{"type":"Token","kind":"L_CURLY","start":[10,0,10],"end":[11,0,11]},{"type":"Token","kind":"WHITESPACE","start":[11,0,11],"end":[16,1,4]},{"type":"Node","kind":"EXPR_STMT","start":[16,1,4],"end":[58,4,11],"children":[{"type":"Node","kind":"MACRO_EXPR","start":[16,1,4],"end":[57,4,10],"children":[{"type":"Node","kind":"MACRO_CALL","start":[16,1,4],"end":[57,4,10],"children":[{"type":"Node","kind":"PATH","start":[16,1,4],"end":[22,1,10],"children":[{"type":"Node","kind":"PATH_SEGMENT","start":[16,1,4],"end":[22,1,10],"children":[{"type":"Node","kind":"NAME_REF","start":[16,1,4],"end":[22,1,10],"children":[{"type":"Token","kind":"IDENT","start":[16,1,4],"end":[22,1,10]}]}]}]},{"type":"Token","kind":"BANG","start":[22,1,10],"end":[23,1,11]},{"type":"Node","kind":"TOKEN_TREE","start":[23,1,11],"end":[57,4,10],"children":[{"type":"Token","kind":"L_PAREN","start":[23,1,11],"end":[24,1,12]},{"type":"Node","kind":"STRING","start":[24,1,12],"end":[52,4,5],"children":[{"type":"Node","kind":"SOURCE_FILE","start":[25,1,13],"end":[25,1,13],"istart":[0,0,0],"iend":[26,2,0],"children":[{"type":"Token","kind":"WHITESPACE","start":[25,1,13],"end":[25,1,13],"istart":[0,0,0],"iend":[5,0,5]},{"type":"Node","kind":"FN","start":[30,2,4],"end":[30,2,4],"istart":[5,0,5],"iend":[21,1,9],"children":[{"type":"Token","kind":"FN_KW","start":[30,2,4],"end":[30,2,4],"istart":[5,0,5],"iend":[7,0,7]},{"type":"Token","kind":"WHITESPACE","start":[32,2,6],"end":[32,2,6],"istart":[7,0,7],"iend":[8,0,8]},{"type":"Node","kind":"NAME","start":[33,2,7],"end":[33,2,7],"istart":[8,0,8],"iend":[11,0,11],"children":[{"type":"Token","kind":"IDENT","start":[33,2,7],"end":[33,2,7],"istart":[8,0,8],"iend":[11,0,11]}]},{"type":"Node","kind":"PARAM_LIST","start":[36,2,10],"end":[36,2,10],"istart":[11,0,11],"iend":[13,1,1],"children":[{"type":"Token","kind":"L_PAREN","start":[36,2,10],"end":[36,2,10],"istart":[11,0,11],"iend":[12,1,0]},{"type":"Token","kind":"R_PAREN","start":[37,2,11],"end":[37,2,11],"istart":[12,1,0],"iend":[13,1,1]}]},{"type":"Token","kind":"WHITESPACE","start":[38,2,12],"end":[38,2,12],"istart":[13,1,1],"iend":[14,1,2]},{"type":"Node","kind":"BLOCK_EXPR","start":[39,2,13],"end":[39,2,13],"istart":[14,1,2],"iend":[21,1,9],"children":[{"type":"Node","kind":"STMT_LIST","start":[39,2,13],"end":[39,2,13],"istart":[14,1,2],"iend":[21,1,9],"children":[{"type":"Token","kind":"L_CURLY","start":[39,2,13],"end":[39,2,13],"istart":[14,1,2],"iend":[15,1,3]},{"type":"Token","kind":"WHITESPACE","start":[40,2,14],"end":[40,2,14],"istart":[15,1,3],"iend":[20,1,8]},{"type":"Token","kind":"R_CURLY","start":[45,3,4],"end":[45,3,4],"istart":[20,1,8],"iend":[21,1,9]}]}]}]},{"type":"Token","kind":"WHITESPACE","start":[46,3,5],"end":[46,3,5],"istart":[21,1,9],"iend":[26,2,0]}]}]},{"type":"Token","kind":"COMMA","start":[52,4,5],"end":[53,4,6]},{"type":"Token","kind":"WHITESPACE","start":[53,4,6],"end":[54,4,7]},{"type":"Token","kind":"STRING","start":[54,4,7],"end":[56,4,9]},{"type":"Token","kind":"R_PAREN","start":[56,4,9],"end":[57,4,10]}]}]}]},{"type":"Token","kind":"SEMICOLON","start":[57,4,10],"end":[58,4,11]}]},{"type":"Token","kind":"WHITESPACE","start":[58,4,11],"end":[59,5,0]},{"type":"Token","kind":"R_CURLY","start":[59,5,0],"end":[60,5,1]}]}]}]}]}"#
+                r#"{"type":"Node","kind":"SOURCE_FILE","start":0,"end":60,"children":[{"type":"Node","kind":"FN","start":0,"end":60,"children":[{"type":"Token","kind":"FN_KW","start":0,"end":2},{"type":"Token","kind":"WHITESPACE","start":2,"end":3},{"type":"Node","kind":"NAME","start":3,"end":7,"children":[{"type":"Token","kind":"IDENT","start":3,"end":7}]},{"type":"Node","kind":"PARAM_LIST","start":7,"end":9,"children":[{"type":"Token","kind":"L_PAREN","start":7,"end":8},{"type":"Token","kind":"R_PAREN","start":8,"end":9}]},{"type":"Token","kind":"WHITESPACE","start":9,"end":10},{"type":"Node","kind":"BLOCK_EXPR","start":10,"end":60,"children":[{"type":"Node","kind":"STMT_LIST","start":10,"end":60,"children":[{"type":"Token","kind":"L_CURLY","start":10,"end":11},{"type":"Token","kind":"WHITESPACE","start":11,"end":16},{"type":"Node","kind":"EXPR_STMT","start":16,"end":58,"children":[{"type":"Node","kind":"MACRO_EXPR","start":16,"end":57,"children":[{"type":"Node","kind":"MACRO_CALL","start":16,"end":57,"children":[{"type":"Node","kind":"PATH","start":16,"end":22,"children":[{"type":"Node","kind":"PATH_SEGMENT","start":16,"end":22,"children":[{"type":"Node","kind":"NAME_REF","start":16,"end":22,"children":[{"type":"Token","kind":"IDENT","start":16,"end":22}]}]}]},{"type":"Token","kind":"BANG","start":22,"end":23},{"type":"Node","kind":"TOKEN_TREE","start":23,"end":57,"children":[{"type":"Token","kind":"L_PAREN","start":23,"end":24},{"type":"Node","kind":"STRING","start":24,"end":52,"children":[{"type":"Node","kind":"SOURCE_FILE","start":25,"end":51,"istart":0,"iend":26,"children":[{"type":"Token","kind":"WHITESPACE","start":25,"end":30,"istart":0,"iend":5},{"type":"Node","kind":"FN","start":30,"end":46,"istart":5,"iend":21,"children":[{"type":"Token","kind":"FN_KW","start":30,"end":32,"istart":5,"iend":7},{"type":"Token","kind":"WHITESPACE","start":32,"end":33,"istart":7,"iend":8},{"type":"Node","kind":"NAME","start":33,"end":36,"istart":8,"iend":11,"children":[{"type":"Token","kind":"IDENT","start":33,"end":36,"istart":8,"iend":11}]},{"type":"Node","kind":"PARAM_LIST","start":36,"end":38,"istart":11,"iend":13,"children":[{"type":"Token","kind":"L_PAREN","start":36,"end":37,"istart":11,"iend":12},{"type":"Token","kind":"R_PAREN","start":37,"end":38,"istart":12,"iend":13}]},{"type":"Token","kind":"WHITESPACE","start":38,"end":39,"istart":13,"iend":14},{"type":"Node","kind":"BLOCK_EXPR","start":39,"end":46,"istart":14,"iend":21,"children":[{"type":"Node","kind":"STMT_LIST","start":39,"end":46,"istart":14,"iend":21,"children":[{"type":"Token","kind":"L_CURLY","start":39,"end":40,"istart":14,"iend":15},{"type":"Token","kind":"WHITESPACE","start":40,"end":45,"istart":15,"iend":20},{"type":"Token","kind":"R_CURLY","start":45,"end":46,"istart":20,"iend":21}]}]}]},{"type":"Token","kind":"WHITESPACE","start":46,"end":51,"istart":21,"iend":26}]}]},{"type":"Token","kind":"COMMA","start":52,"end":53},{"type":"Token","kind":"WHITESPACE","start":53,"end":54},{"type":"Token","kind":"STRING","start":54,"end":56},{"type":"Token","kind":"R_PAREN","start":56,"end":57}]}]}]},{"type":"Token","kind":"SEMICOLON","start":57,"end":58}]},{"type":"Token","kind":"WHITESPACE","start":58,"end":59},{"type":"Token","kind":"R_CURLY","start":59,"end":60}]}]}]}]}"#
             ]],
         )
     }
@@ -221,7 +190,7 @@ fn bar() {
     ", "");
 }"#,
             expect![[
-                r#"{"type":"Node","kind":"SOURCE_FILE","start":[0,0,0],"end":[65,7,1],"children":[{"type":"Node","kind":"FN","start":[0,0,0],"end":[65,7,1],"children":[{"type":"Token","kind":"FN_KW","start":[0,0,0],"end":[2,0,2]},{"type":"Token","kind":"WHITESPACE","start":[2,0,2],"end":[3,0,3]},{"type":"Node","kind":"NAME","start":[3,0,3],"end":[7,0,7],"children":[{"type":"Token","kind":"IDENT","start":[3,0,3],"end":[7,0,7]}]},{"type":"Node","kind":"PARAM_LIST","start":[7,0,7],"end":[9,0,9],"children":[{"type":"Token","kind":"L_PAREN","start":[7,0,7],"end":[8,0,8]},{"type":"Token","kind":"R_PAREN","start":[8,0,8],"end":[9,0,9]}]},{"type":"Token","kind":"WHITESPACE","start":[9,0,9],"end":[10,0,10]},{"type":"Node","kind":"BLOCK_EXPR","start":[10,0,10],"end":[65,7,1],"children":[{"type":"Node","kind":"STMT_LIST","start":[10,0,10],"end":[65,7,1],"children":[{"type":"Token","kind":"L_CURLY","start":[10,0,10],"end":[11,0,11]},{"type":"Token","kind":"WHITESPACE","start":[11,0,11],"end":[16,1,4]},{"type":"Node","kind":"EXPR_STMT","start":[16,1,4],"end":[63,6,11],"children":[{"type":"Node","kind":"MACRO_EXPR","start":[16,1,4],"end":[62,6,10],"children":[{"type":"Node","kind":"MACRO_CALL","start":[16,1,4],"end":[62,6,10],"children":[{"type":"Node","kind":"PATH","start":[16,1,4],"end":[22,1,10],"children":[{"type":"Node","kind":"PATH_SEGMENT","start":[16,1,4],"end":[22,1,10],"children":[{"type":"Node","kind":"NAME_REF","start":[16,1,4],"end":[22,1,10],"children":[{"type":"Token","kind":"IDENT","start":[16,1,4],"end":[22,1,10]}]}]}]},{"type":"Token","kind":"BANG","start":[22,1,10],"end":[23,1,11]},{"type":"Node","kind":"TOKEN_TREE","start":[23,1,11],"end":[62,6,10],"children":[{"type":"Token","kind":"L_PAREN","start":[23,1,11],"end":[24,1,12]},{"type":"Node","kind":"STRING","start":[24,1,12],"end":[57,6,5],"children":[{"type":"Node","kind":"SOURCE_FILE","start":[25,1,13],"end":[25,1,13],"istart":[0,0,0],"iend":[31,2,5],"children":[{"type":"Token","kind":"WHITESPACE","start":[25,1,13],"end":[25,1,13],"istart":[0,0,0],"iend":[1,0,1]},{"type":"Node","kind":"FN","start":[26,2,0],"end":[26,2,0],"istart":[1,0,1],"iend":[13,1,1],"children":[{"type":"Token","kind":"FN_KW","start":[26,2,0],"end":[26,2,0],"istart":[1,0,1],"iend":[3,0,3]},{"type":"Token","kind":"WHITESPACE","start":[28,2,2],"end":[28,2,2],"istart":[3,0,3],"iend":[4,0,4]},{"type":"Node","kind":"NAME","start":[29,2,3],"end":[29,2,3],"istart":[4,0,4],"iend":[7,0,7],"children":[{"type":"Token","kind":"IDENT","start":[29,2,3],"end":[29,2,3],"istart":[4,0,4],"iend":[7,0,7]}]},{"type":"Node","kind":"PARAM_LIST","start":[32,2,6],"end":[32,2,6],"istart":[7,0,7],"iend":[9,0,9],"children":[{"type":"Token","kind":"L_PAREN","start":[32,2,6],"end":[32,2,6],"istart":[7,0,7],"iend":[8,0,8]},{"type":"Token","kind":"R_PAREN","start":[33,2,7],"end":[33,2,7],"istart":[8,0,8],"iend":[9,0,9]}]},{"type":"Token","kind":"WHITESPACE","start":[34,2,8],"end":[34,2,8],"istart":[9,0,9],"iend":[10,0,10]},{"type":"Node","kind":"BLOCK_EXPR","start":[35,2,9],"end":[35,2,9],"istart":[10,0,10],"iend":[13,1,1],"children":[{"type":"Node","kind":"STMT_LIST","start":[35,2,9],"end":[35,2,9],"istart":[10,0,10],"iend":[13,1,1],"children":[{"type":"Token","kind":"L_CURLY","start":[35,2,9],"end":[35,2,9],"istart":[10,0,10],"iend":[11,0,11]},{"type":"Token","kind":"WHITESPACE","start":[36,2,10],"end":[36,2,10],"istart":[11,0,11],"iend":[12,1,0]},{"type":"Token","kind":"R_CURLY","start":[37,3,0],"end":[37,3,0],"istart":[12,1,0],"iend":[13,1,1]}]}]}]},{"type":"Token","kind":"WHITESPACE","start":[38,3,1],"end":[38,3,1],"istart":[13,1,1],"iend":[14,1,2]},{"type":"Node","kind":"FN","start":[39,4,0],"end":[39,4,0],"istart":[14,1,2],"iend":[26,2,0],"children":[{"type":"Token","kind":"FN_KW","start":[39,4,0],"end":[39,4,0],"istart":[14,1,2],"iend":[16,1,4]},{"type":"Token","kind":"WHITESPACE","start":[41,4,2],"end":[41,4,2],"istart":[16,1,4],"iend":[17,1,5]},{"type":"Node","kind":"NAME","start":[42,4,3],"end":[42,4,3],"istart":[17,1,5],"iend":[20,1,8],"children":[{"type":"Token","kind":"IDENT","start":[42,4,3],"end":[42,4,3],"istart":[17,1,5],"iend":[20,1,8]}]},{"type":"Node","kind":"PARAM_LIST","start":[45,4,6],"end":[45,4,6],"istart":[20,1,8],"iend":[22,1,10],"children":[{"type":"Token","kind":"L_PAREN","start":[45,4,6],"end":[45,4,6],"istart":[20,1,8],"iend":[21,1,9]},{"type":"Token","kind":"R_PAREN","start":[46,4,7],"end":[46,4,7],"istart":[21,1,9],"iend":[22,1,10]}]},{"type":"Token","kind":"WHITESPACE","start":[47,4,8],"end":[47,4,8],"istart":[22,1,10],"iend":[23,1,11]},{"type":"Node","kind":"BLOCK_EXPR","start":[48,4,9],"end":[48,4,9],"istart":[23,1,11],"iend":[26,2,0],"children":[{"type":"Node","kind":"STMT_LIST","start":[48,4,9],"end":[48,4,9],"istart":[23,1,11],"iend":[26,2,0],"children":[{"type":"Token","kind":"L_CURLY","start":[48,4,9],"end":[48,4,9],"istart":[23,1,11],"iend":[24,1,12]},{"type":"Token","kind":"WHITESPACE","start":[49,4,10],"end":[49,4,10],"istart":[24,1,12],"iend":[25,1,13]},{"type":"Token","kind":"R_CURLY","start":[50,5,0],"end":[50,5,0],"istart":[25,1,13],"iend":[26,2,0]}]}]}]},{"type":"Token","kind":"WHITESPACE","start":[51,5,1],"end":[51,5,1],"istart":[26,2,0],"iend":[31,2,5]}]}]},{"type":"Token","kind":"COMMA","start":[57,6,5],"end":[58,6,6]},{"type":"Token","kind":"WHITESPACE","start":[58,6,6],"end":[59,6,7]},{"type":"Token","kind":"STRING","start":[59,6,7],"end":[61,6,9]},{"type":"Token","kind":"R_PAREN","start":[61,6,9],"end":[62,6,10]}]}]}]},{"type":"Token","kind":"SEMICOLON","start":[62,6,10],"end":[63,6,11]}]},{"type":"Token","kind":"WHITESPACE","start":[63,6,11],"end":[64,7,0]},{"type":"Token","kind":"R_CURLY","start":[64,7,0],"end":[65,7,1]}]}]}]}]}"#
+                r#"{"type":"Node","kind":"SOURCE_FILE","start":0,"end":65,"children":[{"type":"Node","kind":"FN","start":0,"end":65,"children":[{"type":"Token","kind":"FN_KW","start":0,"end":2},{"type":"Token","kind":"WHITESPACE","start":2,"end":3},{"type":"Node","kind":"NAME","start":3,"end":7,"children":[{"type":"Token","kind":"IDENT","start":3,"end":7}]},{"type":"Node","kind":"PARAM_LIST","start":7,"end":9,"children":[{"type":"Token","kind":"L_PAREN","start":7,"end":8},{"type":"Token","kind":"R_PAREN","start":8,"end":9}]},{"type":"Token","kind":"WHITESPACE","start":9,"end":10},{"type":"Node","kind":"BLOCK_EXPR","start":10,"end":65,"children":[{"type":"Node","kind":"STMT_LIST","start":10,"end":65,"children":[{"type":"Token","kind":"L_CURLY","start":10,"end":11},{"type":"Token","kind":"WHITESPACE","start":11,"end":16},{"type":"Node","kind":"EXPR_STMT","start":16,"end":63,"children":[{"type":"Node","kind":"MACRO_EXPR","start":16,"end":62,"children":[{"type":"Node","kind":"MACRO_CALL","start":16,"end":62,"children":[{"type":"Node","kind":"PATH","start":16,"end":22,"children":[{"type":"Node","kind":"PATH_SEGMENT","start":16,"end":22,"children":[{"type":"Node","kind":"NAME_REF","start":16,"end":22,"children":[{"type":"Token","kind":"IDENT","start":16,"end":22}]}]}]},{"type":"Token","kind":"BANG","start":22,"end":23},{"type":"Node","kind":"TOKEN_TREE","start":23,"end":62,"children":[{"type":"Token","kind":"L_PAREN","start":23,"end":24},{"type":"Node","kind":"STRING","start":24,"end":57,"children":[{"type":"Node","kind":"SOURCE_FILE","start":25,"end":56,"istart":0,"iend":31,"children":[{"type":"Token","kind":"WHITESPACE","start":25,"end":26,"istart":0,"iend":1},{"type":"Node","kind":"FN","start":26,"end":38,"istart":1,"iend":13,"children":[{"type":"Token","kind":"FN_KW","start":26,"end":28,"istart":1,"iend":3},{"type":"Token","kind":"WHITESPACE","start":28,"end":29,"istart":3,"iend":4},{"type":"Node","kind":"NAME","start":29,"end":32,"istart":4,"iend":7,"children":[{"type":"Token","kind":"IDENT","start":29,"end":32,"istart":4,"iend":7}]},{"type":"Node","kind":"PARAM_LIST","start":32,"end":34,"istart":7,"iend":9,"children":[{"type":"Token","kind":"L_PAREN","start":32,"end":33,"istart":7,"iend":8},{"type":"Token","kind":"R_PAREN","start":33,"end":34,"istart":8,"iend":9}]},{"type":"Token","kind":"WHITESPACE","start":34,"end":35,"istart":9,"iend":10},{"type":"Node","kind":"BLOCK_EXPR","start":35,"end":38,"istart":10,"iend":13,"children":[{"type":"Node","kind":"STMT_LIST","start":35,"end":38,"istart":10,"iend":13,"children":[{"type":"Token","kind":"L_CURLY","start":35,"end":36,"istart":10,"iend":11},{"type":"Token","kind":"WHITESPACE","start":36,"end":37,"istart":11,"iend":12},{"type":"Token","kind":"R_CURLY","start":37,"end":38,"istart":12,"iend":13}]}]}]},{"type":"Token","kind":"WHITESPACE","start":38,"end":39,"istart":13,"iend":14},{"type":"Node","kind":"FN","start":39,"end":51,"istart":14,"iend":26,"children":[{"type":"Token","kind":"FN_KW","start":39,"end":41,"istart":14,"iend":16},{"type":"Token","kind":"WHITESPACE","start":41,"end":42,"istart":16,"iend":17},{"type":"Node","kind":"NAME","start":42,"end":45,"istart":17,"iend":20,"children":[{"type":"Token","kind":"IDENT","start":42,"end":45,"istart":17,"iend":20}]},{"type":"Node","kind":"PARAM_LIST","start":45,"end":47,"istart":20,"iend":22,"children":[{"type":"Token","kind":"L_PAREN","start":45,"end":46,"istart":20,"iend":21},{"type":"Token","kind":"R_PAREN","start":46,"end":47,"istart":21,"iend":22}]},{"type":"Token","kind":"WHITESPACE","start":47,"end":48,"istart":22,"iend":23},{"type":"Node","kind":"BLOCK_EXPR","start":48,"end":51,"istart":23,"iend":26,"children":[{"type":"Node","kind":"STMT_LIST","start":48,"end":51,"istart":23,"iend":26,"children":[{"type":"Token","kind":"L_CURLY","start":48,"end":49,"istart":23,"iend":24},{"type":"Token","kind":"WHITESPACE","start":49,"end":50,"istart":24,"iend":25},{"type":"Token","kind":"R_CURLY","start":50,"end":51,"istart":25,"iend":26}]}]}]},{"type":"Token","kind":"WHITESPACE","start":51,"end":56,"istart":26,"iend":31}]}]},{"type":"Token","kind":"COMMA","start":57,"end":58},{"type":"Token","kind":"WHITESPACE","start":58,"end":59},{"type":"Token","kind":"STRING","start":59,"end":61},{"type":"Token","kind":"R_PAREN","start":61,"end":62}]}]}]},{"type":"Token","kind":"SEMICOLON","start":62,"end":63}]},{"type":"Token","kind":"WHITESPACE","start":63,"end":64},{"type":"Token","kind":"R_CURLY","start":64,"end":65}]}]}]}]}"#
             ]],
         );
 
@@ -236,7 +205,7 @@ fn bar() {
     "#, "");
 }"###,
             expect![[
-                r#"{"type":"Node","kind":"SOURCE_FILE","start":[0,0,0],"end":[68,7,1],"children":[{"type":"Node","kind":"FN","start":[0,0,0],"end":[68,7,1],"children":[{"type":"Token","kind":"FN_KW","start":[0,0,0],"end":[2,0,2]},{"type":"Token","kind":"WHITESPACE","start":[2,0,2],"end":[3,0,3]},{"type":"Node","kind":"NAME","start":[3,0,3],"end":[7,0,7],"children":[{"type":"Token","kind":"IDENT","start":[3,0,3],"end":[7,0,7]}]},{"type":"Node","kind":"PARAM_LIST","start":[7,0,7],"end":[9,0,9],"children":[{"type":"Token","kind":"L_PAREN","start":[7,0,7],"end":[8,0,8]},{"type":"Token","kind":"R_PAREN","start":[8,0,8],"end":[9,0,9]}]},{"type":"Token","kind":"WHITESPACE","start":[9,0,9],"end":[10,0,10]},{"type":"Node","kind":"BLOCK_EXPR","start":[10,0,10],"end":[68,7,1],"children":[{"type":"Node","kind":"STMT_LIST","start":[10,0,10],"end":[68,7,1],"children":[{"type":"Token","kind":"L_CURLY","start":[10,0,10],"end":[11,0,11]},{"type":"Token","kind":"WHITESPACE","start":[11,0,11],"end":[16,1,4]},{"type":"Node","kind":"EXPR_STMT","start":[16,1,4],"end":[66,6,12],"children":[{"type":"Node","kind":"MACRO_EXPR","start":[16,1,4],"end":[65,6,11],"children":[{"type":"Node","kind":"MACRO_CALL","start":[16,1,4],"end":[65,6,11],"children":[{"type":"Node","kind":"PATH","start":[16,1,4],"end":[22,1,10],"children":[{"type":"Node","kind":"PATH_SEGMENT","start":[16,1,4],"end":[22,1,10],"children":[{"type":"Node","kind":"NAME_REF","start":[16,1,4],"end":[22,1,10],"children":[{"type":"Token","kind":"IDENT","start":[16,1,4],"end":[22,1,10]}]}]}]},{"type":"Token","kind":"BANG","start":[22,1,10],"end":[23,1,11]},{"type":"Node","kind":"TOKEN_TREE","start":[23,1,11],"end":[65,6,11],"children":[{"type":"Token","kind":"L_PAREN","start":[23,1,11],"end":[24,1,12]},{"type":"Node","kind":"STRING","start":[24,1,12],"end":[60,6,6],"children":[{"type":"Node","kind":"SOURCE_FILE","start":[27,1,15],"end":[27,1,15],"istart":[0,0,0],"iend":[31,2,3],"children":[{"type":"Token","kind":"WHITESPACE","start":[27,1,15],"end":[27,1,15],"istart":[0,0,0],"iend":[1,0,1]},{"type":"Node","kind":"FN","start":[28,2,0],"end":[28,2,0],"istart":[1,0,1],"iend":[13,1,1],"children":[{"type":"Token","kind":"FN_KW","start":[28,2,0],"end":[28,2,0],"istart":[1,0,1],"iend":[3,0,3]},{"type":"Token","kind":"WHITESPACE","start":[30,2,2],"end":[30,2,2],"istart":[3,0,3],"iend":[4,0,4]},{"type":"Node","kind":"NAME","start":[31,2,3],"end":[31,2,3],"istart":[4,0,4],"iend":[7,0,7],"children":[{"type":"Token","kind":"IDENT","start":[31,2,3],"end":[31,2,3],"istart":[4,0,4],"iend":[7,0,7]}]},{"type":"Node","kind":"PARAM_LIST","start":[34,2,6],"end":[34,2,6],"istart":[7,0,7],"iend":[9,0,9],"children":[{"type":"Token","kind":"L_PAREN","start":[34,2,6],"end":[34,2,6],"istart":[7,0,7],"iend":[8,0,8]},{"type":"Token","kind":"R_PAREN","start":[35,2,7],"end":[35,2,7],"istart":[8,0,8],"iend":[9,0,9]}]},{"type":"Token","kind":"WHITESPACE","start":[36,2,8],"end":[36,2,8],"istart":[9,0,9],"iend":[10,0,10]},{"type":"Node","kind":"BLOCK_EXPR","start":[37,2,9],"end":[37,2,9],"istart":[10,0,10],"iend":[13,1,1],"children":[{"type":"Node","kind":"STMT_LIST","start":[37,2,9],"end":[37,2,9],"istart":[10,0,10],"iend":[13,1,1],"children":[{"type":"Token","kind":"L_CURLY","start":[37,2,9],"end":[37,2,9],"istart":[10,0,10],"iend":[11,0,11]},{"type":"Token","kind":"WHITESPACE","start":[38,2,10],"end":[38,2,10],"istart":[11,0,11],"iend":[12,1,0]},{"type":"Token","kind":"R_CURLY","start":[39,3,0],"end":[39,3,0],"istart":[12,1,0],"iend":[13,1,1]}]}]}]},{"type":"Token","kind":"WHITESPACE","start":[40,3,1],"end":[40,3,1],"istart":[13,1,1],"iend":[14,1,2]},{"type":"Node","kind":"FN","start":[41,4,0],"end":[41,4,0],"istart":[14,1,2],"iend":[26,1,14],"children":[{"type":"Token","kind":"FN_KW","start":[41,4,0],"end":[41,4,0],"istart":[14,1,2],"iend":[16,1,4]},{"type":"Token","kind":"WHITESPACE","start":[43,4,2],"end":[43,4,2],"istart":[16,1,4],"iend":[17,1,5]},{"type":"Node","kind":"NAME","start":[44,4,3],"end":[44,4,3],"istart":[17,1,5],"iend":[20,1,8],"children":[{"type":"Token","kind":"IDENT","start":[44,4,3],"end":[44,4,3],"istart":[17,1,5],"iend":[20,1,8]}]},{"type":"Node","kind":"PARAM_LIST","start":[47,4,6],"end":[47,4,6],"istart":[20,1,8],"iend":[22,1,10],"children":[{"type":"Token","kind":"L_PAREN","start":[47,4,6],"end":[47,4,6],"istart":[20,1,8],"iend":[21,1,9]},{"type":"Token","kind":"R_PAREN","start":[48,4,7],"end":[48,4,7],"istart":[21,1,9],"iend":[22,1,10]}]},{"type":"Token","kind":"WHITESPACE","start":[49,4,8],"end":[49,4,8],"istart":[22,1,10],"iend":[23,1,11]},{"type":"Node","kind":"BLOCK_EXPR","start":[50,4,9],"end":[50,4,9],"istart":[23,1,11],"iend":[26,1,14],"children":[{"type":"Node","kind":"STMT_LIST","start":[50,4,9],"end":[50,4,9],"istart":[23,1,11],"iend":[26,1,14],"children":[{"type":"Token","kind":"L_CURLY","start":[50,4,9],"end":[50,4,9],"istart":[23,1,11],"iend":[24,1,12]},{"type":"Token","kind":"WHITESPACE","start":[51,4,10],"end":[51,4,10],"istart":[24,1,12],"iend":[25,1,13]},{"type":"Token","kind":"R_CURLY","start":[52,5,0],"end":[52,5,0],"istart":[25,1,13],"iend":[26,1,14]}]}]}]},{"type":"Token","kind":"WHITESPACE","start":[53,5,1],"end":[53,5,1],"istart":[26,1,14],"iend":[31,2,3]}]}]},{"type":"Token","kind":"COMMA","start":[60,6,6],"end":[61,6,7]},{"type":"Token","kind":"WHITESPACE","start":[61,6,7],"end":[62,6,8]},{"type":"Token","kind":"STRING","start":[62,6,8],"end":[64,6,10]},{"type":"Token","kind":"R_PAREN","start":[64,6,10],"end":[65,6,11]}]}]}]},{"type":"Token","kind":"SEMICOLON","start":[65,6,11],"end":[66,6,12]}]},{"type":"Token","kind":"WHITESPACE","start":[66,6,12],"end":[67,7,0]},{"type":"Token","kind":"R_CURLY","start":[67,7,0],"end":[68,7,1]}]}]}]}]}"#
+                r#"{"type":"Node","kind":"SOURCE_FILE","start":0,"end":68,"children":[{"type":"Node","kind":"FN","start":0,"end":68,"children":[{"type":"Token","kind":"FN_KW","start":0,"end":2},{"type":"Token","kind":"WHITESPACE","start":2,"end":3},{"type":"Node","kind":"NAME","start":3,"end":7,"children":[{"type":"Token","kind":"IDENT","start":3,"end":7}]},{"type":"Node","kind":"PARAM_LIST","start":7,"end":9,"children":[{"type":"Token","kind":"L_PAREN","start":7,"end":8},{"type":"Token","kind":"R_PAREN","start":8,"end":9}]},{"type":"Token","kind":"WHITESPACE","start":9,"end":10},{"type":"Node","kind":"BLOCK_EXPR","start":10,"end":68,"children":[{"type":"Node","kind":"STMT_LIST","start":10,"end":68,"children":[{"type":"Token","kind":"L_CURLY","start":10,"end":11},{"type":"Token","kind":"WHITESPACE","start":11,"end":16},{"type":"Node","kind":"EXPR_STMT","start":16,"end":66,"children":[{"type":"Node","kind":"MACRO_EXPR","start":16,"end":65,"children":[{"type":"Node","kind":"MACRO_CALL","start":16,"end":65,"children":[{"type":"Node","kind":"PATH","start":16,"end":22,"children":[{"type":"Node","kind":"PATH_SEGMENT","start":16,"end":22,"children":[{"type":"Node","kind":"NAME_REF","start":16,"end":22,"children":[{"type":"Token","kind":"IDENT","start":16,"end":22}]}]}]},{"type":"Token","kind":"BANG","start":22,"end":23},{"type":"Node","kind":"TOKEN_TREE","start":23,"end":65,"children":[{"type":"Token","kind":"L_PAREN","start":23,"end":24},{"type":"Node","kind":"STRING","start":24,"end":60,"children":[{"type":"Node","kind":"SOURCE_FILE","start":27,"end":58,"istart":0,"iend":31,"children":[{"type":"Token","kind":"WHITESPACE","start":27,"end":28,"istart":0,"iend":1},{"type":"Node","kind":"FN","start":28,"end":40,"istart":1,"iend":13,"children":[{"type":"Token","kind":"FN_KW","start":28,"end":30,"istart":1,"iend":3},{"type":"Token","kind":"WHITESPACE","start":30,"end":31,"istart":3,"iend":4},{"type":"Node","kind":"NAME","start":31,"end":34,"istart":4,"iend":7,"children":[{"type":"Token","kind":"IDENT","start":31,"end":34,"istart":4,"iend":7}]},{"type":"Node","kind":"PARAM_LIST","start":34,"end":36,"istart":7,"iend":9,"children":[{"type":"Token","kind":"L_PAREN","start":34,"end":35,"istart":7,"iend":8},{"type":"Token","kind":"R_PAREN","start":35,"end":36,"istart":8,"iend":9}]},{"type":"Token","kind":"WHITESPACE","start":36,"end":37,"istart":9,"iend":10},{"type":"Node","kind":"BLOCK_EXPR","start":37,"end":40,"istart":10,"iend":13,"children":[{"type":"Node","kind":"STMT_LIST","start":37,"end":40,"istart":10,"iend":13,"children":[{"type":"Token","kind":"L_CURLY","start":37,"end":38,"istart":10,"iend":11},{"type":"Token","kind":"WHITESPACE","start":38,"end":39,"istart":11,"iend":12},{"type":"Token","kind":"R_CURLY","start":39,"end":40,"istart":12,"iend":13}]}]}]},{"type":"Token","kind":"WHITESPACE","start":40,"end":41,"istart":13,"iend":14},{"type":"Node","kind":"FN","start":41,"end":53,"istart":14,"iend":26,"children":[{"type":"Token","kind":"FN_KW","start":41,"end":43,"istart":14,"iend":16},{"type":"Token","kind":"WHITESPACE","start":43,"end":44,"istart":16,"iend":17},{"type":"Node","kind":"NAME","start":44,"end":47,"istart":17,"iend":20,"children":[{"type":"Token","kind":"IDENT","start":44,"end":47,"istart":17,"iend":20}]},{"type":"Node","kind":"PARAM_LIST","start":47,"end":49,"istart":20,"iend":22,"children":[{"type":"Token","kind":"L_PAREN","start":47,"end":48,"istart":20,"iend":21},{"type":"Token","kind":"R_PAREN","start":48,"end":49,"istart":21,"iend":22}]},{"type":"Token","kind":"WHITESPACE","start":49,"end":50,"istart":22,"iend":23},{"type":"Node","kind":"BLOCK_EXPR","start":50,"end":53,"istart":23,"iend":26,"children":[{"type":"Node","kind":"STMT_LIST","start":50,"end":53,"istart":23,"iend":26,"children":[{"type":"Token","kind":"L_CURLY","start":50,"end":51,"istart":23,"iend":24},{"type":"Token","kind":"WHITESPACE","start":51,"end":52,"istart":24,"iend":25},{"type":"Token","kind":"R_CURLY","start":52,"end":53,"istart":25,"iend":26}]}]}]},{"type":"Token","kind":"WHITESPACE","start":53,"end":58,"istart":26,"iend":31}]}]},{"type":"Token","kind":"COMMA","start":60,"end":61},{"type":"Token","kind":"WHITESPACE","start":61,"end":62},{"type":"Token","kind":"STRING","start":62,"end":64},{"type":"Token","kind":"R_PAREN","start":64,"end":65}]}]}]},{"type":"Token","kind":"SEMICOLON","start":65,"end":66}]},{"type":"Token","kind":"WHITESPACE","start":66,"end":67},{"type":"Token","kind":"R_CURLY","start":67,"end":68}]}]}]}]}"#
             ]],
         );
 
@@ -250,7 +219,7 @@ fn bar() {
 }"$0#, "");
 }"###,
             expect![[
-                r#"{"type":"Node","kind":"SOURCE_FILE","start":[0,0,0],"end":[63,6,1],"children":[{"type":"Node","kind":"FN","start":[0,0,0],"end":[63,6,1],"children":[{"type":"Token","kind":"FN_KW","start":[0,0,0],"end":[2,0,2]},{"type":"Token","kind":"WHITESPACE","start":[2,0,2],"end":[3,0,3]},{"type":"Node","kind":"NAME","start":[3,0,3],"end":[7,0,7],"children":[{"type":"Token","kind":"IDENT","start":[3,0,3],"end":[7,0,7]}]},{"type":"Node","kind":"PARAM_LIST","start":[7,0,7],"end":[9,0,9],"children":[{"type":"Token","kind":"L_PAREN","start":[7,0,7],"end":[8,0,8]},{"type":"Token","kind":"R_PAREN","start":[8,0,8],"end":[9,0,9]}]},{"type":"Token","kind":"WHITESPACE","start":[9,0,9],"end":[10,0,10]},{"type":"Node","kind":"BLOCK_EXPR","start":[10,0,10],"end":[63,6,1],"children":[{"type":"Node","kind":"STMT_LIST","start":[10,0,10],"end":[63,6,1],"children":[{"type":"Token","kind":"L_CURLY","start":[10,0,10],"end":[11,0,11]},{"type":"Token","kind":"WHITESPACE","start":[11,0,11],"end":[16,1,4]},{"type":"Node","kind":"EXPR_STMT","start":[16,1,4],"end":[61,5,9],"children":[{"type":"Node","kind":"MACRO_EXPR","start":[16,1,4],"end":[60,5,8],"children":[{"type":"Node","kind":"MACRO_CALL","start":[16,1,4],"end":[60,5,8],"children":[{"type":"Node","kind":"PATH","start":[16,1,4],"end":[22,1,10],"children":[{"type":"Node","kind":"PATH_SEGMENT","start":[16,1,4],"end":[22,1,10],"children":[{"type":"Node","kind":"NAME_REF","start":[16,1,4],"end":[22,1,10],"children":[{"type":"Token","kind":"IDENT","start":[16,1,4],"end":[22,1,10]}]}]}]},{"type":"Token","kind":"BANG","start":[22,1,10],"end":[23,1,11]},{"type":"Node","kind":"TOKEN_TREE","start":[23,1,11],"end":[60,5,8],"children":[{"type":"Token","kind":"L_PAREN","start":[23,1,11],"end":[24,1,12]},{"type":"Node","kind":"STRING","start":[24,1,12],"end":[55,5,3],"children":[{"type":"Node","kind":"SOURCE_FILE","start":[27,1,15],"end":[27,1,15],"istart":[0,0,0],"iend":[26,1,14],"children":[{"type":"Token","kind":"WHITESPACE","start":[27,1,15],"end":[27,1,15],"istart":[0,0,0],"iend":[1,0,1]},{"type":"Node","kind":"FN","start":[28,2,0],"end":[28,2,0],"istart":[1,0,1],"iend":[13,1,1],"children":[{"type":"Token","kind":"FN_KW","start":[28,2,0],"end":[28,2,0],"istart":[1,0,1],"iend":[3,0,3]},{"type":"Token","kind":"WHITESPACE","start":[30,2,2],"end":[30,2,2],"istart":[3,0,3],"iend":[4,0,4]},{"type":"Node","kind":"NAME","start":[31,2,3],"end":[31,2,3],"istart":[4,0,4],"iend":[7,0,7],"children":[{"type":"Token","kind":"IDENT","start":[31,2,3],"end":[31,2,3],"istart":[4,0,4],"iend":[7,0,7]}]},{"type":"Node","kind":"PARAM_LIST","start":[34,2,6],"end":[34,2,6],"istart":[7,0,7],"iend":[9,0,9],"children":[{"type":"Token","kind":"L_PAREN","start":[34,2,6],"end":[34,2,6],"istart":[7,0,7],"iend":[8,0,8]},{"type":"Token","kind":"R_PAREN","start":[35,2,7],"end":[35,2,7],"istart":[8,0,8],"iend":[9,0,9]}]},{"type":"Token","kind":"WHITESPACE","start":[36,2,8],"end":[36,2,8],"istart":[9,0,9],"iend":[10,0,10]},{"type":"Node","kind":"BLOCK_EXPR","start":[37,2,9],"end":[37,2,9],"istart":[10,0,10],"iend":[13,1,1],"children":[{"type":"Node","kind":"STMT_LIST","start":[37,2,9],"end":[37,2,9],"istart":[10,0,10],"iend":[13,1,1],"children":[{"type":"Token","kind":"L_CURLY","start":[37,2,9],"end":[37,2,9],"istart":[10,0,10],"iend":[11,0,11]},{"type":"Token","kind":"WHITESPACE","start":[38,2,10],"end":[38,2,10],"istart":[11,0,11],"iend":[12,1,0]},{"type":"Token","kind":"R_CURLY","start":[39,3,0],"end":[39,3,0],"istart":[12,1,0],"iend":[13,1,1]}]}]}]},{"type":"Token","kind":"WHITESPACE","start":[40,3,1],"end":[40,3,1],"istart":[13,1,1],"iend":[14,1,2]},{"type":"Node","kind":"FN","start":[41,4,0],"end":[41,4,0],"istart":[14,1,2],"iend":[26,1,14],"children":[{"type":"Token","kind":"FN_KW","start":[41,4,0],"end":[41,4,0],"istart":[14,1,2],"iend":[16,1,4]},{"type":"Token","kind":"WHITESPACE","start":[43,4,2],"end":[43,4,2],"istart":[16,1,4],"iend":[17,1,5]},{"type":"Node","kind":"NAME","start":[44,4,3],"end":[44,4,3],"istart":[17,1,5],"iend":[20,1,8],"children":[{"type":"Token","kind":"IDENT","start":[44,4,3],"end":[44,4,3],"istart":[17,1,5],"iend":[20,1,8]}]},{"type":"Node","kind":"PARAM_LIST","start":[47,4,6],"end":[47,4,6],"istart":[20,1,8],"iend":[22,1,10],"children":[{"type":"Token","kind":"L_PAREN","start":[47,4,6],"end":[47,4,6],"istart":[20,1,8],"iend":[21,1,9]},{"type":"Token","kind":"R_PAREN","start":[48,4,7],"end":[48,4,7],"istart":[21,1,9],"iend":[22,1,10]}]},{"type":"Token","kind":"WHITESPACE","start":[49,4,8],"end":[49,4,8],"istart":[22,1,10],"iend":[23,1,11]},{"type":"Node","kind":"BLOCK_EXPR","start":[50,4,9],"end":[50,4,9],"istart":[23,1,11],"iend":[26,1,14],"children":[{"type":"Node","kind":"STMT_LIST","start":[50,4,9],"end":[50,4,9],"istart":[23,1,11],"iend":[26,1,14],"children":[{"type":"Token","kind":"L_CURLY","start":[50,4,9],"end":[50,4,9],"istart":[23,1,11],"iend":[24,1,12]},{"type":"Token","kind":"WHITESPACE","start":[51,4,10],"end":[51,4,10],"istart":[24,1,12],"iend":[25,1,13]},{"type":"Token","kind":"R_CURLY","start":[52,5,0],"end":[52,5,0],"istart":[25,1,13],"iend":[26,1,14]}]}]}]}]}]},{"type":"Token","kind":"COMMA","start":[55,5,3],"end":[56,5,4]},{"type":"Token","kind":"WHITESPACE","start":[56,5,4],"end":[57,5,5]},{"type":"Token","kind":"STRING","start":[57,5,5],"end":[59,5,7]},{"type":"Token","kind":"R_PAREN","start":[59,5,7],"end":[60,5,8]}]}]}]},{"type":"Token","kind":"SEMICOLON","start":[60,5,8],"end":[61,5,9]}]},{"type":"Token","kind":"WHITESPACE","start":[61,5,9],"end":[62,6,0]},{"type":"Token","kind":"R_CURLY","start":[62,6,0],"end":[63,6,1]}]}]}]}]}"#
+                r#"{"type":"Node","kind":"SOURCE_FILE","start":0,"end":63,"children":[{"type":"Node","kind":"FN","start":0,"end":63,"children":[{"type":"Token","kind":"FN_KW","start":0,"end":2},{"type":"Token","kind":"WHITESPACE","start":2,"end":3},{"type":"Node","kind":"NAME","start":3,"end":7,"children":[{"type":"Token","kind":"IDENT","start":3,"end":7}]},{"type":"Node","kind":"PARAM_LIST","start":7,"end":9,"children":[{"type":"Token","kind":"L_PAREN","start":7,"end":8},{"type":"Token","kind":"R_PAREN","start":8,"end":9}]},{"type":"Token","kind":"WHITESPACE","start":9,"end":10},{"type":"Node","kind":"BLOCK_EXPR","start":10,"end":63,"children":[{"type":"Node","kind":"STMT_LIST","start":10,"end":63,"children":[{"type":"Token","kind":"L_CURLY","start":10,"end":11},{"type":"Token","kind":"WHITESPACE","start":11,"end":16},{"type":"Node","kind":"EXPR_STMT","start":16,"end":61,"children":[{"type":"Node","kind":"MACRO_EXPR","start":16,"end":60,"children":[{"type":"Node","kind":"MACRO_CALL","start":16,"end":60,"children":[{"type":"Node","kind":"PATH","start":16,"end":22,"children":[{"type":"Node","kind":"PATH_SEGMENT","start":16,"end":22,"children":[{"type":"Node","kind":"NAME_REF","start":16,"end":22,"children":[{"type":"Token","kind":"IDENT","start":16,"end":22}]}]}]},{"type":"Token","kind":"BANG","start":22,"end":23},{"type":"Node","kind":"TOKEN_TREE","start":23,"end":60,"children":[{"type":"Token","kind":"L_PAREN","start":23,"end":24},{"type":"Node","kind":"STRING","start":24,"end":55,"children":[{"type":"Node","kind":"SOURCE_FILE","start":27,"end":53,"istart":0,"iend":26,"children":[{"type":"Token","kind":"WHITESPACE","start":27,"end":28,"istart":0,"iend":1},{"type":"Node","kind":"FN","start":28,"end":40,"istart":1,"iend":13,"children":[{"type":"Token","kind":"FN_KW","start":28,"end":30,"istart":1,"iend":3},{"type":"Token","kind":"WHITESPACE","start":30,"end":31,"istart":3,"iend":4},{"type":"Node","kind":"NAME","start":31,"end":34,"istart":4,"iend":7,"children":[{"type":"Token","kind":"IDENT","start":31,"end":34,"istart":4,"iend":7}]},{"type":"Node","kind":"PARAM_LIST","start":34,"end":36,"istart":7,"iend":9,"children":[{"type":"Token","kind":"L_PAREN","start":34,"end":35,"istart":7,"iend":8},{"type":"Token","kind":"R_PAREN","start":35,"end":36,"istart":8,"iend":9}]},{"type":"Token","kind":"WHITESPACE","start":36,"end":37,"istart":9,"iend":10},{"type":"Node","kind":"BLOCK_EXPR","start":37,"end":40,"istart":10,"iend":13,"children":[{"type":"Node","kind":"STMT_LIST","start":37,"end":40,"istart":10,"iend":13,"children":[{"type":"Token","kind":"L_CURLY","start":37,"end":38,"istart":10,"iend":11},{"type":"Token","kind":"WHITESPACE","start":38,"end":39,"istart":11,"iend":12},{"type":"Token","kind":"R_CURLY","start":39,"end":40,"istart":12,"iend":13}]}]}]},{"type":"Token","kind":"WHITESPACE","start":40,"end":41,"istart":13,"iend":14},{"type":"Node","kind":"FN","start":41,"end":53,"istart":14,"iend":26,"children":[{"type":"Token","kind":"FN_KW","start":41,"end":43,"istart":14,"iend":16},{"type":"Token","kind":"WHITESPACE","start":43,"end":44,"istart":16,"iend":17},{"type":"Node","kind":"NAME","start":44,"end":47,"istart":17,"iend":20,"children":[{"type":"Token","kind":"IDENT","start":44,"end":47,"istart":17,"iend":20}]},{"type":"Node","kind":"PARAM_LIST","start":47,"end":49,"istart":20,"iend":22,"children":[{"type":"Token","kind":"L_PAREN","start":47,"end":48,"istart":20,"iend":21},{"type":"Token","kind":"R_PAREN","start":48,"end":49,"istart":21,"iend":22}]},{"type":"Token","kind":"WHITESPACE","start":49,"end":50,"istart":22,"iend":23},{"type":"Node","kind":"BLOCK_EXPR","start":50,"end":53,"istart":23,"iend":26,"children":[{"type":"Node","kind":"STMT_LIST","start":50,"end":53,"istart":23,"iend":26,"children":[{"type":"Token","kind":"L_CURLY","start":50,"end":51,"istart":23,"iend":24},{"type":"Token","kind":"WHITESPACE","start":51,"end":52,"istart":24,"iend":25},{"type":"Token","kind":"R_CURLY","start":52,"end":53,"istart":25,"iend":26}]}]}]}]}]},{"type":"Token","kind":"COMMA","start":55,"end":56},{"type":"Token","kind":"WHITESPACE","start":56,"end":57},{"type":"Token","kind":"STRING","start":57,"end":59},{"type":"Token","kind":"R_PAREN","start":59,"end":60}]}]}]},{"type":"Token","kind":"SEMICOLON","start":60,"end":61}]},{"type":"Token","kind":"WHITESPACE","start":61,"end":62},{"type":"Token","kind":"R_CURLY","start":62,"end":63}]}]}]}]}"#
             ]],
         );
     }
diff --git a/crates/rust-analyzer/src/cli/analysis_stats.rs b/crates/rust-analyzer/src/cli/analysis_stats.rs
index 824f262ca3..cd709afe09 100644
--- a/crates/rust-analyzer/src/cli/analysis_stats.rs
+++ b/crates/rust-analyzer/src/cli/analysis_stats.rs
@@ -673,9 +673,6 @@ impl flags::AnalysisStats {
                         DefWithBody::Const(it) => it.source(db).map(|it| it.syntax().cloned()),
                         DefWithBody::Variant(it) => it.source(db).map(|it| it.syntax().cloned()),
                         DefWithBody::InTypeConst(_) => unimplemented!(),
-                        DefWithBody::Field(it) => {
-                            it.default_value_source(db).map(|it| it.syntax().cloned())
-                        }
                     };
                     if let Some(src) = source {
                         let original_file = src.file_id.original_file(db);
@@ -990,9 +987,6 @@ impl flags::AnalysisStats {
                         DefWithBody::Const(it) => it.source(db).map(|it| it.syntax().cloned()),
                         DefWithBody::Variant(it) => it.source(db).map(|it| it.syntax().cloned()),
                         DefWithBody::InTypeConst(_) => unimplemented!(),
-                        DefWithBody::Field(it) => {
-                            it.default_value_source(db).map(|it| it.syntax().cloned())
-                        }
                     };
                     if let Some(src) = source {
                         let original_file = src.file_id.original_file(db);
diff --git a/editors/code/package.json b/editors/code/package.json
index 57f4254b68..f148041ac3 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -501,10 +501,6 @@
                                 },
                                 {
                                     "pattern": "**/Cargo.lock"
-                                },
-                                {
-                                    "scheme": "output",
-                                    "pattern": "extension-output-rust-lang.rust-analyzer*"
                                 }
                             ]
                         }
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts
index eee623ecae..b3aa04af7e 100644
--- a/editors/code/src/commands.ts
+++ b/editors/code/src/commands.ts
@@ -361,7 +361,10 @@ export function syntaxTreeReveal(): Cmd {
         const activeEditor = vscode.window.activeTextEditor;
 
         if (activeEditor !== undefined) {
-            const newSelection = new vscode.Selection(element.range.start, element.range.end);
+            const start = activeEditor.document.positionAt(element.start);
+            const end = activeEditor.document.positionAt(element.end);
+
+            const newSelection = new vscode.Selection(start, end);
 
             activeEditor.selection = newSelection;
             activeEditor.revealRange(newSelection);
@@ -375,12 +378,15 @@ function elementToString(
     depth: number = 0,
 ): string {
     let result = "  ".repeat(depth);
-    const offsets = element.inner?.offsets ?? element.offsets;
+    const start = element.istart ?? element.start;
+    const end = element.iend ?? element.end;
 
-    result += `${element.kind}@${offsets.start}..${offsets.end}`;
+    result += `${element.kind}@${start}..${end}`;
 
     if (element.type === "Token") {
-        const text = activeDocument.getText(element.range).replaceAll("\r\n", "\n");
+        const startPosition = activeDocument.positionAt(element.start);
+        const endPosition = activeDocument.positionAt(element.end);
+        const text = activeDocument.getText(new vscode.Range(startPosition, endPosition));
         // JSON.stringify quotes and escapes the string for us.
         result += ` ${JSON.stringify(text)}\n`;
     } else {
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts
index 4248305d5c..96dc4f19b8 100644
--- a/editors/code/src/ctx.ts
+++ b/editors/code/src/ctx.ts
@@ -384,7 +384,9 @@ export class Ctx implements RustAnalyzerExtensionApi {
                 return;
             }
 
-            const result = this.syntaxTreeProvider?.getElementByRange(selection);
+            const start = e.textEditor.document.offsetAt(selection.start);
+            const end = e.textEditor.document.offsetAt(selection.end);
+            const result = this.syntaxTreeProvider?.getElementByRange(start, end);
             if (result !== undefined) {
                 await this.syntaxTreeView?.reveal(result);
             }
diff --git a/editors/code/src/syntax_tree_provider.ts b/editors/code/src/syntax_tree_provider.ts
index 3f7e30f13a..c7e8007e83 100644
--- a/editors/code/src/syntax_tree_provider.ts
+++ b/editors/code/src/syntax_tree_provider.ts
@@ -37,7 +37,11 @@ export class SyntaxTreeProvider implements vscode.TreeDataProvider<SyntaxElement
         const editor = vscode.window.activeTextEditor;
 
         if (editor !== undefined) {
-            const text = editor.document.getText(element.range);
+            const start = editor.document.positionAt(element.start);
+            const end = editor.document.positionAt(element.end);
+            const range = new vscode.Range(start, end);
+
+            const text = editor.document.getText(range);
             item.tooltip = new vscode.MarkdownString().appendCodeblock(text, "rust");
         }
 
@@ -70,61 +74,14 @@ export class SyntaxTreeProvider implements vscode.TreeDataProvider<SyntaxElement
         if (editor && isRustEditor(editor)) {
             const params = { textDocument: { uri: editor.document.uri.toString() }, range: null };
             const fileText = await this.ctx.client.sendRequest(ra.viewSyntaxTree, params);
-            this.root = JSON.parse(fileText, (_key, value: RawElement): SyntaxElement => {
-                if (value.type !== "Node" && value.type !== "Token") {
-                    // This is something other than a RawElement.
-                    return value;
-                }
-                const [startOffset, startLine, startCol] = value.start;
-                const [endOffset, endLine, endCol] = value.end;
-                const range = new vscode.Range(startLine, startCol, endLine, endCol);
-                const offsets = {
-                    start: startOffset,
-                    end: endOffset,
-                };
-
-                let inner;
-                if (value.istart && value.iend) {
-                    const [istartOffset, istartLine, istartCol] = value.istart;
-                    const [iendOffset, iendLine, iendCol] = value.iend;
-
-                    inner = {
-                        offsets: {
-                            start: istartOffset,
-                            end: iendOffset,
-                        },
-                        range: new vscode.Range(istartLine, istartCol, iendLine, iendCol),
-                    };
-                }
-
+            this.root = JSON.parse(fileText, (_key, value: SyntaxElement) => {
                 if (value.type === "Node") {
-                    const result = {
-                        type: value.type,
-                        kind: value.kind,
-                        offsets,
-                        range,
-                        inner,
-                        children: value.children,
-                        parent: undefined,
-                        document: editor.document,
-                    };
-
-                    for (const child of result.children) {
-                        child.parent = result;
+                    for (const child of value.children) {
+                        child.parent = value;
                     }
-
-                    return result;
-                } else {
-                    return {
-                        type: value.type,
-                        kind: value.kind,
-                        offsets,
-                        range,
-                        inner,
-                        parent: undefined,
-                        document: editor.document,
-                    };
                 }
+
+                return value;
             });
         } else {
             this.root = undefined;
@@ -133,14 +90,14 @@ export class SyntaxTreeProvider implements vscode.TreeDataProvider<SyntaxElement
         this._onDidChangeTreeData.fire();
     }
 
-    getElementByRange(target: vscode.Range): SyntaxElement | undefined {
+    getElementByRange(start: number, end: number): SyntaxElement | undefined {
         if (this.root === undefined) {
             return undefined;
         }
 
         let result: SyntaxElement = this.root;
 
-        if (this.root.range.isEqual(target)) {
+        if (this.root.start === start && this.root.end === end) {
             return result;
         }
 
@@ -148,9 +105,9 @@ export class SyntaxTreeProvider implements vscode.TreeDataProvider<SyntaxElement
 
         outer: while (true) {
             for (const child of children) {
-                if (child.range.contains(target)) {
+                if (child.start <= start && child.end >= end) {
                     result = child;
-                    if (target.isEmpty && target.start === child.range.end) {
+                    if (start === end && start === child.end) {
                         // When the cursor is on the very end of a token,
                         // we assume the user wants the next token instead.
                         continue;
@@ -179,72 +136,31 @@ export class SyntaxTreeProvider implements vscode.TreeDataProvider<SyntaxElement
 export type SyntaxNode = {
     type: "Node";
     kind: string;
-    range: vscode.Range;
-    offsets: {
-        start: number;
-        end: number;
-    };
-    /** This element's position within a Rust string literal, if it's inside of one. */
-    inner?: {
-        range: vscode.Range;
-        offsets: {
-            start: number;
-            end: number;
-        };
-    };
+    start: number;
+    end: number;
+    istart?: number;
+    iend?: number;
     children: SyntaxElement[];
     parent?: SyntaxElement;
-    document: vscode.TextDocument;
 };
 
 type SyntaxToken = {
     type: "Token";
     kind: string;
-    range: vscode.Range;
-    offsets: {
-        start: number;
-        end: number;
-    };
-    /** This element's position within a Rust string literal, if it's inside of one. */
-    inner?: {
-        range: vscode.Range;
-        offsets: {
-            start: number;
-            end: number;
-        };
-    };
+    start: number;
+    end: number;
+    istart?: number;
+    iend?: number;
     parent?: SyntaxElement;
-    document: vscode.TextDocument;
 };
 
 export type SyntaxElement = SyntaxNode | SyntaxToken;
 
-type RawNode = {
-    type: "Node";
-    kind: string;
-    start: [number, number, number];
-    end: [number, number, number];
-    istart?: [number, number, number];
-    iend?: [number, number, number];
-    children: SyntaxElement[];
-};
-
-type RawToken = {
-    type: "Token";
-    kind: string;
-    start: [number, number, number];
-    end: [number, number, number];
-    istart?: [number, number, number];
-    iend?: [number, number, number];
-};
-
-type RawElement = RawNode | RawToken;
-
 export class SyntaxTreeItem extends vscode.TreeItem {
     constructor(private readonly element: SyntaxElement) {
         super(element.kind);
-        const icon = getIcon(this.element.kind);
-        if (this.element.type === "Node") {
+        const icon = getIcon(element.kind);
+        if (element.type === "Node") {
             this.contextValue = "syntaxNode";
             this.iconPath = icon ?? new vscode.ThemeIcon("list-tree");
             this.collapsibleState = vscode.TreeItemCollapsibleState.Expanded;
@@ -254,9 +170,11 @@ export class SyntaxTreeItem extends vscode.TreeItem {
             this.collapsibleState = vscode.TreeItemCollapsibleState.None;
         }
 
-        const offsets = this.element.inner?.offsets ?? this.element.offsets;
-
-        this.description = `${offsets.start}..${offsets.end}`;
+        if (element.istart !== undefined && element.iend !== undefined) {
+            this.description = `${this.element.istart}..${this.element.iend}`;
+        } else {
+            this.description = `${this.element.start}..${this.element.end}`;
+        }
     }
 }
 


Test patch:
diff --git a/crates/hir-def/src/macro_expansion_tests/builtin_derive_macro.rs b/crates/hir-def/src/macro_expansion_tests/builtin_derive_macro.rs
index 25391c910e..c31d322132 100644
--- a/crates/hir-def/src/macro_expansion_tests/builtin_derive_macro.rs
+++ b/crates/hir-def/src/macro_expansion_tests/builtin_derive_macro.rs
@@ -211,20 +211,6 @@ enum Bar {
     #[default]
     Bar,
 }
-#[derive(Default)]
-struct Baz {
-    field1: i32 = 2,
-    field2: bool = { false },
-}
-#[derive(Default)]
-enum Qux {
-    #[default]
-    Foo {
-        field1: i32,
-        field2: bool = true,
-        field3: (),
-    }
-}
 "#,
         expect![[r#"
 #[derive(Default)]
@@ -238,20 +224,6 @@ enum Bar {
     #[default]
     Bar,
 }
-#[derive(Default)]
-struct Baz {
-    field1: i32 = 2,
-    field2: bool = { false },
-}
-#[derive(Default)]
-enum Qux {
-    #[default]
-    Foo {
-        field1: i32,
-        field2: bool = true,
-        field3: (),
-    }
-}
 
 impl <> $crate::default::Default for Foo< > where {
     fn default() -> Self {
@@ -264,20 +236,6 @@ impl <> $crate::default::Default for Bar< > where {
     fn default() -> Self {
         Bar::Bar
     }
-}
-impl <> $crate::default::Default for Baz< > where {
-    fn default() -> Self {
-        Baz {
-            ..
-        }
-    }
-}
-impl <> $crate::default::Default for Qux< > where {
-    fn default() -> Self {
-        Qux::Foo {
-            field1: $crate::default::Default::default(), field3: $crate::default::Default::default(), ..
-        }
-    }
 }"#]],
     );
 }
diff --git a/crates/hir-ty/src/tests.rs b/crates/hir-ty/src/tests.rs
index 96e7130ecf..69ec35f406 100644
--- a/crates/hir-ty/src/tests.rs
+++ b/crates/hir-ty/src/tests.rs
@@ -16,7 +16,6 @@ use std::env;
 use std::sync::LazyLock;
 
 use base_db::SourceDatabaseFileInputExt as _;
-use either::Either;
 use expect_test::Expect;
 use hir_def::{
     db::DefDatabase,
@@ -24,14 +23,12 @@ use hir_def::{
     hir::{ExprId, Pat, PatId},
     item_scope::ItemScope,
     nameres::DefMap,
-    src::{HasChildSource, HasSource},
-    AdtId, AssocItemId, DefWithBodyId, FieldId, HasModule, LocalModuleId, Lookup, ModuleDefId,
-    SyntheticSyntax,
+    src::HasSource,
+    AssocItemId, DefWithBodyId, HasModule, LocalModuleId, Lookup, ModuleDefId, SyntheticSyntax,
 };
 use hir_expand::{db::ExpandDatabase, FileRange, InFile};
 use itertools::Itertools;
 use rustc_hash::FxHashMap;
-use span::TextSize;
 use stdx::format_to;
 use syntax::{
     ast::{self, AstNode, HasName},
@@ -135,40 +132,14 @@ fn check_impl(
             None => continue,
         };
         let def_map = module.def_map(&db);
-        visit_module(&db, &def_map, module.local_id, &mut |it| match it {
-            ModuleDefId::FunctionId(it) => defs.push(it.into()),
-            ModuleDefId::EnumVariantId(it) => {
-                defs.push(it.into());
-                let variant_id = it.into();
-                let vd = db.variant_data(variant_id);
-                defs.extend(vd.fields().iter().filter_map(|(local_id, fd)| {
-                    if fd.has_default {
-                        let field = FieldId { parent: variant_id, local_id };
-                        Some(DefWithBodyId::FieldId(field))
-                    } else {
-                        None
-                    }
-                }));
-            }
-            ModuleDefId::ConstId(it) => defs.push(it.into()),
-            ModuleDefId::StaticId(it) => defs.push(it.into()),
-            ModuleDefId::AdtId(it) => {
-                let variant_id = match it {
-                    AdtId::StructId(it) => it.into(),
-                    AdtId::UnionId(it) => it.into(),
-                    AdtId::EnumId(_) => return,
-                };
-                let vd = db.variant_data(variant_id);
-                defs.extend(vd.fields().iter().filter_map(|(local_id, fd)| {
-                    if fd.has_default {
-                        let field = FieldId { parent: variant_id, local_id };
-                        Some(DefWithBodyId::FieldId(field))
-                    } else {
-                        None
-                    }
-                }));
-            }
-            _ => {}
+        visit_module(&db, &def_map, module.local_id, &mut |it| {
+            defs.push(match it {
+                ModuleDefId::FunctionId(it) => it.into(),
+                ModuleDefId::EnumVariantId(it) => it.into(),
+                ModuleDefId::ConstId(it) => it.into(),
+                ModuleDefId::StaticId(it) => it.into(),
+                _ => return,
+            })
         });
     }
     defs.sort_by_key(|def| match def {
@@ -189,14 +160,6 @@ fn check_impl(
             loc.source(&db).value.syntax().text_range().start()
         }
         DefWithBodyId::InTypeConstId(it) => it.source(&db).syntax().text_range().start(),
-        DefWithBodyId::FieldId(it) => {
-            let cs = it.parent.child_source(&db);
-            match cs.value.get(it.local_id) {
-                Some(Either::Left(it)) => it.syntax().text_range().start(),
-                Some(Either::Right(it)) => it.syntax().text_range().end(),
-                None => TextSize::new(u32::MAX),
-            }
-        }
     });
     let mut unexpected_type_mismatches = String::new();
     for def in defs {
@@ -425,40 +388,14 @@ fn infer_with_mismatches(content: &str, include_mismatches: bool) -> String {
     let def_map = module.def_map(&db);
 
     let mut defs: Vec<DefWithBodyId> = Vec::new();
-    visit_module(&db, &def_map, module.local_id, &mut |it| match it {
-        ModuleDefId::FunctionId(it) => defs.push(it.into()),
-        ModuleDefId::EnumVariantId(it) => {
-            defs.push(it.into());
-            let variant_id = it.into();
-            let vd = db.variant_data(variant_id);
-            defs.extend(vd.fields().iter().filter_map(|(local_id, fd)| {
-                if fd.has_default {
-                    let field = FieldId { parent: variant_id, local_id };
-                    Some(DefWithBodyId::FieldId(field))
-                } else {
-                    None
-                }
-            }));
-        }
-        ModuleDefId::ConstId(it) => defs.push(it.into()),
-        ModuleDefId::StaticId(it) => defs.push(it.into()),
-        ModuleDefId::AdtId(it) => {
-            let variant_id = match it {
-                AdtId::StructId(it) => it.into(),
-                AdtId::UnionId(it) => it.into(),
-                AdtId::EnumId(_) => return,
-            };
-            let vd = db.variant_data(variant_id);
-            defs.extend(vd.fields().iter().filter_map(|(local_id, fd)| {
-                if fd.has_default {
-                    let field = FieldId { parent: variant_id, local_id };
-                    Some(DefWithBodyId::FieldId(field))
-                } else {
-                    None
-                }
-            }));
-        }
-        _ => {}
+    visit_module(&db, &def_map, module.local_id, &mut |it| {
+        defs.push(match it {
+            ModuleDefId::FunctionId(it) => it.into(),
+            ModuleDefId::EnumVariantId(it) => it.into(),
+            ModuleDefId::ConstId(it) => it.into(),
+            ModuleDefId::StaticId(it) => it.into(),
+            _ => return,
+        })
     });
     defs.sort_by_key(|def| match def {
         DefWithBodyId::FunctionId(it) => {
@@ -478,14 +415,6 @@ fn infer_with_mismatches(content: &str, include_mismatches: bool) -> String {
             loc.source(&db).value.syntax().text_range().start()
         }
         DefWithBodyId::InTypeConstId(it) => it.source(&db).syntax().text_range().start(),
-        DefWithBodyId::FieldId(it) => {
-            let cs = it.parent.child_source(&db);
-            match cs.value.get(it.local_id) {
-                Some(Either::Left(it)) => it.syntax().text_range().start(),
-                Some(Either::Right(it)) => it.syntax().text_range().end(),
-                None => TextSize::new(u32::MAX),
-            }
-        }
     });
     for def in defs {
         let (body, source_map) = db.body_with_source_map(def);
@@ -546,7 +475,7 @@ pub(crate) fn visit_module(
                     let body = db.body(it.into());
                     visit_body(db, &body, cb);
                 }
-                ModuleDefId::AdtId(AdtId::EnumId(it)) => {
+                ModuleDefId::AdtId(hir_def::AdtId::EnumId(it)) => {
                     db.enum_data(it).variants.iter().for_each(|&(it, _)| {
                         let body = db.body(it.into());
                         cb(it.into());
diff --git a/crates/hir-ty/src/tests/method_resolution.rs b/crates/hir-ty/src/tests/method_resolution.rs
index e5f791ea6f..8866de22df 100644
--- a/crates/hir-ty/src/tests/method_resolution.rs
+++ b/crates/hir-ty/src/tests/method_resolution.rs
@@ -2163,9 +2163,9 @@ impl Receiver for Bar {
 fn main() {
     let bar = Bar;
     let _v1 = bar.foo1();
-      //^^^ type: {unknown}
+      //^^^ type: i32
     let _v2 = bar.foo2();
-      //^^^ type: {unknown}
+      //^^^ type: bool
 }
 "#,
     );
diff --git a/crates/hir-ty/src/tests/type_alias_impl_traits.rs b/crates/hir-ty/src/tests/type_alias_impl_traits.rs
index a2aada57da..e2b7bf379c 100644
--- a/crates/hir-ty/src/tests/type_alias_impl_traits.rs
+++ b/crates/hir-ty/src/tests/type_alias_impl_traits.rs
@@ -157,53 +157,5 @@ static ALIAS: i32 = {
             217..218 '5': i32
             205..211: expected impl Trait + ?Sized, got Struct
         "#]],
-    );
-}
-
-#[test]
-fn defining_type_alias_impl_trait_from_default_fields() {
-    check_no_mismatches(
-        r#"
-trait Trait {}
-
-struct Struct;
-
-impl Trait for Struct {}
-
-type AliasTy = impl Trait;
-
-struct Foo {
-    foo: AliasTy = {
-        let x: AliasTy = Struct;
-        x
-    },
-}
-"#,
-    );
-
-    check_infer_with_mismatches(
-        r#"
-trait Trait {}
-
-struct Struct;
-
-impl Trait for Struct {}
-
-type AliasTy = impl Trait;
-
-struct Foo {
-    foo: i32 = {
-        let x: AliasTy = Struct;
-        5
-    },
-}
-"#,
-        expect![[r#"
-            114..164 '{     ...     }': i32
-            128..129 'x': impl Trait + ?Sized
-            141..147 'Struct': Struct
-            157..158 '5': i32
-            141..147: expected impl Trait + ?Sized, got Struct
-        "#]],
-    );
+    )
 }
diff --git a/crates/rust-analyzer/tests/slow-tests/testdir.rs b/crates/rust-analyzer/tests/slow-tests/testdir.rs
index 409be2894f..d113bd5127 100644
--- a/crates/rust-analyzer/tests/slow-tests/testdir.rs
+++ b/crates/rust-analyzer/tests/slow-tests/testdir.rs
@@ -43,15 +43,10 @@ impl TestDir {
             }
             fs::create_dir_all(&path).unwrap();
 
-            #[cfg(any(
-                target_os = "macos",
-                target_os = "linux",
-                target_os = "windows",
-                target_os = "freebsd"
-            ))]
+            #[cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))]
             if symlink {
                 let symlink_path = base.join(format!("{pid}_{cnt}_symlink"));
-                #[cfg(any(target_os = "macos", target_os = "linux", target_os = "freebsd"))]
+                #[cfg(any(target_os = "macos", target_os = "linux"))]
                 std::os::unix::fs::symlink(path, &symlink_path).unwrap();
 
                 #[cfg(target_os = "windows")]