|
1 | 1 | // Take a look at the license at the top of the repository in the LICENSE file. |
2 | 2 |
|
| 3 | +#[cfg(feature = "use_glib")] |
| 4 | +use std::marker::PhantomData; |
3 | 5 | use std::{convert::TryFrom, fmt, ops::Deref, ptr}; |
4 | 6 |
|
5 | 7 | #[cfg(feature = "use_glib")] |
@@ -64,11 +66,11 @@ impl XCBConnection { |
64 | 66 |
|
65 | 67 | #[cfg(feature = "use_glib")] |
66 | 68 | impl<'a> ToGlibPtr<'a, *mut ffi::xcb_connection_t> for &'a XCBConnection { |
67 | | - type Storage = &'a XCBConnection; |
| 69 | + type Storage = PhantomData<&'a XCBConnection>; |
68 | 70 |
|
69 | 71 | #[inline] |
70 | 72 | fn to_glib_none(&self) -> Stash<'a, *mut ffi::xcb_connection_t, &'a XCBConnection> { |
71 | | - Stash(self.to_raw_none(), *self) |
| 73 | + Stash(self.to_raw_none(), PhantomData) |
72 | 74 | } |
73 | 75 | } |
74 | 76 |
|
@@ -137,13 +139,13 @@ impl XCBRenderPictFormInfo { |
137 | 139 |
|
138 | 140 | #[cfg(feature = "use_glib")] |
139 | 141 | impl<'a> ToGlibPtr<'a, *mut ffi::xcb_render_pictforminfo_t> for &'a XCBRenderPictFormInfo { |
140 | | - type Storage = &'a XCBRenderPictFormInfo; |
| 142 | + type Storage = PhantomData<&'a XCBRenderPictFormInfo>; |
141 | 143 |
|
142 | 144 | #[inline] |
143 | 145 | fn to_glib_none( |
144 | 146 | &self, |
145 | 147 | ) -> Stash<'a, *mut ffi::xcb_render_pictforminfo_t, &'a XCBRenderPictFormInfo> { |
146 | | - Stash(self.to_raw_none(), *self) |
| 148 | + Stash(self.to_raw_none(), PhantomData) |
147 | 149 | } |
148 | 150 | } |
149 | 151 |
|
@@ -212,11 +214,11 @@ impl XCBScreen { |
212 | 214 |
|
213 | 215 | #[cfg(feature = "use_glib")] |
214 | 216 | impl<'a> ToGlibPtr<'a, *mut ffi::xcb_screen_t> for &'a XCBScreen { |
215 | | - type Storage = &'a XCBScreen; |
| 217 | + type Storage = PhantomData<&'a XCBScreen>; |
216 | 218 |
|
217 | 219 | #[inline] |
218 | 220 | fn to_glib_none(&self) -> Stash<'a, *mut ffi::xcb_screen_t, &'a XCBScreen> { |
219 | | - Stash(self.to_raw_none(), *self) |
| 221 | + Stash(self.to_raw_none(), PhantomData) |
220 | 222 | } |
221 | 223 | } |
222 | 224 |
|
@@ -374,11 +376,11 @@ impl XCBVisualType { |
374 | 376 |
|
375 | 377 | #[cfg(feature = "use_glib")] |
376 | 378 | impl<'a> ToGlibPtr<'a, *mut ffi::xcb_visualtype_t> for &'a XCBVisualType { |
377 | | - type Storage = &'a XCBVisualType; |
| 379 | + type Storage = PhantomData<&'a XCBVisualType>; |
378 | 380 |
|
379 | 381 | #[inline] |
380 | 382 | fn to_glib_none(&self) -> Stash<'a, *mut ffi::xcb_visualtype_t, &'a XCBVisualType> { |
381 | | - Stash(self.to_raw_none(), *self) |
| 383 | + Stash(self.to_raw_none(), PhantomData) |
382 | 384 | } |
383 | 385 | } |
384 | 386 |
|
|
0 commit comments