mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
36 lines
517 B
Rust
36 lines
517 B
Rust
// 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() {}
|