mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-01 00:49:30 +00:00
Auto merge of #9574 - Alexendoo:unused-fixed, r=Jarcho
Remove unused `.fixed` files, only run asm_syntax doctests on x86 Two small changes, removes some unused `.fixed` and makes `clippy_lints` doctests pass on non x86 arches changelog: none
This commit is contained in:
commit
0341198ba1
3 changed files with 4 additions and 60 deletions
|
@ -64,6 +64,7 @@ declare_clippy_lint! {
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(asm)]
|
/// # #![feature(asm)]
|
||||||
|
/// # #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
||||||
/// # unsafe { let ptr = "".as_ptr();
|
/// # unsafe { let ptr = "".as_ptr();
|
||||||
/// # use std::arch::asm;
|
/// # use std::arch::asm;
|
||||||
/// asm!("lea {}, [{}]", lateout(reg) _, in(reg) ptr);
|
/// asm!("lea {}, [{}]", lateout(reg) _, in(reg) ptr);
|
||||||
|
@ -72,6 +73,7 @@ declare_clippy_lint! {
|
||||||
/// Use instead:
|
/// Use instead:
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(asm)]
|
/// # #![feature(asm)]
|
||||||
|
/// # #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
||||||
/// # unsafe { let ptr = "".as_ptr();
|
/// # unsafe { let ptr = "".as_ptr();
|
||||||
/// # use std::arch::asm;
|
/// # use std::arch::asm;
|
||||||
/// asm!("lea ({}), {}", in(reg) ptr, lateout(reg) _, options(att_syntax));
|
/// asm!("lea ({}), {}", in(reg) ptr, lateout(reg) _, options(att_syntax));
|
||||||
|
@ -103,6 +105,7 @@ declare_clippy_lint! {
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(asm)]
|
/// # #![feature(asm)]
|
||||||
|
/// # #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
||||||
/// # unsafe { let ptr = "".as_ptr();
|
/// # unsafe { let ptr = "".as_ptr();
|
||||||
/// # use std::arch::asm;
|
/// # use std::arch::asm;
|
||||||
/// asm!("lea ({}), {}", in(reg) ptr, lateout(reg) _, options(att_syntax));
|
/// asm!("lea ({}), {}", in(reg) ptr, lateout(reg) _, options(att_syntax));
|
||||||
|
@ -111,6 +114,7 @@ declare_clippy_lint! {
|
||||||
/// Use instead:
|
/// Use instead:
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(asm)]
|
/// # #![feature(asm)]
|
||||||
|
/// # #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
||||||
/// # unsafe { let ptr = "".as_ptr();
|
/// # unsafe { let ptr = "".as_ptr();
|
||||||
/// # use std::arch::asm;
|
/// # use std::arch::asm;
|
||||||
/// asm!("lea {}, [{}]", lateout(reg) _, in(reg) ptr);
|
/// asm!("lea {}, [{}]", lateout(reg) _, in(reg) ptr);
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
// revisions: edition2018 edition2021
|
|
||||||
// [edition2018] edition:2018
|
|
||||||
// [edition2021] edition:2021
|
|
||||||
// run-rustfix
|
|
||||||
|
|
||||||
#![warn(clippy::manual_assert)]
|
|
||||||
#![allow(clippy::nonminimal_bool)]
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let a = vec![1, 2, 3];
|
|
||||||
let c = Some(2);
|
|
||||||
if !a.is_empty()
|
|
||||||
&& a.len() == 3
|
|
||||||
&& c.is_some()
|
|
||||||
&& !a.is_empty()
|
|
||||||
&& a.len() == 3
|
|
||||||
&& !a.is_empty()
|
|
||||||
&& a.len() == 3
|
|
||||||
&& !a.is_empty()
|
|
||||||
&& a.len() == 3
|
|
||||||
{
|
|
||||||
panic!("qaqaq{:?}", a);
|
|
||||||
}
|
|
||||||
assert!(a.is_empty(), "qaqaq{:?}", a);
|
|
||||||
assert!(a.is_empty(), "qwqwq");
|
|
||||||
if a.len() == 3 {
|
|
||||||
println!("qwq");
|
|
||||||
println!("qwq");
|
|
||||||
println!("qwq");
|
|
||||||
}
|
|
||||||
if let Some(b) = c {
|
|
||||||
panic!("orz {}", b);
|
|
||||||
}
|
|
||||||
if a.len() == 3 {
|
|
||||||
panic!("qaqaq");
|
|
||||||
} else {
|
|
||||||
println!("qwq");
|
|
||||||
}
|
|
||||||
let b = vec![1, 2, 3];
|
|
||||||
assert!(!b.is_empty(), "panic1");
|
|
||||||
assert!(!(b.is_empty() && a.is_empty()), "panic2");
|
|
||||||
assert!(!(a.is_empty() && !b.is_empty()), "panic3");
|
|
||||||
assert!(!(b.is_empty() || a.is_empty()), "panic4");
|
|
||||||
assert!(!(a.is_empty() || !b.is_empty()), "panic5");
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
// run-rustfix
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
println!("Testing non erroneous option_take_on_temporary");
|
|
||||||
let mut option = Some(1);
|
|
||||||
let _ = Box::new(move || option.take().unwrap());
|
|
||||||
|
|
||||||
println!("Testing non erroneous option_take_on_temporary");
|
|
||||||
let x = Some(3);
|
|
||||||
x.as_ref();
|
|
||||||
|
|
||||||
println!("Testing erroneous option_take_on_temporary");
|
|
||||||
let x = Some(3);
|
|
||||||
x.as_ref();
|
|
||||||
}
|
|
Loading…
Reference in a new issue