-
Notifications
You must be signed in to change notification settings - Fork 13.4k
unresolved import span is wrong #33464
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
birkenfeld
added a commit
to birkenfeld/rust
that referenced
this issue
May 10, 2016
This span modification is probably leftover from a time when import spans were assigned differently. With this change, error spans for the following are properly reported: ``` use abc::one_el; use abc::{a, bbb, cccccc}; use a_very_long_name::{el, el2}; ``` before (spans only): ``` x.rs:3 use abc::one_el; ^~~ x.rs:4 use abc::{a, bbb, cccccc}; ^~~ x.rs:4 use abc::{a, bbb, cccccc}; ^~~ x.rs:4 use abc::{a, bbb, cccccc}; ^~~ (internal compiler error: unprintable span) (internal compiler error: unprintable span) ``` after: ``` x.rs:3 use abc::one_el; ^~~~~~~~~~~ x.rs:4 use abc::{a, bbb, cccccc}; ^ x.rs:4 use abc::{a, bbb, cccccc}; ^~~ x.rs:4 use abc::{a, bbb, cccccc}; ^~~~~~ x.rs:5 use a_very_long_name::{el, el2}; ^~ x.rs:5 use a_very_long_name::{el, el2}; ^~~ ``` Fixes: rust-lang#33464
bors
added a commit
that referenced
this issue
May 10, 2016
resolve: do not modify span of non-importable name This span modification is probably leftover from a time when import spans were assigned differently. With this change, error spans for the following are properly reported: ``` use abc::one_el; use abc::{a, bbb, cccccc}; use a_very_long_name::{el, el2}; ``` before (spans only): ``` x.rs:3 use abc::one_el; ^~~ x.rs:4 use abc::{a, bbb, cccccc}; ^~~ x.rs:4 use abc::{a, bbb, cccccc}; ^~~ x.rs:4 use abc::{a, bbb, cccccc}; ^~~ (internal compiler error: unprintable span) (internal compiler error: unprintable span) ``` after: ``` x.rs:3 use abc::one_el; ^~~~~~~~~~~ x.rs:4 use abc::{a, bbb, cccccc}; ^ x.rs:4 use abc::{a, bbb, cccccc}; ^~~ x.rs:4 use abc::{a, bbb, cccccc}; ^~~~~~ x.rs:5 use a_very_long_name::{el, el2}; ^~ x.rs:5 use a_very_long_name::{el, el2}; ^~~ ``` Fixes: #33464
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
an arbitrary import of the shape
will give the following errors and spans:
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
The text was updated successfully, but these errors were encountered: