# dmd.mustuse

Compile-time checks associated with the @`mustuse` attribute.

#### License

Boost License 1.0

Source: mustuse.d

Documentation: https://dlang.org/phobos/dmd_mustuse.html

Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/mustuse.d

- `checkMustUse`

  #### Declaration

  `bool `checkMustUse`(Expression `e`, Scope* `sc`);`

  Check whether discarding an expression would violate the requirements of @mustuse. If so, emit an error.

  #### Parameters

  `Expression `e`` | the expression to check
  `Scope* `sc`` | scope in which ``e`` was semantically analyzed

  #### Return Value

  `true` on error, `false` on success.

- `checkMustUseReserved`

  #### Declaration

  `void `checkMustUseReserved`(Dsymbol `sym`);`

  Called from a symbol's semantic to check for reserved usage of @mustuse.

  #### Discussion

  If such usage is found, emits an errror.

  #### Parameters

  `Dsymbol `sym`` | symbol to check