E0271

Construction of a prelude struct with private fields, such as a built-in capability (Stdout(handle: 1)) or Args. Capabilities cannot be forged; they come from main.

Machine-applicable fix: none.

Example

This program fails with E0271.

fn main() {
    let out = Stdout(handle: 1)
}

Fixed

The same program, fixed.

fn main(out: Stdout) {}

Listed in the checker notes. oskac explain E0271 prints this entry offline.

All error codes