mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 14:38:46 +00:00
Move test for issue 5579 under tests/ui/crashes
This commit is contained in:
parent
e4cd8e7961
commit
8d1029d3ca
2 changed files with 17 additions and 21 deletions
|
@ -78,24 +78,3 @@ fn main() {
|
|||
|
||||
assert!(x.is_ok(), "{:?}", x.unwrap_err()); // ok, it's a common test pattern
|
||||
}
|
||||
|
||||
mod issue_5579 {
|
||||
trait IsErr {
|
||||
fn is_err(&self, err: &str) -> bool;
|
||||
}
|
||||
|
||||
impl<T> IsErr for Option<T> {
|
||||
fn is_err(&self, _err: &str) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
fn boom() {
|
||||
let t = Some(1);
|
||||
|
||||
if t.is_err("") {
|
||||
t.unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
17
tests/ui/crashes/ice-5579.rs
Normal file
17
tests/ui/crashes/ice-5579.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
trait IsErr {
|
||||
fn is_err(&self, err: &str) -> bool;
|
||||
}
|
||||
|
||||
impl<T> IsErr for Option<T> {
|
||||
fn is_err(&self, _err: &str) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let t = Some(1);
|
||||
|
||||
if t.is_err("") {
|
||||
t.unwrap();
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue