@@ -280,19 +280,30 @@ platform supports.";
280
280
/// Define an exported macro named `$public` that expands to an expression if
281
281
/// the feature `$feature` is enabled, or to a panic otherwise.
282
282
///
283
+ /// This is used in the definition of `gfx_select!`, to dispatch the
284
+ /// call to the appropriate backend, but panic if that backend was not
285
+ /// compiled in.
286
+ ///
283
287
/// For a call like this:
284
288
///
285
- /// define_backend_caller! { name, hidden_name, feature }
289
+ /// ```ignore
290
+ /// define_backend_caller! { name, private, "feature" if cfg_condition }
291
+ /// ```
286
292
///
287
293
/// define a macro `name`, used like this:
288
294
///
289
- /// name!(expr)
295
+ /// ```ignore
296
+ /// name!(expr)
297
+ /// ```
290
298
///
291
- /// that expands to `expr` if `feature` is enabled, or a panic otherwise.
299
+ /// that expands to `expr` if `#[cfg(cfg_condition)]` is enabled, or a
300
+ /// panic otherwise. The panic message complains that `"feature"` is
301
+ /// not enabled.
292
302
///
293
- /// Because of odd technical limitations on exporting macros expanded by other
294
- /// macros, you must supply both a public-facing name for the macro and a
295
- /// private name, which is never used outside this macro. For details:
303
+ /// Because of odd technical limitations on exporting macros expanded
304
+ /// by other macros, you must supply both a public-facing name for the
305
+ /// macro and a private name, `$private`, which is never used
306
+ /// outside this macro. For details:
296
307
/// <https://github.com/rust-lang/rust/pull/52234#issuecomment-976702997>
297
308
macro_rules! define_backend_caller {
298
309
{ $public: ident, $private: ident, $feature: literal if $cfg: meta } => {
0 commit comments