mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 13:43:17 +00:00
parent
cda7547394
commit
b333645971
3 changed files with 37 additions and 1 deletions
|
@ -260,4 +260,14 @@ fn issue9192() -> i32 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn issue9503(x: usize) -> isize {
|
||||||
|
unsafe {
|
||||||
|
if x > 12 {
|
||||||
|
*(x as *const isize)
|
||||||
|
} else {
|
||||||
|
!*(x as *const isize)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -260,4 +260,14 @@ fn issue9192() -> i32 {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn issue9503(x: usize) -> isize {
|
||||||
|
unsafe {
|
||||||
|
if x > 12 {
|
||||||
|
return *(x as *const isize);
|
||||||
|
} else {
|
||||||
|
return !*(x as *const isize);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -335,5 +335,21 @@ LL | return 0;
|
||||||
|
|
|
|
||||||
= help: remove `return`
|
= help: remove `return`
|
||||||
|
|
||||||
error: aborting due to 42 previous errors
|
error: unneeded `return` statement
|
||||||
|
--> $DIR/needless_return.rs:266:13
|
||||||
|
|
|
||||||
|
LL | return *(x as *const isize);
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
= help: remove `return`
|
||||||
|
|
||||||
|
error: unneeded `return` statement
|
||||||
|
--> $DIR/needless_return.rs:268:13
|
||||||
|
|
|
||||||
|
LL | return !*(x as *const isize);
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
= help: remove `return`
|
||||||
|
|
||||||
|
error: aborting due to 44 previous errors
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue