Format code

This commit is contained in:
Laurențiu Nicola 2025-03-10 11:37:21 +02:00
parent 1afcab1725
commit 25e4bd1f90

View file

@ -6,9 +6,8 @@ use base_db::ra_salsa::Cycle;
use chalk_ir::{AdtId, FloatTy, IntTy, TyKind, UintTy}; use chalk_ir::{AdtId, FloatTy, IntTy, TyKind, UintTy};
use hir_def::{ use hir_def::{
layout::{ layout::{
Float, Integer, LayoutCalculator, LayoutCalculatorError, Float, Integer, LayoutCalculator, LayoutCalculatorError, LayoutData, Primitive,
LayoutData, Primitive, ReprOptions, Scalar, StructKind, TargetDataLayout, ReprOptions, Scalar, StructKind, TargetDataLayout, WrappingRange,
WrappingRange,
}, },
LocalFieldId, StructId, LocalFieldId, StructId,
}; };
@ -192,7 +191,9 @@ pub fn layout_of_ty_query(
valid_range: WrappingRange { start: 0, end: 0x10FFFF }, valid_range: WrappingRange { start: 0, end: 0x10FFFF },
}, },
), ),
chalk_ir::Scalar::Int(i) => Layout::scalar(dl, scalar_unit( chalk_ir::Scalar::Int(i) => Layout::scalar(
dl,
scalar_unit(
dl, dl,
Primitive::Int( Primitive::Int(
match i { match i {
@ -205,8 +206,11 @@ pub fn layout_of_ty_query(
}, },
true, true,
), ),
)), ),
chalk_ir::Scalar::Uint(i) => Layout::scalar(dl, scalar_unit( ),
chalk_ir::Scalar::Uint(i) => Layout::scalar(
dl,
scalar_unit(
dl, dl,
Primitive::Int( Primitive::Int(
match i { match i {
@ -219,8 +223,11 @@ pub fn layout_of_ty_query(
}, },
false, false,
), ),
)), ),
chalk_ir::Scalar::Float(f) => Layout::scalar(dl, scalar_unit( ),
chalk_ir::Scalar::Float(f) => Layout::scalar(
dl,
scalar_unit(
dl, dl,
Primitive::Float(match f { Primitive::Float(match f {
FloatTy::F16 => Float::F16, FloatTy::F16 => Float::F16,
@ -228,7 +235,8 @@ pub fn layout_of_ty_query(
FloatTy::F64 => Float::F64, FloatTy::F64 => Float::F64,
FloatTy::F128 => Float::F128, FloatTy::F128 => Float::F128,
}), }),
)), ),
),
}, },
TyKind::Tuple(len, tys) => { TyKind::Tuple(len, tys) => {
let kind = if *len == 0 { StructKind::AlwaysSized } else { StructKind::MaybeUnsized }; let kind = if *len == 0 { StructKind::AlwaysSized } else { StructKind::MaybeUnsized };