File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -179,8 +179,8 @@ impl<'tcx> NonCopyConst<'tcx> {
179179 }
180180
181181 fn is_value_unfrozen_raw_inner ( cx : & LateContext < ' tcx > , val : ty:: ValTree < ' tcx > , ty : Ty < ' tcx > ) -> bool {
182- // No branch that we check (yet) should continue if val isn't a ValTree::Branch
183- let ty :: ValTree :: Branch ( val) = val else { return false } ;
182+ // No branch that we check (yet) should continue if val isn't a branch
183+ let Some ( val) = val. try_to_branch ( ) else { return false } ;
184184 match * ty. kind ( ) {
185185 // the fact that we have to dig into every structs to search enums
186186 // leads us to the point checking `UnsafeCell` directly is the only option.
@@ -192,9 +192,10 @@ impl<'tcx> NonCopyConst<'tcx> {
192192 . iter ( )
193193 . any ( |field| Self :: is_value_unfrozen_raw_inner ( cx, * field, ty) ) ,
194194 ty:: Adt ( def, args) if def. is_enum ( ) => {
195- let Some ( ( & ty :: ValTree :: Leaf ( variant_index ) , fields) ) = val. split_first ( ) else {
195+ let Some ( ( & variant_valtree , fields) ) = val. split_first ( ) else {
196196 return false ;
197197 } ;
198+ let variant_index = variant_valtree. unwrap_leaf ( ) ;
198199 let variant_index = VariantIdx :: from_u32 ( variant_index. to_u32 ( ) ) ;
199200 fields
200201 . iter ( )
You can’t perform that action at this time.
0 commit comments