about summary refs log tree commit diff
path: root/src/test/ui/span
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2018-04-12 12:25:29 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2018-04-18 15:37:18 +0200
commitea454746b31cfdd1c9f08b3ea11fff4ef19b58e7 (patch)
tree3c740ff9f29cb763ac34a34b393aaa63d2a30c6d /src/test/ui/span
parent02a7809f1c10ceab7ffe4652f1211cdc3c6fd4c1 (diff)
downloadrust-ea454746b31cfdd1c9f08b3ea11fff4ef19b58e7.tar.gz
rust-ea454746b31cfdd1c9f08b3ea11fff4ef19b58e7.zip
Update the previously checkpointed (but unused by bors) tests to reflect current reality.
Diffstat (limited to 'src/test/ui/span')
-rw-r--r--src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr2
-rw-r--r--src/test/ui/span/borrowck-object-mutability.nll.stderr2
-rw-r--r--src/test/ui/span/destructor-restrictions.nll.stderr16
-rw-r--r--src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr30
-rw-r--r--src/test/ui/span/wf-method-late-bound-regions.nll.stderr20
-rw-r--r--src/test/ui/span/wf-method-late-bound-regions.rs4
6 files changed, 60 insertions, 14 deletions
diff --git a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr
index 505ee95088f..26e9ea4dc0b 100644
--- a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr
+++ b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr
@@ -24,7 +24,7 @@ error[E0596]: cannot borrow immutable item `*f.f` as mutable
 LL |     f.f.call_mut(())
    |     ^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*f`
+   = note: the value which is causing this path not to be mutable is...: `*f`
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/borrowck-call-is-borrow-issue-12224.rs:66:13
diff --git a/src/test/ui/span/borrowck-object-mutability.nll.stderr b/src/test/ui/span/borrowck-object-mutability.nll.stderr
index 100b5ae150a..9b5e084bd37 100644
--- a/src/test/ui/span/borrowck-object-mutability.nll.stderr
+++ b/src/test/ui/span/borrowck-object-mutability.nll.stderr
@@ -10,7 +10,7 @@ error[E0596]: cannot borrow immutable item `*x` as mutable
 LL |     x.borrowed_mut(); //~ ERROR cannot borrow
    |     ^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `x`
+   = note: the value which is causing this path not to be mutable is...: `x`
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/span/destructor-restrictions.nll.stderr b/src/test/ui/span/destructor-restrictions.nll.stderr
index e69de29bb2d..5de246cbb73 100644
--- a/src/test/ui/span/destructor-restrictions.nll.stderr
+++ b/src/test/ui/span/destructor-restrictions.nll.stderr
@@ -0,0 +1,16 @@
+error[E0597]: `*a` does not live long enough
+  --> $DIR/destructor-restrictions.rs:18:10
+   |
+LL |         *a.borrow() + 1
+   |          ^---------
+   |          |
+   |          borrowed value does not live long enough
+   |          borrow may end up in a temporary, created here
+LL |     }; //~^ ERROR `*a` does not live long enough
+   |     -- temporary later dropped here, potentially using the reference
+   |     |
+   |     borrowed value only lives until here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0597`.
diff --git a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr
index e69de29bb2d..56f2d14390e 100644
--- a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr
+++ b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr
@@ -0,0 +1,30 @@
+error[E0597]: `y` does not live long enough
+  --> $DIR/issue-23338-locals-die-before-temps-of-body.rs:20:5
+   |
+LL |     y.borrow().clone()
+   |     ^---------
+   |     |
+   |     borrowed value does not live long enough
+   |     borrow may end up in a temporary, created here
+LL | }
+   | -
+   | |
+   | borrowed value only lives until here
+   | temporary later dropped here, potentially using the reference
+
+error[E0597]: `y` does not live long enough
+  --> $DIR/issue-23338-locals-die-before-temps-of-body.rs:27:9
+   |
+LL |         y.borrow().clone()
+   |         ^---------
+   |         |
+   |         borrowed value does not live long enough
+   |         borrow may end up in a temporary, created here
+LL |     };
+   |     -- temporary later dropped here, potentially using the reference
+   |     |
+   |     borrowed value only lives until here
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0597`.
diff --git a/src/test/ui/span/wf-method-late-bound-regions.nll.stderr b/src/test/ui/span/wf-method-late-bound-regions.nll.stderr
index a175cf1b38a..063ac376b05 100644
--- a/src/test/ui/span/wf-method-late-bound-regions.nll.stderr
+++ b/src/test/ui/span/wf-method-late-bound-regions.nll.stderr
@@ -1,14 +1,14 @@
-error: compilation successful
-  --> $DIR/wf-method-late-bound-regions.rs:25:1
+error[E0597]: `pointer` does not live long enough
+  --> $DIR/wf-method-late-bound-regions.rs:30:18
    |
-LL | / fn main() { #![rustc_error] // rust-lang/rust#49855
-LL | |     let f = Foo(None);
-LL | |     let f2 = f;
-LL | |     let dangling = {
-...  |
-LL | |     println!("{}", dangling);
-LL | | }
-   | |_^
+LL |         f2.xmute(&pointer)
+   |                  ^^^^^^^^ borrowed value does not live long enough
+LL |     };
+   |     - borrowed value only lives until here
+LL |     //~^^ ERROR `pointer` does not live long enough
+LL |     println!("{}", dangling);
+   |                    -------- borrow later used here
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0597`.
diff --git a/src/test/ui/span/wf-method-late-bound-regions.rs b/src/test/ui/span/wf-method-late-bound-regions.rs
index 317cd395d0a..d58c29d4a32 100644
--- a/src/test/ui/span/wf-method-late-bound-regions.rs
+++ b/src/test/ui/span/wf-method-late-bound-regions.rs
@@ -11,7 +11,7 @@
 // A method's receiver must be well-formed, even if it has late-bound regions.
 // Because of this, a method's substs being well-formed does not imply that
 // the method's implied bounds are met.
-#![feature(rustc_attrs)]
+
 struct Foo<'b>(Option<&'b ()>);
 
 trait Bar<'b> {
@@ -22,7 +22,7 @@ impl<'b> Bar<'b> for Foo<'b> {
     fn xmute<'a>(&'a self, u: &'b u32) -> &'a u32 { u }
 }
 
-fn main() { #![rustc_error] // rust-lang/rust#49855
+fn main() {
     let f = Foo(None);
     let f2 = f;
     let dangling = {