aboutsummaryrefslogtreecommitdiff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-05-09 14:00:02 -0700
committerPatrick Walton <[email protected]>2011-05-09 14:00:50 -0700
commit70c759030ccf27222a04f918e235bc9dbcf88c94 (patch)
treee8e0439b47606fe6500df7e9c3e455c4ef35a82c /src/test/compile-fail
parentAlias-ify a variety of fn signatures in ty. Cuts 180kb off rustc. (diff)
downloadrust-70c759030ccf27222a04f918e235bc9dbcf88c94.tar.xz
rust-70c759030ccf27222a04f918e235bc9dbcf88c94.zip
rustc: Alias fix part 2 -- Check that the aliasness of function parameters matches. Add a test case.
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/aliasness-mismatch.rs15
1 files changed, 15 insertions, 0 deletions
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);
+}
+
+