@@ -1027,3 +1027,41 @@ pub trait FnPtr: Copy + Clone { |
|
|
1027 |
1027 |
pub macro SmartPointer($item:item) { |
1028 |
1028 |
/* compiler built-in */ |
1029 |
1029 |
} |
|
1030 |
+ |
|
1031 |
+#[doc(hidden)] |
|
1032 |
+#[unstable( |
|
1033 |
+ feature = "effect_types", |
|
1034 |
+ issue = "none", |
|
1035 |
+ reason = "internal module for implementing effects" |
|
1036 |
+)] |
|
1037 |
+#[allow(missing_debug_implementations)] // these unit structs don't need `Debug` impls. |
|
1038 |
+#[cfg(not(bootstrap))] |
|
1039 |
+// TODO docs |
|
1040 |
+pub mod effects { |
|
1041 |
+#[lang = "EffectsNoRuntime"] |
|
1042 |
+pub struct NoRuntime; |
|
1043 |
+#[lang = "EffectsMaybe"] |
|
1044 |
+pub struct Maybe; |
|
1045 |
+#[lang = "EffectsRuntime"] |
|
1046 |
+pub struct Runtime; |
|
1047 |
+ |
|
1048 |
+#[lang = "EffectsCompat"] |
|
1049 |
+pub trait Compat<#[rustc_runtime] const RUNTIME: bool> {} |
|
1050 |
+ |
|
1051 |
+impl Compat<false> for NoRuntime {} |
|
1052 |
+impl Compat<true> for Runtime {} |
|
1053 |
+impl<#[rustc_runtime] const RUNTIME: bool> Compat<RUNTIME> for Maybe {} |
|
1054 |
+ |
|
1055 |
+#[lang = "EffectsTyCompat"] |
|
1056 |
+#[marker] |
|
1057 |
+pub trait TyCompat<T> {} |
|
1058 |
+ |
|
1059 |
+impl<T> TyCompat<T> for T {} |
|
1060 |
+impl<T> TyCompat<T> for Maybe {} |
|
1061 |
+ |
|
1062 |
+#[lang = "EffectsMin"] |
|
1063 |
+pub trait Min { |
|
1064 |
+#[lang = "EffectsMinOutput"] |
|
1065 |
+type Output; |
|
1066 |
+} |
|
1067 |
+} |