@@ -1921,7 +1921,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
19211921 }
19221922 }
19231923 AggregateKind :: Array ( ty) => Ok ( ty) ,
1924- AggregateKind :: Tuple => {
1924+ AggregateKind :: Tuple | AggregateKind :: RawPtr ( .. ) => {
19251925 unreachable ! ( "This should have been covered in check_rvalues" ) ;
19261926 }
19271927 }
@@ -2518,6 +2518,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
25182518 AggregateKind :: Closure ( _, _) => None ,
25192519 AggregateKind :: Coroutine ( _, _) => None ,
25202520 AggregateKind :: CoroutineClosure ( _, _) => None ,
2521+ AggregateKind :: RawPtr ( _, _) => None ,
25212522 } ,
25222523 }
25232524 }
@@ -2539,6 +2540,13 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
25392540 return ;
25402541 }
25412542
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+
25422550 for ( i, operand) in operands. iter_enumerated ( ) {
25432551 let field_ty = match self . aggregate_field_ty ( aggregate_kind, i, location) {
25442552 Ok ( field_ty) => field_ty,
@@ -2757,7 +2765,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
27572765 ) ,
27582766 ) ,
27592767
2760- AggregateKind :: Array ( _) | AggregateKind :: Tuple => {
2768+ AggregateKind :: Array ( _) | AggregateKind :: Tuple | AggregateKind :: RawPtr ( .. ) => {
27612769 ( CRATE_DEF_ID . to_def_id ( ) , ty:: InstantiatedPredicates :: empty ( ) )
27622770 }
27632771 } ;
0 commit comments