File tree 1 file changed +4
-3
lines changed
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> {
179
179
}
180
180
181
181
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 } ;
184
184
match * ty. kind ( ) {
185
185
// the fact that we have to dig into every structs to search enums
186
186
// leads us to the point checking `UnsafeCell` directly is the only option.
@@ -192,9 +192,10 @@ impl<'tcx> NonCopyConst<'tcx> {
192
192
. iter ( )
193
193
. any ( |field| Self :: is_value_unfrozen_raw_inner ( cx, * field, ty) ) ,
194
194
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 {
196
196
return false ;
197
197
} ;
198
+ let variant_index = variant_valtree. unwrap_leaf ( ) ;
198
199
let variant_index = VariantIdx :: from_u32 ( variant_index. to_u32 ( ) ) ;
199
200
fields
200
201
. iter ( )
You can’t perform that action at this time.
0 commit comments