Auto merge of #34357 - tbu-:pr_exact_size_is_empty, r=brson
Add `is_empty` function to `ExactSizeIterator` All other types implementing a `len` functions have `is_empty` already.
This commit is contained in:
commit
bbfcb471db
2 changed files with 32 additions and 5 deletions
|
|
@ -18,7 +18,8 @@ fn foo<F>(f: F) where F: FnMut(Foo) {}
|
|||
fn main() {
|
||||
foo(|s| s.is_empty());
|
||||
//~^ ERROR no method named `is_empty` found
|
||||
//~^^ HELP #1: `core::slice::SliceExt`
|
||||
//~^^^ HELP #2: `core::str::StrExt`
|
||||
//~^^^^ HELP items from traits can only be used if the trait is implemented and in scope; the following traits define an item `is_empty`, perhaps you need to implement one of them:
|
||||
//~^^ HELP #1: `std::iter::ExactSizeIterator`
|
||||
//~^^^ HELP #2: `core::slice::SliceExt`
|
||||
//~^^^^ HELP #3: `core::str::StrExt`
|
||||
//~^^^^^ HELP items from traits can only be used if the trait is implemented and in scope; the following traits define an item `is_empty`, perhaps you need to implement one of them:
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue