about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-03-24 23:46:45 +0000
committerbors <bors@rust-lang.org>2017-03-24 23:46:45 +0000
commit49c67bd632e961a57863805e5d0a400f97da9b93 (patch)
tree3da290aa9669da04e3459c648f9cb3155fb34177 /src/test
parent3da40237e542e7859adab48049ec15cf18154817 (diff)
parent6cd46603a4cc713be0a203f187bae809fed43b19 (diff)
Auto merge of #40806 - frewsxcv:rollup, r=frewsxcv
Rollup of 8 pull requests

- Successful merges: #40567, #40602, #40636, #40739, #40756, #40790, #40794, #40803
- Failed merges:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/issue-10176.rs (renamed from src/test/run-pass/inference-changes-39485.rs)8
-rw-r--r--src/test/compile-fail/issue-5500.rs17
-rw-r--r--src/test/run-pass/issue-15763.rs7
-rw-r--r--src/test/run-pass/issue-39984.rs21
-rw-r--r--src/test/run-pass/project-defer-unification.rs4
5 files changed, 46 insertions, 11 deletions
diff --git a/src/test/run-pass/inference-changes-39485.rs b/src/test/compile-fail/issue-10176.rs
index 193c66b2a2a..434b795ff31 100644
--- a/src/test/run-pass/inference-changes-39485.rs
+++ b/src/test/compile-fail/issue-10176.rs
@@ -8,12 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn g() {
-    &panic!()
-}
-
 fn f() -> isize {
     (return 1, return 2)
+//~^ ERROR mismatched types
+//~| expected type `isize`
+//~| found type `(_, _)`
+//~| expected isize, found tuple
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/issue-5500.rs b/src/test/compile-fail/issue-5500.rs
new file mode 100644
index 00000000000..1cbb7588e17
--- /dev/null
+++ b/src/test/compile-fail/issue-5500.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.
+
+fn main() {
+    &panic!()
+    //~^ ERROR mismatched types
+    //~| expected type `()`
+    //~| found type `&_`
+    //~| expected (), found reference
+}
diff --git a/src/test/run-pass/issue-15763.rs b/src/test/run-pass/issue-15763.rs
index f77888c2955..0baaaac2676 100644
--- a/src/test/run-pass/issue-15763.rs
+++ b/src/test/run-pass/issue-15763.rs
@@ -8,8 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unused_features)]
-#![allow(unreachable_code)]
+#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 #[derive(PartialEq, Debug)]
@@ -29,14 +28,14 @@ struct Foo {
 }
 
 fn foo() -> Result<Foo, isize> {
-    return Ok::<Foo, isize>(Foo {
+    return Ok(Foo {
         x: Bar { x: 22 },
         a: return Err(32)
     });
 }
 
 fn baz() -> Result<Foo, isize> {
-    Ok::<Foo, isize>(Foo {
+    Ok(Foo {
         x: Bar { x: 22 },
         a: return Err(32)
     })
diff --git a/src/test/run-pass/issue-39984.rs b/src/test/run-pass/issue-39984.rs
new file mode 100644
index 00000000000..a0019e7215c
--- /dev/null
+++ b/src/test/run-pass/issue-39984.rs
@@ -0,0 +1,21 @@
+// Copyright 2016 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.
+
+// Regression test for issue #39984.
+//
+// The key here is that the error type of the `Ok` call ought to be
+// constrained to `String`, even though it is dead-code.
+
+fn main() {}
+
+fn t() -> Result<(), String> {
+    return Err("".into());
+    Ok(())
+}
diff --git a/src/test/run-pass/project-defer-unification.rs b/src/test/run-pass/project-defer-unification.rs
index 8e008c639b3..9a6ea2272fe 100644
--- a/src/test/run-pass/project-defer-unification.rs
+++ b/src/test/run-pass/project-defer-unification.rs
@@ -11,8 +11,6 @@
 // A regression test extracted from image-0.3.11. The point of
 // failure was in `index_colors` below.
 
-#![allow(unused)]
-
 use std::ops::{Deref, DerefMut};
 
 #[derive(Copy, Clone)]
@@ -94,7 +92,7 @@ pub fn index_colors<Pix>(image: &ImageBuffer<Pix, Vec<u8>>)
                          -> ImageBuffer<Luma<u8>, Vec<u8>>
 where Pix: Pixel<Subpixel=u8> + 'static,
 {
-    let mut indices: ImageBuffer<Luma<u8>, Vec<u8>> = loop { };
+    let mut indices: ImageBuffer<_,Vec<_>> = loop { };
     for (pixel, idx) in image.pixels().zip(indices.pixels_mut()) {
         // failured occurred here ^^ because we were requiring that we
         // could project Pixel or Subpixel from `T_indices` (type of