| 1 | //! Operators used to turn types into unsafe binders and back. |
| 2 | |
| 3 | /// Unwrap an unsafe binder into its underlying type. |
| 4 | #[allow_internal_unstable (builtin_syntax)] |
| 5 | #[unstable (feature = "unsafe_binders" , issue = "130516" )] |
| 6 | pub macro unwrap_binder { |
| 7 | ($expr:expr) => { |
| 8 | builtin # unwrap_binder ( $expr ) |
| 9 | }, |
| 10 | ($expr:expr ; $ty:ty) => { |
| 11 | builtin # unwrap_binder ( $expr, $ty ) |
| 12 | }, |
| 13 | } |
| 14 | |
| 15 | /// Wrap a type into an unsafe binder. |
| 16 | #[allow_internal_unstable (builtin_syntax)] |
| 17 | #[unstable (feature = "unsafe_binders" , issue = "130516" )] |
| 18 | pub macro wrap_binder { |
| 19 | ($expr:expr) => { |
| 20 | builtin # wrap_binder ( $expr ) |
| 21 | }, |
| 22 | ($expr:expr ; $ty:ty) => { |
| 23 | builtin # wrap_binder ( $expr, $ty ) |
| 24 | }, |
| 25 | } |
| 26 | |