8 lines
311 B
Rust
8 lines
311 B
Rust
// expect: run
|
|
// result: 42
|
|
// phase: 6
|
|
// spec: docs/spec/15-source-language.md §2, §5, §6
|
|
module grammar.borrow_calls
|
|
fn first<T: Copy>(s: slice<T>,) -> ref<T> from s effects [] { ref x = s[0]; return x; }
|
|
fn main() -> u64 effects [] { let a = [42u64]; ref s = (a); ref x = first::<u64>(s,); return *x; }
|