We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0cf86c2 + 3019074 commit df08fe7Copy full SHA for df08fe7
compiler/rustc_mir/src/const_eval/mod.rs
@@ -50,7 +50,7 @@ pub(crate) fn destructure_const<'tcx>(
50
let (field_count, variant, down) = match val.ty.kind() {
51
ty::Array(_, len) => (usize::try_from(len.eval_usize(tcx, param_env)).unwrap(), None, op),
52
ty::Adt(def, _) if def.variants.is_empty() => {
53
- return mir::DestructuredConst { variant: None, fields: tcx.arena.alloc_slice(&[]) };
+ return mir::DestructuredConst { variant: None, fields: &[] };
54
}
55
ty::Adt(def, _) => {
56
let variant = ecx.read_discriminant(op).unwrap().1;
0 commit comments