mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-20 03:49:51 +00:00
use rustc crates instead of copy paste
This commit is contained in:
parent
f2c9502185
commit
05906da0ec
13 changed files with 291 additions and 2083 deletions
|
|
@ -3,8 +3,7 @@ use std::fmt::Display;
|
|||
|
||||
use either::Either;
|
||||
use hir::{
|
||||
db::HirDatabase, Adt, AsAssocItem, AttributeTemplate, HasAttrs, HasSource, HirDisplay,
|
||||
Semantics, TypeInfo,
|
||||
Adt, AsAssocItem, AttributeTemplate, HasAttrs, HasSource, HirDisplay, Semantics, TypeInfo,
|
||||
};
|
||||
use ide_db::{
|
||||
base_db::SourceDatabase,
|
||||
|
|
@ -398,7 +397,7 @@ pub(super) fn definition(
|
|||
let offset = match var_def {
|
||||
hir::VariantDef::Struct(s) => {
|
||||
let layout = Adt::from(s).layout(db).ok()?;
|
||||
layout.fields.offset(id, &db.current_target_data_layout())
|
||||
layout.fields.offset(id)
|
||||
}
|
||||
_ => return None,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue