Skip to content

Instantly share code, notes, and snippets.

@lkuper
Created May 19, 2012 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lkuper/2728360 to your computer and use it in GitHub Desktop.
Save lkuper/2728360 to your computer and use it in GitHub Desktop.
fn not_ok(a: &uint) {
let mut g: fn@(x: &uint) = fn@(x: &r.uint) {};
g(a);
}
fn main() {
}
lkuper@lenny:~/rust/build$ x86_64-unknown-linux-gnu/stage0/bin/rustc --debug-rustc ../src/test/run-pass/regions-fn-subtyping-2.rs
../src/test/run-pass/regions-fn-subtyping-2.rs:4:33: 4:49 error: mismatched types: expected `fn@(&uint)` but found `fn@(&r.uint)` (references with lifetime & do not necessarily outlive references with lifetime &r)
../src/test/run-pass/regions-fn-subtyping-2.rs:4 let mut g: fn@(x: &uint) = fn@(x: &r.uint) {};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment