1
Fork 0

Make missing_copy_implementations more cautious

This commit is contained in:
mejrs 2022-09-28 15:11:27 +02:00
parent c372b14701
commit 4ced370f7c
2 changed files with 68 additions and 1 deletions

View file

@ -0,0 +1,35 @@
// check-pass
#![deny(missing_copy_implementations)]
// Don't recommend implementing Copy on something stateful like an iterator.
pub struct MyIterator {
num: u8,
}
impl Iterator for MyIterator {
type Item = u8;
fn next(&mut self) -> Option<Self::Item> {
todo!()
}
}
pub struct Handle {
inner: *mut (),
}
pub struct Handle2 {
inner: *const (),
}
pub enum MaybeHandle {
Ptr(*mut ()),
}
pub union UnionHandle {
ptr: *mut (),
}
pub struct Array([u8; 2048]);
fn main() {}