Skip to content

Commit 35b0a16

Browse files
authored
Update docs after #3466. (#3576)
1 parent a820131 commit 35b0a16

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

wgpu-core/src/lib.rs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,19 +280,30 @@ platform supports.";
280280
/// Define an exported macro named `$public` that expands to an expression if
281281
/// the feature `$feature` is enabled, or to a panic otherwise.
282282
///
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+
///
283287
/// For a call like this:
284288
///
285-
/// define_backend_caller! { name, hidden_name, feature }
289+
/// ```ignore
290+
/// define_backend_caller! { name, private, "feature" if cfg_condition }
291+
/// ```
286292
///
287293
/// define a macro `name`, used like this:
288294
///
289-
/// name!(expr)
295+
/// ```ignore
296+
/// name!(expr)
297+
/// ```
290298
///
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.
292302
///
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:
296307
/// <https://github.com/rust-lang/rust/pull/52234#issuecomment-976702997>
297308
macro_rules! define_backend_caller {
298309
{ $public:ident, $private:ident, $feature:literal if $cfg:meta } => {

0 commit comments

Comments
 (0)