Conversation
|
r? @fee1-dead (rust-highfive has picked a reviewer for you, use r? to override) |
fee1-dead
left a comment
There was a problem hiding this comment.
Thank you very much for the contribution! Could you please write this as a lint? (See rustc-dev-guide) You could also take a look at how clippy implemented this.
This comment has been minimized.
This comment has been minimized.
|
I'm available on Zulip if you need any help. |
|
If done as a late lint I think this could also evaluate constants, for example const A: u32 = 10;
const B: u32 = 0;
fn main() {
for i in A..B {
println!("{i}");
}
} |
|
@rustbot author marking as waiting on author to address comments. |
|
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki |
This comment has been minimized.
This comment has been minimized.
|
@rustbot ready |
|
@rustbot author |
src/test/ui/borrowck/borrowck-for-loop-uninitialized-binding.stderr
Outdated
Show resolved
Hide resolved
|
This is a lint with a lot of room for enhancement. Static value range analysis could be used to reveal empty ranges |
|
I was also wondering about this. Clippy has the lint. However I think it would be nice to just add the @rust-lang/compiler opinions? |
|
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
5fca1a9 to
25580e3
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #102652) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@rustbot modify labels: -A-rustdoc-json |
|
☔ The latest upstream changes (presumably #104809) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@obeis any updates on this? |
|
Closing as this should live in clippy for now. |
Closes #100635