mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-30 15:03:42 +00:00
Merge #7986
7986: Simplify a bit r=flodiebold a=flodiebold Co-authored-by: Florian Diebold <flodiebold@gmail.com>
This commit is contained in:
commit
437527b226
1 changed files with 5 additions and 10 deletions
|
@ -487,19 +487,14 @@ pub(crate) fn struct_datum_query(
|
||||||
struct_id: AdtId,
|
struct_id: AdtId,
|
||||||
) -> Arc<StructDatum> {
|
) -> Arc<StructDatum> {
|
||||||
debug!("struct_datum {:?}", struct_id);
|
debug!("struct_datum {:?}", struct_id);
|
||||||
let type_ctor = Ty::Adt(struct_id, Substs::empty());
|
|
||||||
let chalk_ir::AdtId(adt_id) = struct_id;
|
let chalk_ir::AdtId(adt_id) = struct_id;
|
||||||
debug!("struct {:?} = {:?}", struct_id, type_ctor);
|
|
||||||
let num_params = generics(db.upcast(), adt_id.into()).len();
|
let num_params = generics(db.upcast(), adt_id.into()).len();
|
||||||
let upstream = adt_id.module(db.upcast()).krate() != krate;
|
let upstream = adt_id.module(db.upcast()).krate() != krate;
|
||||||
let where_clauses = type_ctor
|
let where_clauses = {
|
||||||
.as_generic_def()
|
let generic_params = generics(db.upcast(), adt_id.into());
|
||||||
.map(|generic_def| {
|
|
||||||
let generic_params = generics(db.upcast(), generic_def);
|
|
||||||
let bound_vars = Substs::bound_vars(&generic_params, DebruijnIndex::INNERMOST);
|
let bound_vars = Substs::bound_vars(&generic_params, DebruijnIndex::INNERMOST);
|
||||||
convert_where_clauses(db, generic_def, &bound_vars)
|
convert_where_clauses(db, adt_id.into(), &bound_vars)
|
||||||
})
|
};
|
||||||
.unwrap_or_else(Vec::new);
|
|
||||||
let flags = rust_ir::AdtFlags {
|
let flags = rust_ir::AdtFlags {
|
||||||
upstream,
|
upstream,
|
||||||
// FIXME set fundamental and phantom_data flags correctly
|
// FIXME set fundamental and phantom_data flags correctly
|
||||||
|
|
Loading…
Reference in a new issue