@@ -217,12 +217,12 @@ impl LiteralExpander<'tcx> {
217217 // the easy case, deref a reference
218218 ( ConstValue :: Scalar ( Scalar :: Ptr ( p) ) , x, y) if x == y => {
219219 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 ,
222222 // FIXME(oli-obk): this should be the type's layout
223- alloc. align ,
223+ align : alloc. align ,
224224 alloc,
225- )
225+ }
226226 } ,
227227 // unsize array to slice if pattern is array but match value or other patterns are slice
228228 ( ConstValue :: Scalar ( Scalar :: Ptr ( p) ) , ty:: Array ( t, n) , ty:: Slice ( u) ) => {
@@ -1436,7 +1436,7 @@ fn slice_pat_covered_by_const<'tcx>(
14361436 suffix : & [ Pattern < ' tcx > ] ,
14371437) -> Result < bool , ErrorReported > {
14381438 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) ) => {
14401440 assert_eq ! ( * t, tcx. types. u8 ) ;
14411441 let n = n. assert_usize ( tcx) . unwrap ( ) ;
14421442 let ptr = Pointer :: new ( AllocId ( 0 ) , offset) ;
@@ -1759,7 +1759,7 @@ fn specialize<'p, 'a: 'p, 'tcx>(
17591759 let ( alloc, offset, n, ty) = match value. ty . sty {
17601760 ty:: Array ( t, n) => {
17611761 match value. val {
1762- ConstValue :: ByRef ( offset, _ , alloc ) => (
1762+ ConstValue :: ByRef { offset, alloc , .. } => (
17631763 alloc,
17641764 offset,
17651765 n. unwrap_usize ( cx. tcx ) ,
@@ -1779,7 +1779,7 @@ fn specialize<'p, 'a: 'p, 'tcx>(
17791779 ( end - start) as u64 ,
17801780 t,
17811781 ) ,
1782- ConstValue :: ByRef ( .. ) => {
1782+ ConstValue :: ByRef { .. } => {
17831783 // FIXME(oli-obk): implement `deref` for `ConstValue`
17841784 return None ;
17851785 } ,
0 commit comments