File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
src/librustc_data_structures Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,6 @@ impl<T: Idx> rustc_serialize::Decodable for IdxSetBuf<T> {
59
59
60
60
// pnkfelix wants to have this be `IdxSet<T>([Word]) and then pass
61
61
// around `&mut IdxSet<T>` or `&IdxSet<T>`.
62
- //
63
- // WARNING: Mapping a `&IdxSetBuf<T>` to `&IdxSet<T>` (at least today)
64
- // requires a transmute relying on representation guarantees that may
65
- // not hold in the future.
66
62
67
63
/// Represents a set (or packed family of sets), of some element type
68
64
/// E, where each E is identified by some unique index type `T`.
@@ -134,11 +130,11 @@ impl<T: Idx> IdxSetBuf<T> {
134
130
135
131
impl < T : Idx > IdxSet < T > {
136
132
unsafe fn from_slice ( s : & [ Word ] ) -> & Self {
137
- mem :: transmute ( s ) // (see above WARNING )
133
+ & * ( s as * const [ Word ] as * const Self )
138
134
}
139
135
140
136
unsafe fn from_slice_mut ( s : & mut [ Word ] ) -> & mut Self {
141
- mem :: transmute ( s ) // (see above WARNING )
137
+ & mut * ( s as * mut [ Word ] as * mut Self )
142
138
}
143
139
}
144
140
You can’t perform that action at this time.
0 commit comments