diff options
| author | Michael Goulet <michael@errs.io> | 2024-09-22 19:05:04 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-09-22 19:11:29 -0400 |
| commit | c682aa162b0d41e21cc6748f4fecfe01efb69d1f (patch) | |
| tree | 0c31b640e3faacfb187a1509e3da5d5b6ba0109c /compiler/rustc_ty_utils/src | |
| parent | 1173204b364841b51598744fc69d7c80be10f956 (diff) | |
| download | rust-c682aa162b0d41e21cc6748f4fecfe01efb69d1f.tar.gz rust-c682aa162b0d41e21cc6748f4fecfe01efb69d1f.zip | |
Reformat using the new identifier sorting from rustfmt
Diffstat (limited to 'compiler/rustc_ty_utils/src')
| -rw-r--r-- | compiler/rustc_ty_utils/src/abi.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_ty_utils/src/consts.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_ty_utils/src/implied_bounds.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_ty_utils/src/instance.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_ty_utils/src/layout.rs | 57 | ||||
| -rw-r--r-- | compiler/rustc_ty_utils/src/needs_drop.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_ty_utils/src/opaque_types.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_ty_utils/src/ty.rs | 4 |
8 files changed, 33 insertions, 48 deletions
diff --git a/compiler/rustc_ty_utils/src/abi.rs b/compiler/rustc_ty_utils/src/abi.rs index 00d38350b20..f23c2cf2c07 100644 --- a/compiler/rustc_ty_utils/src/abi.rs +++ b/compiler/rustc_ty_utils/src/abi.rs @@ -5,7 +5,7 @@ use rustc_hir::lang_items::LangItem; use rustc_middle::bug; use rustc_middle::query::Providers; use rustc_middle::ty::layout::{ - fn_can_unwind, FnAbiError, HasParamEnv, HasTyCtxt, LayoutCx, LayoutOf, TyAndLayout, + FnAbiError, HasParamEnv, HasTyCtxt, LayoutCx, LayoutOf, TyAndLayout, fn_can_unwind, }; use rustc_middle::ty::{self, InstanceKind, Ty, TyCtxt}; use rustc_session::config::OptLevel; diff --git a/compiler/rustc_ty_utils/src/consts.rs b/compiler/rustc_ty_utils/src/consts.rs index ae5341ddec1..391985ce88a 100644 --- a/compiler/rustc_ty_utils/src/consts.rs +++ b/compiler/rustc_ty_utils/src/consts.rs @@ -11,7 +11,7 @@ use rustc_middle::ty::abstract_const::CastKind; use rustc_middle::ty::{self, Expr, TyCtxt, TypeVisitableExt}; use rustc_middle::{bug, mir, thir}; use rustc_span::Span; -use rustc_target::abi::{VariantIdx, FIRST_VARIANT}; +use rustc_target::abi::{FIRST_VARIANT, VariantIdx}; use tracing::{debug, instrument}; use crate::errors::{GenericConstantTooComplex, GenericConstantTooComplexSub}; diff --git a/compiler/rustc_ty_utils/src/implied_bounds.rs b/compiler/rustc_ty_utils/src/implied_bounds.rs index 70321a071a2..5cd10e90538 100644 --- a/compiler/rustc_ty_utils/src/implied_bounds.rs +++ b/compiler/rustc_ty_utils/src/implied_bounds.rs @@ -78,10 +78,10 @@ fn assumed_wf_types<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &'tcx [(Ty<' if matches!(*orig_lt, ty::ReLateParam(..)) { mapping.insert( orig_lt, - ty::Region::new_early_param( - tcx, - ty::EarlyParamRegion { index: param.index, name: param.name }, - ), + ty::Region::new_early_param(tcx, ty::EarlyParamRegion { + index: param.index, + name: param.name, + }), ); } } diff --git a/compiler/rustc_ty_utils/src/instance.rs b/compiler/rustc_ty_utils/src/instance.rs index d77c3a277bf..9b764133f2c 100644 --- a/compiler/rustc_ty_utils/src/instance.rs +++ b/compiler/rustc_ty_utils/src/instance.rs @@ -1,6 +1,6 @@ use rustc_errors::ErrorGuaranteed; -use rustc_hir::def_id::DefId; use rustc_hir::LangItem; +use rustc_hir::def_id::DefId; use rustc_infer::infer::TyCtxtInferExt; use rustc_middle::bug; use rustc_middle::query::Providers; @@ -11,7 +11,7 @@ use rustc_span::sym; use rustc_trait_selection::traits; use rustc_type_ir::ClosureKind; use tracing::debug; -use traits::{translate_args, Reveal}; +use traits::{Reveal, translate_args}; use crate::errors::UnexpectedFnPtrAssociatedItem; diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs index c153fb64c33..34c9f1b63c0 100644 --- a/compiler/rustc_ty_utils/src/layout.rs +++ b/compiler/rustc_ty_utils/src/layout.rs @@ -9,7 +9,7 @@ use rustc_middle::bug; use rustc_middle::mir::{CoroutineLayout, CoroutineSavedLocal}; use rustc_middle::query::Providers; use rustc_middle::ty::layout::{ - FloatExt, HasTyCtxt, IntegerExt, LayoutCx, LayoutError, LayoutOf, TyAndLayout, MAX_SIMD_LANES, + FloatExt, HasTyCtxt, IntegerExt, LayoutCx, LayoutError, LayoutOf, MAX_SIMD_LANES, TyAndLayout, }; use rustc_middle::ty::print::with_no_trimmed_paths; use rustc_middle::ty::{ @@ -194,20 +194,14 @@ fn layout_of_uncached<'tcx>( } // Basic scalars. - ty::Bool => tcx.mk_layout(LayoutS::scalar( - cx, - Scalar::Initialized { - value: Int(I8, false), - valid_range: WrappingRange { start: 0, end: 1 }, - }, - )), - ty::Char => tcx.mk_layout(LayoutS::scalar( - cx, - Scalar::Initialized { - value: Int(I32, false), - valid_range: WrappingRange { start: 0, end: 0x10FFFF }, - }, - )), + ty::Bool => tcx.mk_layout(LayoutS::scalar(cx, Scalar::Initialized { + value: Int(I8, false), + valid_range: WrappingRange { start: 0, end: 1 }, + })), + ty::Char => tcx.mk_layout(LayoutS::scalar(cx, Scalar::Initialized { + value: Int(I32, false), + valid_range: WrappingRange { start: 0, end: 0x10FFFF }, + })), ty::Int(ity) => scalar(Int(Integer::from_int_ty(dl, ity), true)), ty::Uint(ity) => scalar(Int(Integer::from_uint_ty(dl, ity), false)), ty::Float(fty) => scalar(Float(Float::from_float_ty(fty))), @@ -510,13 +504,10 @@ fn layout_of_uncached<'tcx>( // Non-power-of-two vectors have padding up to the next power-of-two. // If we're a packed repr, remove the padding while keeping the alignment as close // to a vector as possible. - ( - Abi::Aggregate { sized: true }, - AbiAndPrefAlign { - abi: Align::max_for_offset(size), - pref: dl.vector_align(size).pref, - }, - ) + (Abi::Aggregate { sized: true }, AbiAndPrefAlign { + abi: Align::max_for_offset(size), + pref: dl.vector_align(size).pref, + }) } else { (Abi::Vector { element: e_abi, count: e_len }, dl.vector_align(size)) }; @@ -1124,13 +1115,10 @@ fn variant_info_for_adt<'tcx>( }) .collect(); - ( - variant_infos, - match tag_encoding { - TagEncoding::Direct => Some(tag.size(cx)), - _ => None, - }, - ) + (variant_infos, match tag_encoding { + TagEncoding::Direct => Some(tag.size(cx)), + _ => None, + }) } } } @@ -1250,11 +1238,8 @@ fn variant_info_for_coroutine<'tcx>( let end_states: Vec<_> = end_states.collect(); variant_infos.extend(end_states); - ( - variant_infos, - match tag_encoding { - TagEncoding::Direct => Some(tag.size(cx)), - _ => None, - }, - ) + (variant_infos, match tag_encoding { + TagEncoding::Direct => Some(tag.size(cx)), + _ => None, + }) } diff --git a/compiler/rustc_ty_utils/src/needs_drop.rs b/compiler/rustc_ty_utils/src/needs_drop.rs index 9a3956596d2..5fecbd310b7 100644 --- a/compiler/rustc_ty_utils/src/needs_drop.rs +++ b/compiler/rustc_ty_utils/src/needs_drop.rs @@ -4,7 +4,7 @@ use rustc_data_structures::fx::FxHashSet; use rustc_hir::def_id::DefId; use rustc_middle::bug; use rustc_middle::query::Providers; -use rustc_middle::ty::util::{needs_drop_components, AlwaysRequiresDrop}; +use rustc_middle::ty::util::{AlwaysRequiresDrop, needs_drop_components}; use rustc_middle::ty::{self, EarlyBinder, GenericArgsRef, Ty, TyCtxt}; use rustc_session::Limit; use rustc_span::sym; diff --git a/compiler/rustc_ty_utils/src/opaque_types.rs b/compiler/rustc_ty_utils/src/opaque_types.rs index 6b24929467b..bac0d020d72 100644 --- a/compiler/rustc_ty_utils/src/opaque_types.rs +++ b/compiler/rustc_ty_utils/src/opaque_types.rs @@ -2,7 +2,7 @@ use rustc_data_structures::fx::FxHashSet; use rustc_hir::def::DefKind; use rustc_hir::def_id::LocalDefId; use rustc_hir::intravisit::Visitor; -use rustc_hir::{intravisit, CRATE_HIR_ID}; +use rustc_hir::{CRATE_HIR_ID, intravisit}; use rustc_middle::bug; use rustc_middle::query::Providers; use rustc_middle::ty::util::{CheckRegions, NotUniqueParam}; diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs index aba2acd1842..28a81b1b062 100644 --- a/compiler/rustc_ty_utils/src/ty.rs +++ b/compiler/rustc_ty_utils/src/ty.rs @@ -1,7 +1,7 @@ use rustc_data_structures::fx::FxHashSet; use rustc_hir as hir; -use rustc_hir::def::DefKind; use rustc_hir::LangItem; +use rustc_hir::def::DefKind; use rustc_index::bit_set::BitSet; use rustc_middle::bug; use rustc_middle::query::Providers; @@ -9,8 +9,8 @@ use rustc_middle::ty::{ self, EarlyBinder, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, Upcast, }; -use rustc_span::def_id::{DefId, LocalDefId, CRATE_DEF_ID}; use rustc_span::DUMMY_SP; +use rustc_span::def_id::{CRATE_DEF_ID, DefId, LocalDefId}; use rustc_trait_selection::traits; use tracing::{debug, instrument}; |
