[useless_conversion]: fix FP in macro and add test
This commit is contained in:
parent
34348f72f4
commit
2820d980cb
2 changed files with 33 additions and 1 deletions
19
tests/ui/crashes/ice-11065.rs
Normal file
19
tests/ui/crashes/ice-11065.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#![warn(clippy::useless_conversion)]
|
||||
|
||||
use std::iter::FromIterator;
|
||||
use std::option::IntoIter as OptionIter;
|
||||
|
||||
fn eq<T: Eq>(a: T, b: T) -> bool {
|
||||
a == b
|
||||
}
|
||||
|
||||
macro_rules! tests {
|
||||
($($expr:expr, $ty:ty, ($($test:expr),*);)+) => (pub fn main() {$({
|
||||
const C: $ty = $expr;
|
||||
assert!(eq(C($($test),*), $expr($($test),*)));
|
||||
})+})
|
||||
}
|
||||
|
||||
tests! {
|
||||
FromIterator::from_iter, fn(OptionIter<i32>) -> Vec<i32>, (Some(5).into_iter());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue