naming

Functions that answer yes or no

Name: ratified 2026-10-18 (calef, "Yes"). Refused boolean-predicates.

An appendix to design/naming.md, which states the rules. It holds the shapes in full, the prior art they follow, and the cases that need a judgment.

The rule

A function that answers a question and changes nothing takes one of these shapes, as Rust does:

A bare adjective, participle or noun (enabled, pending, present, truncated, read_only, done, required) reads as a getter, and std spells those is_enabled.

Exempt:

Why a verb phrase passes

std's relations read as a sentence with the receiver as subject: set.contains(x), path.starts_with(p), waker.will_wake(other). A finite verb already says "this is a question", which is the job is_ does for an adjective. So rights.allows(needed) and user_can_read(va) fit as they stand, and is_allowing would be less Rust, not more. The test is grammatical: a finite verb (allows, was_already_up, machine_has_no_rtc) passes, and an adjective, participle or noun standing alone takes is_ or has_.

Cases that need a judgment

What Rust's convention is

Rust has no written rule for predicates. The API Guidelines' naming chapter (source) covers casing, conversions, getters, iterators, features and word order, and its one is_ example shows how to lowercase an acronym. RFC 430 and RFC 344 say nothing of booleans either. Clippy's wrong_self_convention (source) checks the receiver of an is_ name and never requires is_ on a function that returns bool.

So the convention is what std does. A regex census of every pub fn ... -> bool in core, alloc and std (tests, sys and the intrinsics aside) found 342 functions: 236 is_, 45 relations (contains, starts_with, eq, exists, needs_drop), 3 can_ and 2 has_. Most of the rest are actions that report what happened (HashSet::insert, Vec::pop_if, AtomicBool::swap). What remains are std's older exceptions (ExitStatus::success, thread::panicking, Formatter::alternate), and newer stable API does not repeat them: Option::is_some_and, slice::is_sorted. The rule follows what std converged on for a question, not what it keeps for compatibility.

BUGS