diff options
Diffstat (limited to 'src/test')
5 files changed, 28 insertions, 28 deletions
diff --git a/src/test/ui/borrowck/issue-45983.nll.stderr b/src/test/ui/borrowck/issue-45983.nll.stderr index 4edec568737..64086cb0791 100644 --- a/src/test/ui/borrowck/issue-45983.nll.stderr +++ b/src/test/ui/borrowck/issue-45983.nll.stderr @@ -4,15 +4,15 @@ warning: not reporting region error due to nll LL | give_any(|y| x = Some(y)); | ^ -error: unsatisfied lifetime constraints +error: borrowed data escapes outside of closure --> $DIR/issue-45983.rs:17:18 | LL | let x = None; - | - lifetime `'2` appears in the type of `x` + | - `x` is declared here, outside of the closure body LL | give_any(|y| x = Some(y)); - | - ^^^^^^^^^^^ assignment requires that `'1` must outlive `'2` + | - ^^^^^^^^^^^ `y` escapes the closure body here | | - | lifetime `'1` appears in this argument + | `y` is a reference that is only valid in the closure body error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/issue-45983.rs:17:18 diff --git a/src/test/ui/borrowck/regions-escape-bound-fn-2.nll.stderr b/src/test/ui/borrowck/regions-escape-bound-fn-2.nll.stderr index a162d9ea7f1..1a18817e943 100644 --- a/src/test/ui/borrowck/regions-escape-bound-fn-2.nll.stderr +++ b/src/test/ui/borrowck/regions-escape-bound-fn-2.nll.stderr @@ -4,15 +4,15 @@ warning: not reporting region error due to nll LL | with_int(|y| x = Some(y)); | ^ -error: unsatisfied lifetime constraints +error: borrowed data escapes outside of closure --> $DIR/regions-escape-bound-fn-2.rs:18:18 | LL | let mut x = None; - | ----- lifetime `'2` appears in the type of `x` + | ----- `x` is declared here, outside of the closure body LL | with_int(|y| x = Some(y)); - | - ^^^^^^^^^^^ assignment requires that `'1` must outlive `'2` + | - ^^^^^^^^^^^ `y` escapes the closure body here | | - | lifetime `'1` appears in this argument + | `y` is a reference that is only valid in the closure body error: aborting due to previous error diff --git a/src/test/ui/borrowck/regions-escape-bound-fn.nll.stderr b/src/test/ui/borrowck/regions-escape-bound-fn.nll.stderr index af5db0e3ff6..62ea9a0854b 100644 --- a/src/test/ui/borrowck/regions-escape-bound-fn.nll.stderr +++ b/src/test/ui/borrowck/regions-escape-bound-fn.nll.stderr @@ -4,15 +4,15 @@ warning: not reporting region error due to nll LL | with_int(|y| x = Some(y)); | ^^^^^^^ -error: unsatisfied lifetime constraints +error: borrowed data escapes outside of closure --> $DIR/regions-escape-bound-fn.rs:18:18 | LL | let mut x: Option<&isize> = None; - | ----- lifetime `'2` appears in the type of `x` + | ----- `x` is declared here, outside of the closure body LL | with_int(|y| x = Some(y)); - | - ^^^^^^^^^^^ assignment requires that `'1` must outlive `'2` + | - ^^^^^^^^^^^ `y` escapes the closure body here | | - | lifetime `'1` appears in this argument + | `y` is a reference that is only valid in the closure body error: aborting due to previous error diff --git a/src/test/ui/borrowck/regions-escape-unboxed-closure.nll.stderr b/src/test/ui/borrowck/regions-escape-unboxed-closure.nll.stderr index df93a1204b2..44eead9fb5a 100644 --- a/src/test/ui/borrowck/regions-escape-unboxed-closure.nll.stderr +++ b/src/test/ui/borrowck/regions-escape-unboxed-closure.nll.stderr @@ -4,15 +4,15 @@ warning: not reporting region error due to nll LL | with_int(&mut |y| x = Some(y)); | ^^^^^^^ -error: unsatisfied lifetime constraints +error: borrowed data escapes outside of closure --> $DIR/regions-escape-unboxed-closure.rs:16:23 | LL | let mut x: Option<&isize> = None; - | ----- lifetime `'2` appears in the type of `x` + | ----- `x` is declared here, outside of the closure body LL | with_int(&mut |y| x = Some(y)); - | - ^^^^^^^^^^^ assignment requires that `'1` must outlive `'2` + | - ^^^^^^^^^^^ `y` escapes the closure body here | | - | lifetime `'1` appears in this argument + | `y` is a reference that is only valid in the closure body error: aborting due to previous error diff --git a/src/test/ui/closure-expected-type/expect-region-supply-region.nll.stderr b/src/test/ui/closure-expected-type/expect-region-supply-region.nll.stderr index 1559b35c446..8658c618bf2 100644 --- a/src/test/ui/closure-expected-type/expect-region-supply-region.nll.stderr +++ b/src/test/ui/closure-expected-type/expect-region-supply-region.nll.stderr @@ -22,37 +22,37 @@ warning: not reporting region error due to nll LL | f = Some(x); | ^^^^^^^ -error: unsatisfied lifetime constraints +error: borrowed data escapes outside of closure --> $DIR/expect-region-supply-region.rs:28:9 | LL | let mut f: Option<&u32> = None; - | ----- lifetime `'2` appears in the type of `f` + | ----- `f` is declared here, outside of the closure body LL | closure_expecting_bound(|x| { - | - lifetime `'1` appears in this argument + | - `x` is a reference that is only valid in the closure body LL | f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure - | ^^^^^^^^^^^ assignment requires that `'1` must outlive `'2` + | ^^^^^^^^^^^ `x` escapes the closure body here -error: unsatisfied lifetime constraints +error: borrowed data escapes outside of closure --> $DIR/expect-region-supply-region.rs:38:9 | LL | let mut f: Option<&u32> = None; - | ----- lifetime `'2` appears in the type of `f` + | ----- `f` is declared here, outside of the closure body LL | closure_expecting_bound(|x: &u32| { - | - let's call the lifetime of this reference `'1` + | - `x` is a reference that is only valid in the closure body LL | f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure - | ^^^^^^^^^^^ assignment requires that `'1` must outlive `'2` + | ^^^^^^^^^^^ `x` escapes the closure body here -error: unsatisfied lifetime constraints +error: borrowed data escapes outside of closure --> $DIR/expect-region-supply-region.rs:52:9 | LL | let mut f: Option<&u32> = None; - | ----- lifetime `'2` appears in the type of `f` + | ----- `f` is declared here, outside of the closure body ... LL | closure_expecting_bound(|x: &'x u32| { - | - let's call the lifetime of this reference `'1` + | - `x` is a reference that is only valid in the closure body ... LL | f = Some(x); - | ^^^^^^^^^^^ assignment requires that `'1` must outlive `'2` + | ^^^^^^^^^^^ `x` escapes the closure body here error: aborting due to 3 previous errors |
