File tree 2 files changed +9
-6
lines changed
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -45,11 +45,12 @@ pub enum ConstValue<'tcx> {
45
45
46
46
/// An value not represented/representable by `Scalar` or `Slice`
47
47
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.
53
54
align : Align ,
54
55
/// Offset into `alloc`
55
56
offset : Size ,
Original file line number Diff line number Diff line change @@ -71,7 +71,9 @@ pub fn codegen_static_initializer(
71
71
let static_ = cx. tcx . const_eval ( param_env. and ( cid) ) ?;
72
72
73
73
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 => {
75
77
alloc
76
78
} ,
77
79
_ => bug ! ( "static const eval returned {:#?}" , static_) ,
You can’t perform that action at this time.
0 commit comments