MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / match_integer_const_patterns

Function match_integer_const_patterns

tests/integration/hll_conformance.rs:1321–1340  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1319fn variant_names_may_repeat_across_enums() {
1320 // Two enums declare `Busy`; the qualifier picks one and match arms resolve
1321 // bare names against the scrutinee's enum.
1322 assert_exit(
1323 r#"
1324enum Link {
1325 Idle
1326 Busy(i32)
1327}
1328
1329enum Disk {
1330 Busy(i32)
1331 Spun
1332}
1333
1334main: () -> i32 {
1335 l: Link = Link.Busy(40)
1336 d: Disk = Disk.Busy(2)
1337 a: i32 = match l {
1338 Busy(n) -> n
1339 Idle -> 0
1340 }
1341 b: i32 = match d {
1342 Busy(n) -> n
1343 Spun -> 0

Callers

nothing calls this directly

Calls 1

assert_exitFunction · 0.85

Tested by

no test coverage detected