1macro_rules! doc_ {
16 (@meta_start) => {
17 "<br/><i style='margin-left:0em;'></i><span style='font-size:90%;word-spacing:0px'>"
18 };
19 (@meta_start_nobr) => {
20 concat!(
21 "<i style='margin-left:0em;margin-top:-2em;'></i>",
22 "<span style='font-size:90%;word-spacing:0px'>",
23 )
24 };
25 (@meta_end) => { "</span>" };
26 (@meta_end_hr) => { "</span><hr/>" };
27 (newline) => { "<br/><br style='display:block;content:\"\";margin-top:10px;' />" };
29
30 ( modules: $path:path; $self:ident) => {
35 concat!(
36 $crate::doc_!(@meta_start),
37 "[", stringify!($self), "][mod@", stringify!($path), "::", stringify!($self), "]",
38 $crate::doc_!(@meta_end),
39 )
40 };
41 ( modules: $path:path; $self:ident: $($mod:ident),+ $(,)?) => {
43 concat!(
44 $crate::doc_!(@meta_start),
45 "[", stringify!($self), "][mod@", stringify!($path), "::", stringify!($self), "]::{",
46 $crate::doc_!(@modules: $path; $self: $($mod),+), "}",
47 $crate::doc_!(@meta_end),
48 )
49 };
50 (@modules: $path:path; $self:ident: $first:ident $(, $rest:ident)*) => {
52 concat!(
53 "[", stringify!($first), "](mod@",
54 stringify!($path), "::", stringify!($self), "::",
55 stringify!($first), ")",
56 $(
57 ", [", stringify!($rest), "](mod@", stringify!($path), "::",
58 stringify!($self), "::", stringify!($rest), ")"
59 ),*
60 )
61 };
62
63 (extends: $($mod:ident),+ $(,)?) => {
66 concat!(
67 $crate::doc_!(@meta_start_nobr), "Extends: ",
68 $crate::std_core!(), "::{", $crate::doc_!(@extends: $($mod),+), "}",
69 $crate::doc_!(@meta_end_hr),
70 )
71 };
72 (@extends: $first:ident $(, $rest:ident)*) => {
74 concat!(
75 "[", stringify!($first), "](mod@", $crate::std_core!(), "::", stringify!($first), ")",
76 $( ", [", stringify!($rest), "](mod@", $crate::std_core!(), "::", stringify!($rest), ")" ),*
77 )
78 };
79 (
80 vendor: $crate_id:literal) => { concat!(
84 "\n\n# Vendored\n\nThis is adapted work from [",
85 $crate_id, "][crate::_info::vendored#", $crate_id, "].\n\n"
86 )};
87 (
88 vendor: $crate_id:literal, module:$mod_id:ident) => { concat!(
90 "\n\n# Vendored\n\nThis is adapted work from [",
91 $crate_id, "][crate::_info::vendored::", $mod_id, "].\n\n"
92 )};
93 (
94 vendor_mod: $crate_id:literal, $mod_id:ident) => {
102 #[doc = concat!(
103 "# `", $crate_id,
104 "` modifications\n\n[*(โ)*][crate::_info::vendored#", $crate_id, "] ",
105 include_str!(concat!("./", $crate_id, ".md"))
106 )]
107 pub mod $mod_id {}
108 };
109 }
119pub(crate) use doc_;
120
121#[allow(unused_macros)]
130macro_rules! doc_availability {
131 (feature = $feat:literal) => {
132 $crate::doc_availability!{@wrap
133 "Available on <strong>crate feature ",
134 $crate::doc_availability!{@code $feat},
135 "</strong> only."
136 }
137 };
138
139 ( all( $(feature = $feat:literal),+ ) ) => {
141 $crate::doc_availability!{@wrap
142 "Available on <strong>crate features ",
143 $crate::doc_availability!{@join_features_and $($feat),+},
144 "</strong> only."
145 }
146 };
147 ( any( $(feature = $feat:literal),+ ) ) => {
149 $crate::doc_availability!{@wrap
150 "Available on <strong>crate features ",
151 $crate::doc_availability!{@join_features_or $($feat),+},
152 "</strong> only."
153 }
154 };
155
156 (@wrap $($strings:tt)+) => {
160 concat!(
161 "<div class='item-info' style='margin-left:0;'>",
162 "<div class='stab portability'>",
163 $($strings)+,
164 "</div></div>"
165 )
166 };
167
168 (@code $string:literal) => {
170 concat!("<code style='background:none'>", $string, "</code>")
171 };
172
173 (@join_features_and $first:literal $(, $rest:literal)*) => {
175 concat!(
176 $crate::doc_availability!{@code $first}
177 $(
178 , " and ", $crate::doc_availability!{@code $rest}
179 )*
180 )
181 };
182 (@join_features_or $first:literal $(, $rest:literal)*) => {
184 concat!(
185 $crate::doc_availability!{@code $first}
186 $(
187 , " or ", $crate::doc_availability!{@code $rest}
188 )*
189 )
190 };
191}
192#[allow(unused_imports)]
193pub(crate) use doc_availability;
194
195#[allow(unused_macros)]
197macro_rules! doc_miri_warn {
198 (tag) => {
199 concat!(
200 "<span class='stab portability' ",
201 "title='Fails to compile with Miri.'>",
202 "<code>โ ๏ธ</code></span>"
203 )
204 };
205 (body $(, url: $url:literal)?) => {
206 concat!(
207 "<div class='warning'>",
208 "Fails to compile with Miri.",
209 $( "<p><em>See <a href = '", $url, "'>", $url, "</a>.</em></p>", )?
210 "</div>"
211 )
212 };
213}
214#[allow(unused_imports)]
215pub(crate) use doc_miri_warn;
216
217#[cfg(feature = "std")]
219macro_rules! std_core {
220 () => {
221 "std"
222 };
223}
224#[cfg(not(feature = "std"))]
225macro_rules! std_core {
226 () => {
227 "core"
228 };
229}
230pub(crate) use std_core;
231
232mod tags {
234 #![allow(unused)]
235 crate::CONST! { pub(crate),
236 EMOJI_ALLOCATOR = "๐งบ"; EMOJI_ATOMIC = "โ๏ธ"; EMOJI_DATA_STRUCTURE = "๐ฆ"; EMOJI_ERROR = "๐ฉ"; EMOJI_EXPERIMENTAL = "๐งช";
242 EMOJI_FAKE = "๐ญ"; EMOJI_FFI = "๐ก๏ธ"; EMOJI_FONT = "๐
ต"; EMOJI_FMT = "๐น"; EMOJI_GEOM = "๐";
247 EMOJI_ITERATOR = "๐"; EMOJI_NAMESPACE = "๐"; EMOJI_NICHE = "โ๏ธ"; EMOJI_NON_STANDARD = "โ ๏ธ";
251 EMOJI_NO = "โ
"; EMOJI_NUM = "๐"; EMOJI_PRIMITIVE = "โ๏ธ"; EMOJI_QUANT = "๐";
255 EMOJI_RAND = "๐ฒ"; EMOJI_RESULT = "โ๏ธ"; EMOJI_TEXT = "๐"; EMOJI_TIME = "๐"; SPAN_OPEN = "<span class='stab portability' title=";
261 TAG_ALLOCATOR = concat!(crate::SPAN_OPEN!(), "'Allocator-related item'>",
264 crate::EMOJI_ALLOCATOR!(), "</span>");
265 TAG_ATOMIC = concat!(crate::SPAN_OPEN!(), "'Atomic-related item'>",
266 crate::EMOJI_ATOMIC!(), "</span>");
267 TAG_DATA_STRUCTURE =
268 concat!(crate::SPAN_OPEN!(), "'General-purpose data structure'>",
269 crate::EMOJI_DATA_STRUCTURE!(), "</span>");
270 TAG_ERROR = concat!(crate::SPAN_OPEN!(), "'Individual error type'>",
271 crate::EMOJI_ERROR!(), "</span>");
272 TAG_ERROR_COMPOSITE =
273 concat!(crate::SPAN_OPEN!(), "'Composite error type'>",
274 crate::EMOJI_ERROR!(), "+</span>");
275 TAG_EXPERIMENTAL = concat!(
276 "<span class='stab portability' title='Experimental functionality'>",
277 crate::EMOJI_EXPERIMENTAL!(), "</span>");
278 TAG_FAKE = concat!(crate::SPAN_OPEN!(), "'A fake implementation for testing.'>",
279 crate::EMOJI_FAKE!() ,"</span>");
280 TAG_FFI = concat!("<span class='stab portability' title='Ffi-safe version'>",
281 crate::EMOJI_FFI!(), "</span>");
282 TAG_FONT = concat!("<span class='stab portability' title='Font-related item'>",
283 crate::EMOJI_FONT!(), "</span>");
284 TAG_FMT =
285 concat!(crate::SPAN_OPEN!(), "'Text Formatting & Representation item'>",
286 crate::EMOJI_FMT!(), "</span>");
287 TAG_GEOM =
288 concat!(crate::SPAN_OPEN!(), "'Geometric multi-dimensional item'>",
289 crate::EMOJI_GEOM!(), "</span>");
290 TAG_ITERATOR = concat!(crate::SPAN_OPEN!(), "'Iterator or iterator adapter'>",
291 crate::EMOJI_ITERATOR!(), "</span>");
292 TAG_NAMESPACE = concat!(crate::SPAN_OPEN!(), "'Namespaced functionality'>",
293 crate::EMOJI_NAMESPACE!(), "</span>");
294 TAG_NICHE = concat!(crate::SPAN_OPEN!(), "'Type with niche-based memory optimizations'>",
295 crate::EMOJI_NICHE!(), "</span>");
296 TAG_NON_STANDARD = concat!(
297 "<span class='stab portability' title='Non-standard. Expect poor cross-compatibility'>",
298 crate::EMOJI_NON_STANDARD!(), "</span>");
299 TAG_NO = concat!(crate::SPAN_OPEN!(), "'Absence, emptiness, or a no-op effect'>",
300 crate::EMOJI_NO!(), "</span>");
301 TAG_NUM = concat!(crate::SPAN_OPEN!(), "'Numeric value-related item'>",
302 crate::EMOJI_NUM!(), "</span>");
303 TAG_PRIMITIVE = concat!(crate::SPAN_OPEN!(), "'Rust primitive type'>",
304 crate::EMOJI_PRIMITIVE!(), "</span>");
305 TAG_QUANT = concat!(crate::SPAN_OPEN!(), "'1-dimensional measurement or quantity'>",
306 crate::EMOJI_QUANT!(), "</span>");
307 TAG_RAND = concat!(crate::SPAN_OPEN!(), "'Randomness-related item'>",
308 crate::EMOJI_RAND!(), "</span>");
309 TAG_RESULT = concat!(crate::SPAN_OPEN!(), "'Resolution or outcome-related item'>",
310 crate::EMOJI_RESULT!() ,"</span>");
311 TAG_TEXT = concat!(crate::SPAN_OPEN!(), "'Text-related type'>",
312 crate::EMOJI_TEXT!() ,"</span>");
313 TAG_TIME = concat!(crate::SPAN_OPEN!(), "'Time-related type'>",
314 crate::EMOJI_TIME!() ,"</span>");
315
316 TAG_MAYBE_STD = concat!(crate::SPAN_OPEN!(),
317 "'re-exported from rust's `std` or recreated if `not(std)`'>`?std`</span>");
318
319 TAG_ATOMIC_CORE_PORTABLE = concat!(crate::SPAN_OPEN!(),
323 "'re-exported either from `core` or from the `portable-atomic` crate'>",
324 "`?core`</span>");
325 DOC_ATOMIC_CORE_PORTABLE = concat!("*Re-exported either from `core` or from the ",
326 "[`portable-atomic`](https://docs.rs/portable-atomic)* crate.\n\n---");
327
328 TAG_ATOMIC_ALLOC_PORTABLE_UTIL = concat!(crate::SPAN_OPEN!(),
330 "'re-exported either from `alloc` or from the `portable-atomic-util` crate'>",
331 "`?alloc`</span>");
332 DOC_ATOMIC_ALLOC_PORTABLE_UTIL = concat!("*Re-exported either from `alloc` or from the ",
333 "[`portable-atomic-util`](https://docs.rs/portable-atomic-util)* crate.\n\n---");
334 }
335}
336pub(crate) use tags::*;