Skip to main content

DEFAULT_DRAFT

Constant DEFAULT_DRAFT 

Source
pub const DEFAULT_DRAFT: DraftVersion;
Expand description

The draft a session configuration takes when the caller names none.

Draft-14 wherever the build has it, which is every build that did not trim its drafts, and the newest draft the build does have otherwise — so a reduced-draft build never starts out naming a draft it cannot speak.

§Why a default cannot simply refuse

Default returns a value, so it has no way to tell a caller that the build left out the draft it would have chosen. Keeping draft-14 regardless does not avoid the problem, it moves it: on a build without draft-14 draft_is_compiled answers false, supports_matcher refuses every key on every stream kind, and a class rule that is perfectly well formed is reported as naming a key the draft does not carry. That is a configuration error raised against the author of a configuration that has nothing wrong with it.

§The check below is a compile-time one, and it has to be

A test asserting the same thing would never run. The per-draft rows build this crate once per draft under --no-default-features --features draftNN and stop at clippy --all-targets, so a reduced-draft build is compiled once per draft a round and its tests are run none — and a reduced-draft build is the only kind that can have this defect. A const assertion fails the compile, which is the one thing those rows do look at.