Skip to content

Commit 6b524b3

Browse files
committed
Don't make opaque types like FILE and DIR copyable.
Also, locale_t is a typedef for a pointer to an opaque struct, so represent it that way explicitly.
1 parent 49c0dc9 commit 6b524b3

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

src/wasi.rs

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,30 +68,17 @@ pub type __wasi_userdata_t = u64;
6868
pub type __wasi_whence_t = u8;
6969
pub type __wasi_preopentype_t = u8;
7070

71+
#[allow(missing_copy_implementations)]
7172
#[cfg_attr(feature = "extra_traits", derive(Debug))]
7273
pub enum FILE {}
73-
impl ::Copy for FILE {}
74-
impl ::Clone for FILE {
75-
fn clone(&self) -> FILE {
76-
*self
77-
}
78-
}
74+
#[allow(missing_copy_implementations)]
7975
#[cfg_attr(feature = "extra_traits", derive(Debug))]
8076
pub enum DIR {}
81-
impl ::Copy for DIR {}
82-
impl ::Clone for DIR {
83-
fn clone(&self) -> DIR {
84-
*self
85-
}
86-
}
77+
#[allow(missing_copy_implementations)]
8778
#[cfg_attr(feature = "extra_traits", derive(Debug))]
88-
pub enum locale_t {}
89-
impl ::Copy for locale_t {}
90-
impl ::Clone for locale_t {
91-
fn clone(&self) -> locale_t {
92-
*self
93-
}
94-
}
79+
pub enum __locale_struct {}
80+
81+
pub type locale_t = *mut __locale_struct;
9582

9683
s! {
9784
#[repr(align(8))]

0 commit comments

Comments
 (0)