rust/src/test/compile-fail/ret-by-reference-wrong-param.rs
Marijn Haverbeke d7587c1eda Change convention for specifying referenced argument
It is now 1-based, rather than 0 based. (Seems more natural, and allows 0 to
be used to refer to self and maybe to closure.)

Also allows non-referenced args to be implicitly copied again.

Issue #918
2011-09-16 12:42:18 +02:00

8 lines
128 B
Rust

// error-pattern:can not return a reference to the wrong parameter
fn f(a: int, b: int) -> &2 int {
ret a;
}
fn main() {}