-
Notifications
You must be signed in to change notification settings - Fork 13.3k
suggest is_empty
for collections when casting to bool
#106896
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
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
This is definitely possible -- see |
9f915fb
to
0229535
Compare
@compiler-errors I've applied your suggestions. Now we show this error if we can deref to a slice or |
0229535
to
42910a7
Compare
This comment has been minimized.
This comment has been minimized.
42910a7
to
92ced4a
Compare
@compiler-errors Forgot to re |
r? @compiler-errors @bors r+ rollup |
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#106888 (Add tidy check to ensure that rustdoc GUI tests start with a small description) - rust-lang#106896 (suggest `is_empty` for collections when casting to `bool`) - rust-lang#106900 (Fix regression in `unused_braces` with macros) - rust-lang#106906 (remove redundant clones) - rust-lang#106909 (Only suggest adding type param if path being resolved was a type) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #106883
Matches on slices,
String
andstr
. It would be nice to do this with something likeDeref<Target=str>
as well, but AFAIK it's not possible in this part of the compiler.