MAX_NESTING

Constant MAX_NESTING 

Source
pub const MAX_NESTING: u32 = 256;
Expand description

How deep the front end will follow user-chosen structure before it refuses.

The number is chosen to be far above anything a person writes and far below anything the stack notices. SICP’s deepest expression is under 20 levels and the corpus’s is 11; the parser spends about 18 KiB per level in an unoptimised build, which the_ceiling_fits_the_declared_stack measures rather than assumes, so this ceiling costs under 5 MiB — inside the 8 MiB a main thread ordinarily has, and a small fraction of the STACK_BYTES declared below. A ceiling nobody legitimately reaches is the point: this bound exists to turn an abort into a message, not to have an opinion about style.