Closed
Description
// main.rs
#[macro_use]
mod other;
fn main() {
let_var!(foo);
}
// other.rs
macro_rules! let_var {
($name:ident) => (
let $name;
)
}
Results in:
error[E0282]: type annotations needed
--> main.rs:5:14
|
3 | |
| | ^
| |_________________|
| |_________________cannot infer type for `_`
| consider giving `foo` a type
4 | fn main() {
5 | let_var!(foo);
| _____---------^----
| |_____|________|
| | |
| | in this macro invocation
The arrow in the first snippet is pointing to a blank snippet (it seems to the end of the line containing the module import). I'm not sure what the ideal case here is, but this seems a little confusing.