mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
Add regression test
This commit is contained in:
parent
3d44ad2e32
commit
46ee6b1840
1 changed files with 18 additions and 0 deletions
18
tests/ui/crashes/ice-5223.rs
Normal file
18
tests/ui/crashes/ice-5223.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
// Regression test for #5233
|
||||
|
||||
#![feature(const_generics)]
|
||||
#![allow(incomplete_features)]
|
||||
#![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() {}
|
Loading…
Reference in a new issue