Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

must_use

What it does

Checks that the return values of functions marked must_use are used.

Why this is bad

This lint will only catch uses where the function has no reason to be called other than to use its output.

Example

bit32.bor(entity.flags, Flags.Invincible)

...should be written as...

entity.flags = bit32.bor(entity.flags, Flags.Invincible)

...as bit32.bor only produces a new value, it does not mutate anything.

Remarks

The output is deemed "unused" if the function call is its own statement.