2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2014-11-02 13:43:52 -06:00
|
|
|
// Test that coercing bare fn's that return a zero sized type to
|
|
|
|
// a closure doesn't cause an LLVM ERROR
|
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2014-11-02 13:43:52 -06:00
|
|
|
struct Foo;
|
|
|
|
|
2015-03-25 19:06:52 -05:00
|
|
|
fn uint_to_foo(_: usize) -> Foo {
|
2014-11-02 13:43:52 -06:00
|
|
|
Foo
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(unused_must_use)]
|
|
|
|
fn main() {
|
2015-03-03 02:42:26 -06:00
|
|
|
(0..10).map(uint_to_foo);
|
2014-11-02 13:43:52 -06:00
|
|
|
}
|