about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/test/auxiliary/issue_8401.rs25
-rw-r--r--src/test/run-pass/issue-8248.rs21
-rw-r--r--src/test/run-pass/issue-8249.rs25
-rw-r--r--src/test/run-pass/issue-8398.rs18
-rw-r--r--src/test/run-pass/issue-8401.rs16
5 files changed, 105 insertions, 0 deletions
diff --git a/src/test/auxiliary/issue_8401.rs b/src/test/auxiliary/issue_8401.rs
new file mode 100644
index 00000000000..9e4d90e979d
--- /dev/null
+++ b/src/test/auxiliary/issue_8401.rs
@@ -0,0 +1,25 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// for this issue, this code must be built in a library
+
+use std::cast;
+
+trait A {}
+struct B;
+impl A for B {}
+
+fn bar<T>(_: &mut A, _: &T) {}
+
+fn foo<T>(t: &T) {
+    let b = B;
+    bar(unsafe { cast::transmute(&b as &A) }, t)
+}
+
diff --git a/src/test/run-pass/issue-8248.rs b/src/test/run-pass/issue-8248.rs
new file mode 100644
index 00000000000..48f34805fee
--- /dev/null
+++ b/src/test/run-pass/issue-8248.rs
@@ -0,0 +1,21 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait A {}
+struct B;
+impl A for B {}
+
+fn foo(_: &mut A) {}
+
+fn main() {
+    let mut b = B;
+    foo(&mut b as &mut A);
+}
+
diff --git a/src/test/run-pass/issue-8249.rs b/src/test/run-pass/issue-8249.rs
new file mode 100644
index 00000000000..ad37196dce4
--- /dev/null
+++ b/src/test/run-pass/issue-8249.rs
@@ -0,0 +1,25 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait A {}
+struct B;
+impl A for B {}
+
+struct C<'self> {
+    foo: &'self mut A,
+}
+
+fn foo(a: &mut A) {
+    C{ foo: a };
+}
+
+fn main() {
+}
+
diff --git a/src/test/run-pass/issue-8398.rs b/src/test/run-pass/issue-8398.rs
new file mode 100644
index 00000000000..5e04c96af72
--- /dev/null
+++ b/src/test/run-pass/issue-8398.rs
@@ -0,0 +1,18 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use std::rt::io;
+
+fn foo(a: &mut io::Writer) {
+    a.write([])
+}
+
+fn main(){}
+
diff --git a/src/test/run-pass/issue-8401.rs b/src/test/run-pass/issue-8401.rs
new file mode 100644
index 00000000000..cf786835107
--- /dev/null
+++ b/src/test/run-pass/issue-8401.rs
@@ -0,0 +1,16 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// aux-build:issue_8401.rs
+// xfail-fast
+
+extern mod issue_8401;
+
+pub fn main() {}