Skip to content

unresolved import span is wrong #33464

@oli-obk

Description

@oli-obk

an arbitrary import of the shape

use abc::{a, bbbbbbbbbbb, cccccccc};

will give the following errors and spans:

<anon>:1:11: 1:14 error: unresolved import `abc::a`. Maybe a missing `extern crate abc`? [E0432]
<anon>:1 use abc::{a, bbbbbbbbbbb, cccccccc};
                   ^~~
<anon>:1:11: 1:14 help: see the detailed explanation for E0432
<anon>:1:14: 1:17 error: unresolved import `abc::bbbbbbbbbbb`. Maybe a missing `extern crate abc`? [E0432]
<anon>:1 use abc::{a, bbbbbbbbbbb, cccccccc};
                      ^~~
<anon>:1:14: 1:17 help: see the detailed explanation for E0432
<anon>:1:27: 1:30 error: unresolved import `abc::cccccccc`. Maybe a missing `extern crate abc`? [E0432]
<anon>:1 use abc::{a, bbbbbbbbbbb, cccccccc};
                                   ^~~

The span is always as long as the crate, but starts at the imported element

This can also be used to create an unprintable span:

http://is.gd/83hpg7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions