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

span misidentified within format! on "consider removing this semicolon" #13428

Closed
pnkfelix opened this issue Apr 9, 2014 · 1 comment · Fixed by #13435
Closed

span misidentified within format! on "consider removing this semicolon" #13428

pnkfelix opened this issue Apr 9, 2014 · 1 comment · Fixed by #13435

Comments

@pnkfelix
Copy link
Member

pnkfelix commented Apr 9, 2014

Code:

#![crate_type="lib"]
pub fn foo() -> ~str {
    format!("Hello {:s}",
            "world");
}

Compilation attempt:

% rustc --version
/Users/fklock/opt/rust-dbg/bin/rustc 0.11-pre (0deb16a 2014-04-07 02:26:37 -0700)
host: x86_64-apple-darwin
% rustc /tmp/f.rs
/tmp/f.rs:3:25: 3:25 note: consider removing this semicolon:
/tmp/f.rs:3     format!("Hello {:s}",
                                    ^
note: in expansion of format_args!
...

It should be pointing at the semi-colon on the next line, not the comma on this line.

@edwardw
Copy link
Contributor

edwardw commented Apr 9, 2014

The note message was introduced in #11482. It doesn't seem to handle this situation properly.

edwardw added a commit to edwardw/rust that referenced this issue Apr 18, 2014
When reporting "consider removing this semicolon" hint message, the
offending semicolon may come from macro call site instead of macro
itself. Using the more appropriate span makes the hint more helpful.

Closes rust-lang#13428.
bors added a commit that referenced this issue Apr 22, 2014
When reporting "consider removing this semicolon" hint message, the
offending semicolon may come from macro call site instead of macro
itself. Using the more appropriate span makes the hint more helpful.

Closes #13428.
compiler-errors pushed a commit to compiler-errors/rust that referenced this issue Oct 26, 2022
fix: Fix formatting requests hanging when r-a is still starting

The reason for that was that we were calculating the crate defmaps of the file we are saving by accident causing us to get stuck waiting on their expensive computation, while we only need the relevant crate id.

Closes rust-lang/rust-analyzer#4054
Closes rust-lang/rust-analyzer#11654
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 a pull request may close this issue.

2 participants