about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-12-18 10:36:51 -0800
committerbors <bors@rust-lang.org>2013-12-18 10:36:51 -0800
commit6d2e61bc6cadcfde6952913b7e170ded57f7b0dd (patch)
tree1ade26dd8e91fa480624d7f23c8466d70a97bfdf
parent5ece09277387acf8895f89d439a6cbce4bb55adf (diff)
parent3e04d2e3db98c46b320a6e20d39e0f6247ffc25e (diff)
downloadrust-6d2e61bc6cadcfde6952913b7e170ded57f7b0dd.tar.gz
rust-6d2e61bc6cadcfde6952913b7e170ded57f7b0dd.zip
auto merge of #11012 : alexcrichton/rust/needstest, r=alexcrichton
Closes #5806
Closes #8259
Closes #8578
Closes #8851
Closes #10412
-rw-r--r--src/test/auxiliary/issue-7178.rs17
-rw-r--r--src/test/auxiliary/issue-8259.rs15
-rw-r--r--src/test/compile-fail/issue-10412.rs31
-rw-r--r--src/test/compile-fail/issue-5806.rs14
-rw-r--r--src/test/run-pass/issue-5950.rs17
-rw-r--r--src/test/run-pass/issue-7178.rs18
-rw-r--r--src/test/run-pass/issue-8259.rs17
-rw-r--r--src/test/run-pass/issue-8578.rs24
-rw-r--r--src/test/run-pass/issue-8851.rs33
-rw-r--r--src/test/run-pass/issue-9129.rs41
10 files changed, 227 insertions, 0 deletions
diff --git a/src/test/auxiliary/issue-7178.rs b/src/test/auxiliary/issue-7178.rs
new file mode 100644
index 00000000000..fe3842ef174
--- /dev/null
+++ b/src/test/auxiliary/issue-7178.rs
@@ -0,0 +1,17 @@
+// 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.
+
+pub struct Foo<'a, A>(&'a A);
+
+impl<'a, A> Foo<'a, A> {
+    pub fn new(a: &'a A) -> Foo<'a, A> {
+        Foo(a)
+    }
+}
diff --git a/src/test/auxiliary/issue-8259.rs b/src/test/auxiliary/issue-8259.rs
new file mode 100644
index 00000000000..91167e8e32b
--- /dev/null
+++ b/src/test/auxiliary/issue-8259.rs
@@ -0,0 +1,15 @@
+// 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.
+
+
+pub enum Foo<'a> {
+    A,
+    B(&'a str),
+}
diff --git a/src/test/compile-fail/issue-10412.rs b/src/test/compile-fail/issue-10412.rs
new file mode 100644
index 00000000000..1c816c62601
--- /dev/null
+++ b/src/test/compile-fail/issue-10412.rs
@@ -0,0 +1,31 @@
+// 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 Serializable<'self, T> { //~ ERROR: no longer a special lifetime
+    fn serialize(val : &'self T) -> ~[u8];
+    fn deserialize(repr : &[u8]) -> &'self T;
+}
+
+impl<'self> Serializable<str> for &'self str {
+    fn serialize(val : &'self str) -> ~[u8] {
+        ~[1]
+    }
+    fn deserialize(repr: &[u8]) -> &'self str {
+        "hi"
+    }
+}
+
+fn main() {
+    println("hello");
+    let x = ~"foo";
+    let y = x;
+    println(y);
+}
diff --git a/src/test/compile-fail/issue-5806.rs b/src/test/compile-fail/issue-5806.rs
new file mode 100644
index 00000000000..676e8897dde
--- /dev/null
+++ b/src/test/compile-fail/issue-5806.rs
@@ -0,0 +1,14 @@
+// opyright 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.
+
+#[path = "../compile-fail"]
+mod foo; //~ ERROR: illegal operation on a directory
+
+fn main() {}
diff --git a/src/test/run-pass/issue-5950.rs b/src/test/run-pass/issue-5950.rs
new file mode 100644
index 00000000000..b169d2d4804
--- /dev/null
+++ b/src/test/run-pass/issue-5950.rs
@@ -0,0 +1,17 @@
+// 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.
+
+// xfail-fast
+
+pub use local_alias = local;
+
+mod local { }
+
+fn main() {}
diff --git a/src/test/run-pass/issue-7178.rs b/src/test/run-pass/issue-7178.rs
new file mode 100644
index 00000000000..3d635b87777
--- /dev/null
+++ b/src/test/run-pass/issue-7178.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.
+
+// xfail-fast
+// aux-build:issue-7178.rs
+
+extern mod cross_crate_self = "issue-7178";
+
+fn main() {
+    let _ = cross_crate_self::Foo::new(&1i);
+}
diff --git a/src/test/run-pass/issue-8259.rs b/src/test/run-pass/issue-8259.rs
new file mode 100644
index 00000000000..3e9007b5e36
--- /dev/null
+++ b/src/test/run-pass/issue-8259.rs
@@ -0,0 +1,17 @@
+// 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.
+
+// xfail-fast
+// aux-build:issue-8259.rs
+
+extern mod other = "issue-8259";
+static a: other::Foo<'static> = other::A;
+
+fn main() {}
diff --git a/src/test/run-pass/issue-8578.rs b/src/test/run-pass/issue-8578.rs
new file mode 100644
index 00000000000..fcc9278b4c5
--- /dev/null
+++ b/src/test/run-pass/issue-8578.rs
@@ -0,0 +1,24 @@
+// 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.
+
+pub struct UninterpretedOption_NamePart {
+    name_part: Option<~str>,
+}
+
+impl<'a> UninterpretedOption_NamePart {
+    pub fn default_instance() -> &'static UninterpretedOption_NamePart {
+        static instance: UninterpretedOption_NamePart = UninterpretedOption_NamePart {
+            name_part: None,
+        };
+        &'static instance
+    }
+}
+
+pub fn main() {}
diff --git a/src/test/run-pass/issue-8851.rs b/src/test/run-pass/issue-8851.rs
new file mode 100644
index 00000000000..947331ed4b1
--- /dev/null
+++ b/src/test/run-pass/issue-8851.rs
@@ -0,0 +1,33 @@
+// 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.
+
+#[feature(macro_rules)];
+
+enum T {
+    A(int),
+    B(uint)
+}
+
+macro_rules! test(
+    ($e:expr) => (
+        fn foo(t: T) -> int {
+            match t {
+                A(y) => $e,
+                B(y) => $e
+            }
+        }
+    )
+)
+
+test!(10 + (y as int))
+
+pub fn main() {
+    foo(A(20));
+}
diff --git a/src/test/run-pass/issue-9129.rs b/src/test/run-pass/issue-9129.rs
new file mode 100644
index 00000000000..bc6702c6df6
--- /dev/null
+++ b/src/test/run-pass/issue-9129.rs
@@ -0,0 +1,41 @@
+// 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.
+
+// xfail-pretty
+
+#[feature(managed_boxes, macro_rules)];
+
+pub trait bomb { fn boom(@self, Ident); }
+pub struct S;
+impl bomb for S { fn boom(@self, _: Ident) { } }
+
+pub struct Ident { name: uint }
+
+// macro_rules! int3( () => ( unsafe { asm!( "int3" ); } ) )
+macro_rules! int3( () => ( { } ) )
+
+fn Ident_new() -> Ident {
+    int3!();
+    Ident {name: 0x6789ABCD }
+}
+
+pub fn light_fuse(fld: @bomb) {
+    int3!();
+    let f = || {
+        int3!();
+        fld.boom(Ident_new()); // *** 1
+    };
+    f();
+}
+
+pub fn main() {
+    let b = @S as @bomb;
+    light_fuse(b);
+}