Skip to content

External macro invocation errors print internals but not invocation site #19243

Closed
@arielb1

Description

@arielb1

The code

fn main() {}
// ...
// lots of code
// ...
fn some_random_function() {
    // lots of code here
    let unused = vec![];
    // even more code
}

gives an error message which does not even hint about the error's location:

<std macros>:5:9: 5:22 error: unable to infer enough type information about `_`; type annotations required
<std macros>:5         xs.into_vec()
                       ^~~~~~~~~~~~~
<std macros>:1:1: 8:2 note: in expansion of vec!
<anon>:4:5: 4:12 note: expansion site

Which makes finding the offending statement require quite a bit of effort.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions