@@ -34,7 +34,7 @@ pub fn check_validity_requirement<'tcx>(
34
34
35
35
let layout_cx = LayoutCx :: new ( tcx, input. typing_env ) ;
36
36
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) )
38
38
} else {
39
39
check_validity_requirement_lax ( layout, & layout_cx, kind)
40
40
}
@@ -46,7 +46,7 @@ fn check_validity_requirement_strict<'tcx>(
46
46
ty : TyAndLayout < ' tcx > ,
47
47
cx : & LayoutCx < ' tcx > ,
48
48
kind : ValidityRequirement ,
49
- ) -> Result < bool , & ' tcx LayoutError < ' tcx > > {
49
+ ) -> bool {
50
50
let machine = CompileTimeMachine :: new ( CanAccessMutGlobal :: No , CheckAlignment :: Error ) ;
51
51
52
52
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>(
69
69
// due to this.
70
70
// The value we are validating is temporary and discarded at the end of this function, so
71
71
// 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 ( )
80
79
}
81
80
82
81
/// Implements the 'lax' (default) version of the [`check_validity_requirement`] checks; see that
0 commit comments