Docs menu

E195: An empty loop body

What compiler warning E195 means, and how to fix it.

A warning, on by default. Since TurfLang 2.3.

A while, do, for or for ... in loop whose body holds no statements does nothing on each pass:

Example
mut arr: int[3] = [1, 2, 3];for v in arr {}                           // the body is empty -- WARNING

Write what the loop should do, or remove the loop. A while whose condition calls a function does its work in the test (while advance(&n) { }), so it does not warn.

If the loop is meant to do nothing, put a comment in the body saying why. A body holding a comment does not warn:

Example
for i in 0..3 {    // counted, nothing else}

This is a warning, not an error – compilation still succeeds. To silence it for a whole build, set its lint level to allow: turf build --allow E195 (or [lints] E195 = "allow" in turf.toml).

Run turf --explain E195 in a terminal to read this again.

Last updated: Oct 15, 2026Edit this page on GitHub

Esc

Type to search.