2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2014-11-02 14:43:52 -05: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 13:13:15 -07:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2014-11-02 14:43:52 -05:00
|
|
|
struct Foo;
|
|
|
|
|
2015-03-25 17:06:52 -07:00
|
|
|
fn uint_to_foo(_: usize) -> Foo {
|
2014-11-02 14:43:52 -05:00
|
|
|
Foo
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(unused_must_use)]
|
|
|
|
fn main() {
|
2015-03-03 10:42:26 +02:00
|
|
|
(0..10).map(uint_to_foo);
|
2014-11-02 14:43:52 -05:00
|
|
|
}
|