about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-02-23 20:47:30 +0000
committerbors <bors@rust-lang.org>2015-02-23 20:47:30 +0000
commit91a5a1ab4ad054c8dccf49f6f409542f82683cfc (patch)
tree1c2a90b8e1aac6793a0fbf6350778a5b9ac65dae /src/test
parentf0f7ca27de6b4e03f30012656dad270cda55a363 (diff)
parentee6f2a1ad6ab79ed954cd96fff6eaddcdfb6a043 (diff)
downloadrust-91a5a1ab4ad054c8dccf49f6f409542f82683cfc.tar.gz
rust-91a5a1ab4ad054c8dccf49f6f409542f82683cfc.zip
Auto merge of #22724 - Manishearth:rollup, r=alexcrichton
Seems to pass `check-stage1`, but I had to tweak some things so it's going through the test gauntlet again.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs2
-rw-r--r--src/test/compile-fail/borrowck-move-mut-base-ptr.rs2
-rw-r--r--src/test/compile-fail/borrowck-mut-borrow-of-mut-base-ptr.rs2
-rw-r--r--src/test/compile-fail/borrowck-swap-mut-base-ptr.rs2
-rw-r--r--src/test/compile-fail/invalid-inline.rs24
-rw-r--r--src/test/compile-fail/issue-22426-1.rs17
-rw-r--r--src/test/compile-fail/issue-22426-2.rs12
-rw-r--r--src/test/compile-fail/issue-22426-3.rs22
-rw-r--r--src/test/compile-fail/retslot-cast.rs25
-rw-r--r--src/test/run-make/weird-output-filenames/Makefile3
-rw-r--r--src/test/run-pass/borrowck-borrow-of-mut-base-ptr-safe.rs2
-rw-r--r--src/test/run-pass/extern-methods.rs38
-rw-r--r--src/test/run-pass/issue-22426.rs16
-rw-r--r--src/test/run-pass/lang-item-public.rs1
-rw-r--r--src/test/run-pass/unwind-resource.rs3
-rw-r--r--src/test/run-pass/unwind-unique.rs3
16 files changed, 166 insertions, 8 deletions
diff --git a/src/test/compile-fail/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs b/src/test/compile-fail/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs
index 9126058a4e6..d60751eddc7 100644
--- a/src/test/compile-fail/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs
+++ b/src/test/compile-fail/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs
@@ -11,7 +11,7 @@
 // Test that attempt to reborrow an `&mut` pointer in an aliasable
 // location yields an error.
 //
-// Example from src/middle/borrowck/doc.rs
+// Example from src/librustc_borrowck/borrowck/README.md
 
 fn foo(t0: & &mut isize) {
     let t1 = t0;
diff --git a/src/test/compile-fail/borrowck-move-mut-base-ptr.rs b/src/test/compile-fail/borrowck-move-mut-base-ptr.rs
index 5bdea6a2bd9..2fb89e6364b 100644
--- a/src/test/compile-fail/borrowck-move-mut-base-ptr.rs
+++ b/src/test/compile-fail/borrowck-move-mut-base-ptr.rs
@@ -11,7 +11,7 @@
 // Test that attempt to move `&mut` pointer while pointee is borrowed
 // yields an error.
 //
-// Example from src/middle/borrowck/doc.rs
+// Example from src/librustc_borrowck/borrowck/README.md
 
 fn foo(t0: &mut isize) {
     let p: &isize = &*t0; // Freezes `*t0`
diff --git a/src/test/compile-fail/borrowck-mut-borrow-of-mut-base-ptr.rs b/src/test/compile-fail/borrowck-mut-borrow-of-mut-base-ptr.rs
index 71dc61abb64..bdeb7ea69bd 100644
--- a/src/test/compile-fail/borrowck-mut-borrow-of-mut-base-ptr.rs
+++ b/src/test/compile-fail/borrowck-mut-borrow-of-mut-base-ptr.rs
@@ -11,7 +11,7 @@
 // Test that attempt to mutably borrow `&mut` pointer while pointee is
 // borrowed yields an error.
 //
-// Example from src/middle/borrowck/doc.rs
+// Example from src/librustc_borrowck/borrowck/README.md
 
 fn foo<'a>(mut t0: &'a mut isize,
            mut t1: &'a mut isize) {
diff --git a/src/test/compile-fail/borrowck-swap-mut-base-ptr.rs b/src/test/compile-fail/borrowck-swap-mut-base-ptr.rs
index 0102a909188..552fcec8e28 100644
--- a/src/test/compile-fail/borrowck-swap-mut-base-ptr.rs
+++ b/src/test/compile-fail/borrowck-swap-mut-base-ptr.rs
@@ -11,7 +11,7 @@
 // Test that attempt to swap `&mut` pointer while pointee is borrowed
 // yields an error.
 //
-// Example from src/middle/borrowck/doc.rs
+// Example from src/librustc_borrowck/borrowck/README.md
 
 use std::mem::swap;
 
diff --git a/src/test/compile-fail/invalid-inline.rs b/src/test/compile-fail/invalid-inline.rs
new file mode 100644
index 00000000000..ad89087d660
--- /dev/null
+++ b/src/test/compile-fail/invalid-inline.rs
@@ -0,0 +1,24 @@
+// Copyright 2015 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.
+#![allow(dead_code)]
+
+#[inline(please_no)] //~ ERROR invalid argument
+fn a() {
+}
+
+#[inline(please,no)] //~ ERROR expected one argument
+fn b() {
+}
+
+#[inline()] //~ ERROR expected one argument
+fn c() {
+}
+
+fn main() {}
diff --git a/src/test/compile-fail/issue-22426-1.rs b/src/test/compile-fail/issue-22426-1.rs
new file mode 100644
index 00000000000..f026a5db551
--- /dev/null
+++ b/src/test/compile-fail/issue-22426-1.rs
@@ -0,0 +1,17 @@
+// Copyright 2015 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.
+
+fn main() {
+  match 42 {
+    x < 7 => (),
+   //~^ error: unexpected token: `<`
+    _ => ()
+  }
+}
diff --git a/src/test/compile-fail/issue-22426-2.rs b/src/test/compile-fail/issue-22426-2.rs
new file mode 100644
index 00000000000..ea5180e3eec
--- /dev/null
+++ b/src/test/compile-fail/issue-22426-2.rs
@@ -0,0 +1,12 @@
+// Copyright 2015 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.
+
+fn a(B<) {}
+   //~^ error: unexpected token: `<`
diff --git a/src/test/compile-fail/issue-22426-3.rs b/src/test/compile-fail/issue-22426-3.rs
new file mode 100644
index 00000000000..2e0b5d6b80f
--- /dev/null
+++ b/src/test/compile-fail/issue-22426-3.rs
@@ -0,0 +1,22 @@
+// Copyright 2015 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.
+
+struct Foo<T>(T, T);
+
+impl<T> Foo<T> {
+    fn foo(&self) {
+        match *self {
+            Foo<T>(x, y) => {
+            //~^ error: unexpected token: `<`
+              println!("Goodbye, World!")
+            }
+        }
+    }
+}
diff --git a/src/test/compile-fail/retslot-cast.rs b/src/test/compile-fail/retslot-cast.rs
new file mode 100644
index 00000000000..fafae0cb705
--- /dev/null
+++ b/src/test/compile-fail/retslot-cast.rs
@@ -0,0 +1,25 @@
+// Copyright 2015 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(rustc_attrs)]
+#![allow(warnings)]
+
+pub fn fail(x: Option<& (Iterator+Send)>) -> Option<&Iterator> {
+    // This call used to trigger an LLVM assertion because the return slot had type
+    // "Option<&Iterator>"* instead of "Option<&(Iterator+Send)>"*
+    inner(x)
+}
+
+pub fn inner(x: Option<& (Iterator+Send)>) -> Option<&(Iterator+Send)> {
+    x
+}
+
+#[rustc_error]
+fn main() {} //~ ERROR compilation successful
diff --git a/src/test/run-make/weird-output-filenames/Makefile b/src/test/run-make/weird-output-filenames/Makefile
index 5d6e629ffc1..3d57a2263e1 100644
--- a/src/test/run-make/weird-output-filenames/Makefile
+++ b/src/test/run-make/weird-output-filenames/Makefile
@@ -10,3 +10,6 @@ all:
 	cp foo.rs $(TMPDIR)/+foo+bar
 	$(RUSTC) $(TMPDIR)/+foo+bar 2>&1 \
 		| grep "invalid character.*in crate name:"
+	cp foo.rs $(TMPDIR)/-foo.rs
+	$(RUSTC) $(TMPDIR)/-foo.rs 2>&1 \
+		| grep "crate name cannot start with a hyphen:"
diff --git a/src/test/run-pass/borrowck-borrow-of-mut-base-ptr-safe.rs b/src/test/run-pass/borrowck-borrow-of-mut-base-ptr-safe.rs
index b7aa2989ac5..48129f2b6dd 100644
--- a/src/test/run-pass/borrowck-borrow-of-mut-base-ptr-safe.rs
+++ b/src/test/run-pass/borrowck-borrow-of-mut-base-ptr-safe.rs
@@ -11,7 +11,7 @@
 // Test that freezing an `&mut` pointer while referent is
 // frozen is legal.
 //
-// Example from src/middle/borrowck/doc.rs
+// Example from src/librustc_borrowck/borrowck/README.md
 
 fn foo<'a>(mut t0: &'a mut int,
            mut t1: &'a mut int) {
diff --git a/src/test/run-pass/extern-methods.rs b/src/test/run-pass/extern-methods.rs
new file mode 100644
index 00000000000..8fe69e40024
--- /dev/null
+++ b/src/test/run-pass/extern-methods.rs
@@ -0,0 +1,38 @@
+// Copyright 2015 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::marker::MarkerTrait;
+
+trait A : MarkerTrait {
+    extern "fastcall" fn test1(i: i32);
+    extern fn test2(i: i32);
+}
+
+struct S;
+impl S {
+    extern "stdcall" fn test3(i: i32) {
+        assert_eq!(i, 3);
+    }
+}
+
+impl A for S {
+    extern "fastcall" fn test1(i: i32) {
+        assert_eq!(i, 1);
+    }
+    extern fn test2(i: i32) {
+        assert_eq!(i, 2);
+    }
+}
+
+fn main() {
+    <S as A>::test1(1);
+    <S as A>::test2(2);
+    S::test3(3);
+}
diff --git a/src/test/run-pass/issue-22426.rs b/src/test/run-pass/issue-22426.rs
new file mode 100644
index 00000000000..b1c8f9c23c5
--- /dev/null
+++ b/src/test/run-pass/issue-22426.rs
@@ -0,0 +1,16 @@
+// Copyright 2015 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.
+
+fn main() {
+  match 42 {
+    x if x < 7 => (),
+    _ => ()
+  }
+}
diff --git a/src/test/run-pass/lang-item-public.rs b/src/test/run-pass/lang-item-public.rs
index 9c0da173f7f..6f5ded6c475 100644
--- a/src/test/run-pass/lang-item-public.rs
+++ b/src/test/run-pass/lang-item-public.rs
@@ -10,7 +10,6 @@
 
 // aux-build:lang-item-public.rs
 // ignore-android
-// ignore-windows #13361
 
 #![feature(lang_items, start, no_std)]
 #![no_std]
diff --git a/src/test/run-pass/unwind-resource.rs b/src/test/run-pass/unwind-resource.rs
index 52c09aadfbd..449e500edbe 100644
--- a/src/test/run-pass/unwind-resource.rs
+++ b/src/test/run-pass/unwind-resource.rs
@@ -37,7 +37,8 @@ fn f(tx: Sender<bool>) {
 
 pub fn main() {
     let (tx, rx) = channel();
-    let _t = thread::spawn(move|| f(tx.clone()));
+    let t = thread::spawn(move|| f(tx.clone()));
     println!("hiiiiiiiii");
     assert!(rx.recv().unwrap());
+    drop(t.join());
 }
diff --git a/src/test/run-pass/unwind-unique.rs b/src/test/run-pass/unwind-unique.rs
index d38b6e79eba..4d90f71c830 100644
--- a/src/test/run-pass/unwind-unique.rs
+++ b/src/test/run-pass/unwind-unique.rs
@@ -19,5 +19,6 @@ fn f() {
 }
 
 pub fn main() {
-    let _t = thread::spawn(f);
+    let t = thread::spawn(f);
+    drop(t.join());
 }