()
| 581 | fn hosted_vec_copy_aliases_allocation() { |
| 582 | let (_, exit) = run_hll( |
| 583 | r#" |
| 584 | alloc := import("alloc") |
| 585 | vec := import("vec") |
| 586 | owned := import("owned_string") |
| 587 | arena := import("arena") |
| 588 | pool := import("pool") |
| 589 | |
| 590 | main: () -> i32 { |
| 591 | v: vec.Vec<i64> = { .ptr = null, .len = 0, .capacity = 0 } |
| 592 | vec.Vec_init<i64>(&v) |
| 593 | pushed := vec.Vec_push<i64>(&v, 41) |
| 594 | match pushed { |
| 595 | Ok(len) -> {} |
| 596 | Err(error) -> { return 1 } |
| 597 | } |
| 598 | |
| 599 | ; Copying the container copies its fields; both alias one allocation. |
| 600 | alias: vec.Vec<i64> = v |
| 601 | slot: i64* = vec.Vec_get<i64>(&alias, 0) |
| 602 | @slot = 42 |
| 603 | original: i64* = vec.Vec_get<i64>(&v, 0) |
nothing calls this directly
no test coverage detected