Fix len_zero ICE
This commit is contained in:
parent
009f5aaf83
commit
7757c893ef
3 changed files with 28 additions and 19 deletions
|
|
@ -182,3 +182,10 @@ fn test_slice(b: &[u8]) {
|
|||
if b.len() != 0 {
|
||||
}
|
||||
}
|
||||
|
||||
// this used to ICE
|
||||
pub trait Foo: Sized {}
|
||||
|
||||
pub trait DependsOnFoo: Foo {
|
||||
fn len(&mut self) -> usize;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,5 +86,13 @@ error: length comparison to zero
|
|||
182 | if b.len() != 0 {
|
||||
| ^^^^^^^^^^^^ help: using `is_empty` is more concise: `!b.is_empty()`
|
||||
|
||||
error: aborting due to 11 previous errors
|
||||
error: trait `DependsOnFoo` has a `len` method but no (possibly inherited) `is_empty` method
|
||||
--> $DIR/len_zero.rs:189:1
|
||||
|
|
||||
189 | / pub trait DependsOnFoo: Foo {
|
||||
190 | | fn len(&mut self) -> usize;
|
||||
191 | | }
|
||||
| |_^
|
||||
|
||||
error: aborting due to 12 previous errors
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue