about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorOliver Scherer <github35764891676564198441@oli-obk.de>2019-06-19 20:17:09 +0200
committerOliver Scherer <github35764891676564198441@oli-obk.de>2019-06-19 20:17:09 +0200
commit3dfe017dc3fccca64d67973be10e4bbd3e90c966 (patch)
treec3c130d05d06cc97dfbf90f56419168149fa8f1d /src
parentcdf55965027b87a12800dca2dedd672fac618f5b (diff)
downloadrust-3dfe017dc3fccca64d67973be10e4bbd3e90c966.tar.gz
rust-3dfe017dc3fccca64d67973be10e4bbd3e90c966.zip
Pacify tidy
Diffstat (limited to 'src')
-rw-r--r--src/librustc/mir/interpret/value.rs11
-rw-r--r--src/librustc_codegen_llvm/consts.rs4
2 files changed, 9 insertions, 6 deletions
diff --git a/src/librustc/mir/interpret/value.rs b/src/librustc/mir/interpret/value.rs
index d94e2c6c2e0..efcba88fe2d 100644
--- a/src/librustc/mir/interpret/value.rs
+++ b/src/librustc/mir/interpret/value.rs
@@ -45,11 +45,12 @@ pub enum ConstValue<'tcx> {
 
     /// An value not represented/representable by `Scalar` or `Slice`
     ByRef {
-        /// The alignment exists to allow `const_field` to have `ByRef` access to nonprimitive fields
-        /// of `repr(packed)` structs. The alignment may be lower than the type of this constant.
-        /// This permits reads with lower alignment than what the type would normally require.
-        /// FIXME(RalfJ,oli-obk): The alignment checks are part of miri, but const eval doesn't really
-        /// need them. Disabling them may be too hard though.
+        /// The alignment exists to allow `const_field` to have `ByRef` access to nonprimitive
+        /// fields of `repr(packed)` structs. The alignment may be lower than the type of this
+        /// constant. This permits reads with lower alignment than what the type would normally
+        /// require.
+        /// FIXME(RalfJ,oli-obk): The alignment checks are part of miri, but const eval doesn't
+        /// really need them. Disabling them may be too hard though.
         align: Align,
         /// Offset into `alloc`
         offset: Size,
diff --git a/src/librustc_codegen_llvm/consts.rs b/src/librustc_codegen_llvm/consts.rs
index 7f11df39796..24167a2f887 100644
--- a/src/librustc_codegen_llvm/consts.rs
+++ b/src/librustc_codegen_llvm/consts.rs
@@ -71,7 +71,9 @@ pub fn codegen_static_initializer(
     let static_ = cx.tcx.const_eval(param_env.and(cid))?;
 
     let alloc = match static_.val {
-        ConstValue::ByRef { offset, align, alloc } if offset.bytes() == 0 && align == alloc.align => {
+        ConstValue::ByRef {
+            offset, align, alloc,
+        } if offset.bytes() == 0 && align == alloc.align => {
             alloc
         },
         _ => bug!("static const eval returned {:#?}", static_),