Skip to content

Span for deprecation warnings for method calls is too large #17337

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

Closed
dotdash opened this issue Sep 17, 2014 · 1 comment · Fixed by #17215
Closed

Span for deprecation warnings for method calls is too large #17337

dotdash opened this issue Sep 17, 2014 · 1 comment · Fixed by #17215
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@dotdash
Copy link
Contributor

dotdash commented Sep 17, 2014

The warnings currently look like this:

src/racer/matchers.rs:43:23: 43:109 warning: use of deprecated item: use into_iter, #[warn(deprecated)] on by default
src/racer/matchers.rs:43     let it = it.chain(match_fn(src, blobstart, blobend, searchstr, filepath, search_type, local).move_iter());
                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The span includes the expression representing the object on which the method is called. That's somewhat annoying, because e.g. vim will place the cursor at the first letter of match_fn in the above example, instead of the first letter of move_iter. It also tends quite confusing, when there's a multi-line expression (e.g. one with a match in it), where the actual method call is a few lines down from where the span begins.

@huonw huonw added the A-diagnostics Area: Messages for errors, warnings, and lints label Sep 17, 2014
@ftxqxd
Copy link
Contributor

ftxqxd commented Sep 17, 2014

I’m probably going to fix this as part of #17215.

ftxqxd added a commit to ftxqxd/rust that referenced this issue Sep 22, 2014
bors added a commit that referenced this issue Sep 22, 2014
This updates the `unused` lint group to include more lints, updates the `non_snake_case` lint to give better suggestions, adds a note explaining why a lifetime cannot be elided, and tweaks various error messages. This also updates the `non_uppercase_statics` lint to be warn-by-default to match the other naming lints. For statics, this lint is particularly useful, because a non-uppercase static can easily collide with a pattern binding, resulting in very confusing errors.

Closes #15914.
Closes #15657.
Closes #17337.
ftxqxd added a commit to ftxqxd/rust that referenced this issue Oct 3, 2014
lnicola pushed a commit to lnicola/rust that referenced this issue Jun 23, 2024
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants