Skip to content

rustc: Improve span for error about using a method as a field. #14905

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
wants to merge 1 commit into from

Conversation

Ryman
Copy link
Contributor

@Ryman Ryman commented Jun 14, 2014

Only highlight the method name in the span.

@alexcrichton
Copy link
Member

Instead of manufacturing a span, perhaps ExprField could store SpannedIdent instead?

@Ryman
Copy link
Contributor Author

Ryman commented Jun 16, 2014

@alexcrichton Probably is a cleaner way to do it, compare latest commit.

@alexcrichton
Copy link
Member

Looks good to me! With a squash I think this is good to go.

libsyntax: ExprField now contains a SpannedIdent rather than Ident.

[breaking-change]
@Ryman
Copy link
Contributor Author

Ryman commented Jun 16, 2014

@alexcrichton r?

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2023
flip1995 pushed a commit to flip1995/rust that referenced this pull request May 31, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
This lint was previously written very clumsily, not short-circuiting and
doing a lot of unnecessary work.

Now it makes sure to do the cheaper functions earlier and in general, is
just smarter.
(I specifically focused on minimizing binder instantiation

Sadly, I'm not finding any relevant result in a benchmark. Still with
the LLVM coverage instruments, the expensive bits are called lots of
less times (The binder instantiation that I care about is reduced from
95k to 10k throughout our test suite).

changelog:[`unit_return_expecting_ord`]: Optimize the lint
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.

None yet

2 participants