16 lines
366 B
Rust
16 lines
366 B
Rust
// expect: reject E7005
|
|
// phase: 6
|
|
// spec: docs/spec/16-standard-library.md §2.3; docs/spec/15-source-language.md §13
|
|
module test.endian
|
|
import std.bytes;
|
|
|
|
enum ReadU16 { ok(u16), short_input }
|
|
fn main() -> u8
|
|
effects []
|
|
{
|
|
match std.bytes.read_u16_le(b"xx") {
|
|
ReadU16::ok(value) => { return 0; }
|
|
ReadU16::short_input => { return 1; }
|
|
}
|
|
}
|