RS.CLIPPY.SEMICOLON_OUTSIDE_BLOCK
Add a semicolon outside the block
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: semicolon_outside_block. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Suggests moving the semicolon from a block's final expression outside of the block.
Why restrict this?
For consistency it's best to have the semicolon inside/outside the block. Either way is fine
and this lint suggests outside the block.
Take a look at semicolon_inside_block for the other alternative.
Example
unsafe { f(x); }
Use instead:
unsafe { f(x) };
Configuration
-
semicolon-outside-block-ignore-multiline: Whether to lint only if it's singleline.(default:
false)