mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
Fix decoding of unboxed closure kinds
Closes #18378. Note that cross-crate unboxed closures are still unimplemented and will fail to work currently.
This commit is contained in:
parent
3327ecca42
commit
28f70d3440
@ -1756,12 +1756,14 @@ impl<'a> rbml_decoder_decoder_helpers for reader::Decoder<'a> {
|
|||||||
"FnMutUnboxedClosureKind",
|
"FnMutUnboxedClosureKind",
|
||||||
"FnOnceUnboxedClosureKind"
|
"FnOnceUnboxedClosureKind"
|
||||||
];
|
];
|
||||||
let kind = self.read_enum_variant(variants, |_, i| {
|
let kind = self.read_enum("UnboxedClosureKind", |this| {
|
||||||
Ok(match i {
|
this.read_enum_variant(variants, |_, i| {
|
||||||
0 => ty::FnUnboxedClosureKind,
|
Ok(match i {
|
||||||
1 => ty::FnMutUnboxedClosureKind,
|
0 => ty::FnUnboxedClosureKind,
|
||||||
2 => ty::FnOnceUnboxedClosureKind,
|
1 => ty::FnMutUnboxedClosureKind,
|
||||||
_ => panic!("bad enum variant for ty::UnboxedClosureKind"),
|
2 => ty::FnOnceUnboxedClosureKind,
|
||||||
|
_ => panic!("bad enum variant for ty::UnboxedClosureKind"),
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}).unwrap();
|
}).unwrap();
|
||||||
ty::UnboxedClosure {
|
ty::UnboxedClosure {
|
||||||
|
Loading…
Reference in New Issue
Block a user