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

Generalize item_span into node_span, which works on more types. #11070

Merged
merged 1 commit into from
Dec 19, 2013

Conversation

ezyang
Copy link
Contributor

@ezyang ezyang commented Dec 19, 2013

On the advice of @huonw, I've just replaced item_span outright.

Signed-off-by: Edward Z. Yang ezyang@cs.stanford.edu

Some(&node_block(block)) => block.span,
Some(&node_struct_ctor(_, item, _)) => item.span,
Some(&node_callee_scope(expr)) => expr.span,
None => fail!("None"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better failure message would be nice here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
bors added a commit that referenced this pull request Dec 19, 2013
On the advice of @huonw, I've just replaced item_span outright.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
@bors bors closed this Dec 19, 2013
@bors bors merged commit 6ad1c8e into rust-lang:master Dec 19, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Aug 17, 2023
[`useless_conversion`]: only lint on paths to fn items and fix FP in macro

Fixes rust-lang#11065 (which is actually two issues: an ICE and a false positive)

It now makes sure that the function call path points to a function-like item (and not e.g. a `const` like in the linked issue), so that calling `TyCtxt::fn_sig` later in the lint does not ICE (fixes rust-lang/rust-clippy#11065 (comment)).
It *also* makes sure that the expression is not part of a macro call (fixes rust-lang/rust-clippy#11065 (comment)). ~~I'm not sure if there's a better way to check this other than to walk the parent expr chain and see if any of them are expansions.~~ (edit: it doesn't do this anymore)

changelog: [`useless_conversion`]: fix ICE when call receiver is a non-fn item
changelog: [`useless_conversion`]: don't lint if argument is a macro argument (fixes a FP)

r? `@llogiq` (reviewed rust-lang#10814, which introduced these issues)
flip1995 pushed a commit to flip1995/rust that referenced this pull request Aug 17, 2023
[`useless_conversion`]: only lint on paths to fn items and fix FP in macro

Fixes rust-lang#11065 (which is actually two issues: an ICE and a false positive)

It now makes sure that the function call path points to a function-like item (and not e.g. a `const` like in the linked issue), so that calling `TyCtxt::fn_sig` later in the lint does not ICE (fixes rust-lang/rust-clippy#11065 (comment)).
It *also* makes sure that the expression is not part of a macro call (fixes rust-lang/rust-clippy#11065 (comment)). ~~I'm not sure if there's a better way to check this other than to walk the parent expr chain and see if any of them are expansions.~~ (edit: it doesn't do this anymore)

changelog: [`useless_conversion`]: fix ICE when call receiver is a non-fn item
changelog: [`useless_conversion`]: don't lint if argument is a macro argument (fixes a FP)

r? `@llogiq` (reviewed rust-lang#10814, which introduced these issues)
flip1995 pushed a commit to flip1995/rust that referenced this pull request Aug 24, 2023
[`useless_conversion`]: only lint on paths to fn items and fix FP in macro

Fixes rust-lang#11065 (which is actually two issues: an ICE and a false positive)

It now makes sure that the function call path points to a function-like item (and not e.g. a `const` like in the linked issue), so that calling `TyCtxt::fn_sig` later in the lint does not ICE (fixes rust-lang/rust-clippy#11065 (comment)).
It *also* makes sure that the expression is not part of a macro call (fixes rust-lang/rust-clippy#11065 (comment)). ~~I'm not sure if there's a better way to check this other than to walk the parent expr chain and see if any of them are expansions.~~ (edit: it doesn't do this anymore)

changelog: [`useless_conversion`]: fix ICE when call receiver is a non-fn item
changelog: [`useless_conversion`]: don't lint if argument is a macro argument (fixes a FP)

r? `@llogiq` (reviewed rust-lang#10814, which introduced these issues)
flip1995 pushed a commit to flip1995/rust that referenced this pull request Aug 24, 2023
[`useless_conversion`]: only lint on paths to fn items and fix FP in macro

Fixes rust-lang#11065 (which is actually two issues: an ICE and a false positive)

It now makes sure that the function call path points to a function-like item (and not e.g. a `const` like in the linked issue), so that calling `TyCtxt::fn_sig` later in the lint does not ICE (fixes rust-lang/rust-clippy#11065 (comment)).
It *also* makes sure that the expression is not part of a macro call (fixes rust-lang/rust-clippy#11065 (comment)). ~~I'm not sure if there's a better way to check this other than to walk the parent expr chain and see if any of them are expansions.~~ (edit: it doesn't do this anymore)

changelog: [`useless_conversion`]: fix ICE when call receiver is a non-fn item
changelog: [`useless_conversion`]: don't lint if argument is a macro argument (fixes a FP)

r? `@llogiq` (reviewed rust-lang#10814, which introduced these issues)
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.

4 participants