Skip to content

Commit 3dfe017

Browse files
committed
Pacify tidy
1 parent cdf5596 commit 3dfe017

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/librustc/mir/interpret/value.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ pub enum ConstValue<'tcx> {
4545

4646
/// An value not represented/representable by `Scalar` or `Slice`
4747
ByRef {
48-
/// The alignment exists to allow `const_field` to have `ByRef` access to nonprimitive fields
49-
/// of `repr(packed)` structs. The alignment may be lower than the type of this constant.
50-
/// This permits reads with lower alignment than what the type would normally require.
51-
/// FIXME(RalfJ,oli-obk): The alignment checks are part of miri, but const eval doesn't really
52-
/// need them. Disabling them may be too hard though.
48+
/// The alignment exists to allow `const_field` to have `ByRef` access to nonprimitive
49+
/// fields of `repr(packed)` structs. The alignment may be lower than the type of this
50+
/// constant. This permits reads with lower alignment than what the type would normally
51+
/// require.
52+
/// FIXME(RalfJ,oli-obk): The alignment checks are part of miri, but const eval doesn't
53+
/// really need them. Disabling them may be too hard though.
5354
align: Align,
5455
/// Offset into `alloc`
5556
offset: Size,

src/librustc_codegen_llvm/consts.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ pub fn codegen_static_initializer(
7171
let static_ = cx.tcx.const_eval(param_env.and(cid))?;
7272

7373
let alloc = match static_.val {
74-
ConstValue::ByRef { offset, align, alloc } if offset.bytes() == 0 && align == alloc.align => {
74+
ConstValue::ByRef {
75+
offset, align, alloc,
76+
} if offset.bytes() == 0 && align == alloc.align => {
7577
alloc
7678
},
7779
_ => bug!("static const eval returned {:#?}", static_),

0 commit comments

Comments
 (0)