@@ -217,12 +217,12 @@ impl LiteralExpander<'tcx> {
217
217
// the easy case, deref a reference
218
218
( ConstValue :: Scalar ( Scalar :: Ptr ( p) ) , x, y) if x == y => {
219
219
let alloc = self . tcx . alloc_map . lock ( ) . unwrap_memory ( p. alloc_id ) ;
220
- ConstValue :: ByRef (
221
- p. offset ,
220
+ ConstValue :: ByRef {
221
+ offset : p. offset ,
222
222
// FIXME(oli-obk): this should be the type's layout
223
- alloc. align ,
223
+ align : alloc. align ,
224
224
alloc,
225
- )
225
+ }
226
226
} ,
227
227
// unsize array to slice if pattern is array but match value or other patterns are slice
228
228
( ConstValue :: Scalar ( Scalar :: Ptr ( p) ) , ty:: Array ( t, n) , ty:: Slice ( u) ) => {
@@ -1436,7 +1436,7 @@ fn slice_pat_covered_by_const<'tcx>(
1436
1436
suffix : & [ Pattern < ' tcx > ] ,
1437
1437
) -> Result < bool , ErrorReported > {
1438
1438
let data: & [ u8 ] = match ( const_val. val , & const_val. ty . sty ) {
1439
- ( ConstValue :: ByRef ( offset, _ , alloc ) , ty:: Array ( t, n) ) => {
1439
+ ( ConstValue :: ByRef { offset, alloc , .. } , ty:: Array ( t, n) ) => {
1440
1440
assert_eq ! ( * t, tcx. types. u8 ) ;
1441
1441
let n = n. assert_usize ( tcx) . unwrap ( ) ;
1442
1442
let ptr = Pointer :: new ( AllocId ( 0 ) , offset) ;
@@ -1759,7 +1759,7 @@ fn specialize<'p, 'a: 'p, 'tcx>(
1759
1759
let ( alloc, offset, n, ty) = match value. ty . sty {
1760
1760
ty:: Array ( t, n) => {
1761
1761
match value. val {
1762
- ConstValue :: ByRef ( offset, _ , alloc ) => (
1762
+ ConstValue :: ByRef { offset, alloc , .. } => (
1763
1763
alloc,
1764
1764
offset,
1765
1765
n. unwrap_usize ( cx. tcx ) ,
@@ -1779,7 +1779,7 @@ fn specialize<'p, 'a: 'p, 'tcx>(
1779
1779
( end - start) as u64 ,
1780
1780
t,
1781
1781
) ,
1782
- ConstValue :: ByRef ( .. ) => {
1782
+ ConstValue :: ByRef { .. } => {
1783
1783
// FIXME(oli-obk): implement `deref` for `ConstValue`
1784
1784
return None ;
1785
1785
} ,
0 commit comments