A lambda captures by default with [=] or [&], which hides what it depends on
What it finds
A default capture takes whatever the body names, which makes it easy to capture a reference to a local that the lambda outlives, or this without saying so. Listing the captures states the lambda's dependencies.
From the rule's source, lambda_default_capture.rs.
Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/cpp:lambda-default-capture" = "note"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/cpp:lambda-default-capture] reason="..."tx0 explain tx0/cpp:lambda-default-capture shows the same in the terminal. Found a false positive? Report it.