These are chat archives for rust-lang/rust

Jan 2017
Thomas Koehler
Jan 22 2017 11:53
is this a bug ?
Sergey Noskov
Jan 22 2017 11:56
it doesn't seem so: you are returning values of different types from if/else branches, it's not possible.
In Rust, each function gets a unique type, the same way each closure has a unique type.
But you can convert function to a function pointer.
Thomas Koehler
Jan 22 2017 12:31
ok thanks, I thought the conversion would be infered, it works without the tuple and with explicit type