Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustc: Fix position of diagnostic highlight lines #1219

Closed
wants to merge 1 commit into from

Conversation

lht
Copy link
Contributor

@lht lht commented Nov 24, 2011

Diagnostic highlight lines are incorrect placed when the related line
number is 10, 100, etc.

For example, diagnostic highlight is misplaced when compiling the following code.

use std;                      // 1
                              // 2
fn main() {                   // 3
    import std::vec;          // 4
                              // 5
                              // 6
                              // 7
    {                         // 8
                              // 9
        import std::sha;      // 10
    }                         // 11
}
import-in-block.rs:10:8: 10:23 error: unresolved import: sha
import-in-block.rs:10         import std::sha;      // 10
                             ^~~~~~~~~~~~~~~

The root cause is line number is treated as 0 based (should be 1 based)
when calculating offset of line number digits.

Diagnostic highlight lines are incorrect placed when the related line
number is 10, 100, etc.

The root cause is line number are treated as 0 based (should be 1 based)
when calculating offset of line number digits.
@marijnh
Copy link
Contributor

marijnh commented Nov 24, 2011

Integrated. Thank you.

@marijnh marijnh closed this Nov 24, 2011
bjorn3 added a commit to bjorn3/rust that referenced this pull request Jan 24, 2023
coastalwhite pushed a commit to coastalwhite/rust that referenced this pull request Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants