rust/src/test/run-pass/regions-borrow-estr-uniq.rs

14 lines
189 B
Rust

fn foo(x: &str) -> u8 {
x[0]
}
fn main() {
let p = ~"hello";
let r = foo(p);
assert r == 'h' as u8;
let p = ~"hello";
let r = foo(p);
assert r == 'h' as u8;
}