From: Brian Koropoff Date: Sat, 4 Oct 2014 03:07:43 +0000 (-0700) Subject: Add regression test for issue #17737 X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=404db68da40130b0fa45053ea3a894cd0dd74a0e;p=rust.git Add regression test for issue #17737 --- diff --git a/src/test/run-pass/issue-17737.rs b/src/test/run-pass/issue-17737.rs new file mode 100644 index 00000000000..ec0cb488c68 --- /dev/null +++ b/src/test/run-pass/issue-17737.rs @@ -0,0 +1,24 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(unboxed_closures)] + +// Test generating type visitor glue for unboxed closures + +extern crate debug; + +fn main() { + let expected = "fn(); fn(uint, uint) -> uint; fn() -> !"; + let result = format!("{:?}; {:?}; {:?}", + |:| {}, + |&: x: uint, y: uint| { x + y }, + |&mut:| -> ! { fail!() }); + assert_eq!(expected, result.as_slice()); +}