Skip to main content

make_noop

Attribute Macro make_noop 

Source
#[make_noop]
Expand description

Replaces the body of the tagged function(s) with a no-op.

Can be applied to:

  • a free function,
  • a single method inside an impl block, or
  • an entire impl block (every method is made a no-op).

Functions that return a value return Default::default() (so the return type must implement Default). To return a custom expression instead, tag the function or method with noop_returns. Within an impl block, individual methods may carry their own #[noop_returns(EXPR)].