@@ -1921,7 +1921,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1921
1921
}
1922
1922
}
1923
1923
AggregateKind :: Array ( ty) => Ok ( ty) ,
1924
- AggregateKind :: Tuple => {
1924
+ AggregateKind :: Tuple | AggregateKind :: RawPtr ( .. ) => {
1925
1925
unreachable ! ( "This should have been covered in check_rvalues" ) ;
1926
1926
}
1927
1927
}
@@ -2518,6 +2518,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2518
2518
AggregateKind :: Closure ( _, _) => None ,
2519
2519
AggregateKind :: Coroutine ( _, _) => None ,
2520
2520
AggregateKind :: CoroutineClosure ( _, _) => None ,
2521
+ AggregateKind :: RawPtr ( _, _) => None ,
2521
2522
} ,
2522
2523
}
2523
2524
}
@@ -2539,6 +2540,13 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2539
2540
return ;
2540
2541
}
2541
2542
2543
+ if let AggregateKind :: RawPtr ( ..) = aggregate_kind {
2544
+ // raw pointer rvalues are checked in the MIR validator,
2545
+ // and since they only deal in things that have no lifetimes,
2546
+ // there's nothing that needs checking here.
2547
+ return ;
2548
+ }
2549
+
2542
2550
for ( i, operand) in operands. iter_enumerated ( ) {
2543
2551
let field_ty = match self . aggregate_field_ty ( aggregate_kind, i, location) {
2544
2552
Ok ( field_ty) => field_ty,
@@ -2757,7 +2765,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2757
2765
) ,
2758
2766
) ,
2759
2767
2760
- AggregateKind :: Array ( _) | AggregateKind :: Tuple => {
2768
+ AggregateKind :: Array ( _) | AggregateKind :: Tuple | AggregateKind :: RawPtr ( .. ) => {
2761
2769
( CRATE_DEF_ID . to_def_id ( ) , ty:: InstantiatedPredicates :: empty ( ) )
2762
2770
}
2763
2771
} ;
0 commit comments