@@ -34,7 +34,7 @@ pub fn check_validity_requirement<'tcx>(
3434
3535 let layout_cx = LayoutCx :: new ( tcx, input. typing_env ) ;
3636 if kind == ValidityRequirement :: Uninit || tcx. sess . opts . unstable_opts . strict_init_checks {
37- check_validity_requirement_strict ( layout, & layout_cx, kind)
37+ Ok ( check_validity_requirement_strict ( layout, & layout_cx, kind) )
3838 } else {
3939 check_validity_requirement_lax ( layout, & layout_cx, kind)
4040 }
@@ -46,7 +46,7 @@ fn check_validity_requirement_strict<'tcx>(
4646 ty : TyAndLayout < ' tcx > ,
4747 cx : & LayoutCx < ' tcx > ,
4848 kind : ValidityRequirement ,
49- ) -> Result < bool , & ' tcx LayoutError < ' tcx > > {
49+ ) -> bool {
5050 let machine = CompileTimeMachine :: new ( CanAccessMutGlobal :: No , CheckAlignment :: Error ) ;
5151
5252 let mut cx = InterpCx :: new ( cx. tcx ( ) , rustc_span:: DUMMY_SP , cx. typing_env , machine) ;
@@ -69,14 +69,13 @@ fn check_validity_requirement_strict<'tcx>(
6969 // due to this.
7070 // The value we are validating is temporary and discarded at the end of this function, so
7171 // there is no point in reseting provenance and padding.
72- Ok ( cx
73- . validate_operand (
74- & allocated. into ( ) ,
75- /*recursive*/ false ,
76- /*reset_provenance_and_padding*/ false ,
77- )
78- . discard_err ( )
79- . is_some ( ) )
72+ cx. validate_operand (
73+ & allocated. into ( ) ,
74+ /*recursive*/ false ,
75+ /*reset_provenance_and_padding*/ false ,
76+ )
77+ . discard_err ( )
78+ . is_some ( )
8079}
8180
8281/// Implements the 'lax' (default) version of the [`check_validity_requirement`] checks; see that
0 commit comments