rust-clippy/tests/ui/crashes/ice-5223.rs

16 lines
362 B
Rust
Raw Normal View History

2020-03-03 12:39:45 +00:00
// Regression test for #5233
#![warn(clippy::indexing_slicing, clippy::iter_cloned_collect)]
pub struct KotomineArray<T, const N: usize> {
arr: [T; N],
}
impl<T: std::clone::Clone, const N: usize> KotomineArray<T, N> {
pub fn ice(self) {
let _ = self.arr[..];
let _ = self.arr.iter().cloned().collect::<Vec<_>>();
}
}
fn main() {}