about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-05-28 19:52:16 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-05-28 19:52:16 +0530
commitedd7d422b7269d68e63d475869c287ef9fdad1cd (patch)
treed9177e3b4ac7d6b27bd76bd022c6b5cc6004ba67 /src/test
parent6e897d78ae41872ab311aa76dcf856a707b66250 (diff)
parent040fc94b4eaeb24b6da297a763a28df66473e34d (diff)
downloadrust-edd7d422b7269d68e63d475869c287ef9fdad1cd.tar.gz
rust-edd7d422b7269d68e63d475869c287ef9fdad1cd.zip
Rollup merge of #33852 - arielb1:autoderef-iterator, r=eddyb
refactor autoderef to avoid prematurely registering obligations

Refactor `FnCtxt::autoderef` to use an external iterator and to not
register any obligation from the main autoderef loop, but rather to
register them after (and if) the loop successfully completes.

Fixes #24819
Fixes #25801
Fixes #27631
Fixes #31258
Fixes #31964
Fixes #32320
Fixes #33515
Fixes #33755

r? @eddyb
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/E0055.rs1
-rw-r--r--src/test/compile-fail/borrowck/borrowck-borrow-overloaded-auto-deref-mut.rs2
-rw-r--r--src/test/compile-fail/issue-24819.rs21
-rw-r--r--src/test/compile-fail/regions-bound-missing-bound-in-impl.rs3
-rw-r--r--src/test/compile-fail/regions-trait-1.rs2
5 files changed, 25 insertions, 4 deletions
diff --git a/src/test/compile-fail/E0055.rs b/src/test/compile-fail/E0055.rs
index cb78f4b3bb5..f86d7ec114b 100644
--- a/src/test/compile-fail/E0055.rs
+++ b/src/test/compile-fail/E0055.rs
@@ -19,5 +19,4 @@ fn main() {
     let foo = Foo;
     let ref_foo = &&Foo;
     ref_foo.foo(); //~ ERROR E0055
-                   //~^ ERROR E0275
 }
diff --git a/src/test/compile-fail/borrowck/borrowck-borrow-overloaded-auto-deref-mut.rs b/src/test/compile-fail/borrowck/borrowck-borrow-overloaded-auto-deref-mut.rs
index 497b0e63edf..764d05be879 100644
--- a/src/test/compile-fail/borrowck/borrowck-borrow-overloaded-auto-deref-mut.rs
+++ b/src/test/compile-fail/borrowck/borrowck-borrow-overloaded-auto-deref-mut.rs
@@ -99,7 +99,7 @@ fn assign_field1<'a>(x: Own<Point>) {
 }
 
 fn assign_field2<'a>(x: &'a Own<Point>) {
-    x.y = 3; //~ ERROR cannot assign
+    x.y = 3; //~ ERROR cannot borrow
 }
 
 fn assign_field3<'a>(x: &'a mut Own<Point>) {
diff --git a/src/test/compile-fail/issue-24819.rs b/src/test/compile-fail/issue-24819.rs
new file mode 100644
index 00000000000..52f5f1cd079
--- /dev/null
+++ b/src/test/compile-fail/issue-24819.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.
+
+use std::collections::HashSet;
+
+fn main() {
+    let mut v = Vec::new();
+    foo(&mut v);
+    //~^ ERROR mismatched types
+    //~| expected struct `std::collections::HashSet`, found struct `std::vec::Vec`
+}
+
+fn foo(h: &mut HashSet<u32>) {
+}
diff --git a/src/test/compile-fail/regions-bound-missing-bound-in-impl.rs b/src/test/compile-fail/regions-bound-missing-bound-in-impl.rs
index abffd33e3f8..6e60a373d9b 100644
--- a/src/test/compile-fail/regions-bound-missing-bound-in-impl.rs
+++ b/src/test/compile-fail/regions-bound-missing-bound-in-impl.rs
@@ -34,7 +34,8 @@ impl<'a, 't> Foo<'a, 't> for &'a isize {
     }
 
     fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
-        //~^ ERROR method `wrong_bound1` has an incompatible type for trait
+        //~^ ERROR method not compatible with trait
+        //~^^ ERROR method not compatible with trait
         //
         // Note: This is a terrible error message. It is caused
         // because, in the trait, 'b is early bound, and in the impl,
diff --git a/src/test/compile-fail/regions-trait-1.rs b/src/test/compile-fail/regions-trait-1.rs
index 01439ce5e68..9cd08656b62 100644
--- a/src/test/compile-fail/regions-trait-1.rs
+++ b/src/test/compile-fail/regions-trait-1.rs
@@ -23,7 +23,7 @@ impl<'a> get_ctxt for has_ctxt<'a> {
 
     // Here an error occurs because we used `&self` but
     // the definition used `&`:
-    fn get_ctxt(&self) -> &'a ctxt { //~ ERROR method `get_ctxt` has an incompatible type
+    fn get_ctxt(&self) -> &'a ctxt { //~ ERROR method not compatible with trait
         self.c
     }