From 70c759030ccf27222a04f918e235bc9dbcf88c94 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 9 May 2011 14:00:02 -0700 Subject: rustc: Alias fix part 2 -- Check that the aliasness of function parameters matches. Add a test case. --- src/test/compile-fail/aliasness-mismatch.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/test/compile-fail/aliasness-mismatch.rs (limited to 'src/test/compile-fail') diff --git a/src/test/compile-fail/aliasness-mismatch.rs b/src/test/compile-fail/aliasness-mismatch.rs new file mode 100644 index 00000000..88b7d938 --- /dev/null +++ b/src/test/compile-fail/aliasness-mismatch.rs @@ -0,0 +1,15 @@ +// -*- rust -*- +// xfail-stage0 + +// error-pattern: mismatched types + +fn f(&int x) { log_err x; } +fn h(int x) { log_err x; } +fn main() { + let fn(int x) g = f; + g(10); + g = h; + g(10); +} + + -- cgit v1.2.3