##// END OF EJS Templates
rust-hgpath: add `repr(transparent)` to `HgPath`...
Raphaël Gomès -
r49861:a79c3c7c stable draft
parent child Browse files
Show More
@@ -144,15 +144,8 b' impl From<HgPathError> for std::io::Erro'
144 /// On Unix, it's just byte-to-byte conversion. On Windows, it has to be
144 /// On Unix, it's just byte-to-byte conversion. On Windows, it has to be
145 /// decoded from MBCS to WTF-8. If WindowsUTF8Plan is implemented, the source
145 /// decoded from MBCS to WTF-8. If WindowsUTF8Plan is implemented, the source
146 /// character encoding will be determined on a per-repository basis.
146 /// character encoding will be determined on a per-repository basis.
147 //
148 // FIXME: (adapted from a comment in the stdlib)
149 // `HgPath::new()` current implementation relies on `Slice` being
150 // layout-compatible with `[u8]`.
151 // When attribute privacy is implemented, `Slice` should be annotated as
152 // `#[repr(transparent)]`.
153 // Anyway, `Slice` representation and layout are considered implementation
154 // detail, are not documented and must not be relied upon.
155 #[derive(Eq, Ord, PartialEq, PartialOrd, Hash)]
147 #[derive(Eq, Ord, PartialEq, PartialOrd, Hash)]
148 #[repr(transparent)]
156 pub struct HgPath {
149 pub struct HgPath {
157 inner: [u8],
150 inner: [u8],
158 }
151 }
General Comments 0
You need to be logged in to leave comments. Login now