diff options
| author | Brian Koropoff <bkoropoff@gmail.com> | 2014-11-02 00:16:38 -0700 |
|---|---|---|
| committer | Brian Koropoff <bkoropoff@gmail.com> | 2014-11-02 09:59:10 -0800 |
| commit | 28f70d34400959cd2e0095d019b53dba244b900b (patch) | |
| tree | f1fd6e5d5f49f4964e1ba769c87c4890527ed2eb /src | |
| parent | 3327ecca422046699315122345c6c050ab73804b (diff) | |
| download | rust-28f70d34400959cd2e0095d019b53dba244b900b.tar.gz rust-28f70d34400959cd2e0095d019b53dba244b900b.zip | |
Fix decoding of unboxed closure kinds
Closes #18378. Note that cross-crate unboxed closures are still unimplemented and will fail to work currently.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/middle/astencode.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs index 3d2bd763a14..692a815c63c 100644 --- a/src/librustc/middle/astencode.rs +++ b/src/librustc/middle/astencode.rs @@ -1756,12 +1756,14 @@ impl<'a> rbml_decoder_decoder_helpers for reader::Decoder<'a> { "FnMutUnboxedClosureKind", "FnOnceUnboxedClosureKind" ]; - let kind = self.read_enum_variant(variants, |_, i| { - Ok(match i { - 0 => ty::FnUnboxedClosureKind, - 1 => ty::FnMutUnboxedClosureKind, - 2 => ty::FnOnceUnboxedClosureKind, - _ => panic!("bad enum variant for ty::UnboxedClosureKind"), + let kind = self.read_enum("UnboxedClosureKind", |this| { + this.read_enum_variant(variants, |_, i| { + Ok(match i { + 0 => ty::FnUnboxedClosureKind, + 1 => ty::FnMutUnboxedClosureKind, + 2 => ty::FnOnceUnboxedClosureKind, + _ => panic!("bad enum variant for ty::UnboxedClosureKind"), + }) }) }).unwrap(); ty::UnboxedClosure { |
