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

Inconsistent column numbers when using hard tabs #109537

Closed
pommicket opened this issue Mar 23, 2023 · 1 comment · Fixed by #109548
Closed

Inconsistent column numbers when using hard tabs #109537

pommicket opened this issue Mar 23, 2023 · 1 comment · Fixed by #109548
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@pommicket
Copy link
Contributor

pommicket commented Mar 23, 2023

Code

src/main.rs:

mod m;
fn main() {
	let s = m::S;
	s.method();
}

src/m.rs:

pub struct S;
impl S {
		fn method(&self) {}
}

Current output

error[E0624]: associated function `method` is private
 --> src/main.rs:4:4
  |
4 |     s.method();
  |       ^^^^^^ private associated function
  |
 ::: src/m.rs:3:9
  |
3 |         fn method(&self) {}
  |         ---------------- private associated function defined here

Desired output

error[E0624]: associated function `method` is private
 --> src/main.rs:4:4
  |
4 |     s.method();
  |       ^^^^^^ private associated function
  |
 ::: src/m.rs:3:3
  |
3 |         fn method(&self) {}
  |         ---------------- private associated function defined here

Rationale and extra context

for the error in main.rs, rust gives the column number as a "character index" (i.e. the error is located at the 4th character in the line) which i think is the intended behavior, but for the reference to m.rs, it seems to be treating a tab as 4 columns

Other cases

No response

Anything else?

No response

@pommicket pommicket added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 23, 2023
@pommicket
Copy link
Contributor Author

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant