Skip to content

Commit f0c8e9e

Browse files
committed
Rename is_disaligned to is_potentially_disaligned for better semantic clarity
1 parent 2fe4b7f commit f0c8e9e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/rustc_const_eval/src/util/alignment.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ fn get_element_alignment<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Option<Align>
7676
ty::Array(element_ty, _) | ty::Slice(element_ty) => {
7777
// For arrays and slices, the alignment is the same as the element type
7878
let param_env = ty::ParamEnv::empty();
79-
let typing_env = ty::TypingEnv { typing_mode: ty::TypingMode::non_body_analysis(), param_env };
79+
let typing_env =
80+
ty::TypingEnv { typing_mode: ty::TypingMode::non_body_analysis(), param_env };
8081
match tcx.layout_of(typing_env.as_query_input(*element_ty)) {
8182
Ok(layout) => Some(layout.align.abi),
8283
Err(_) => None,

compiler/rustc_mir_transform/src/check_packed_ref.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ impl<'tcx> Visitor<'tcx> for PackedRefChecker<'_, 'tcx> {
3737
}
3838

3939
fn visit_place(&mut self, place: &Place<'tcx>, context: PlaceContext, _location: Location) {
40-
if context.is_borrow() && util::is_potentially_disaligned(self.tcx, self.body, self.typing_env, *place)
40+
if context.is_borrow()
41+
&& util::is_potentially_disaligned(self.tcx, self.body, self.typing_env, *place)
4142
{
4243
let def_id = self.body.source.instance.def_id();
4344
if let Some(impl_def_id) = self.tcx.impl_of_assoc(def_id)

0 commit comments

Comments
 (0)