]> git.proxmox.com Git - rustc.git/blame - src/test/ui/nll/guarantor-issue-46974.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / nll / guarantor-issue-46974.stderr
CommitLineData
2c00a5a8 1error[E0506]: cannot assign to `*s` because it is borrowed
923072b8 2 --> $DIR/guarantor-issue-46974.rs:7:5
2c00a5a8 3 |
0531ce1d 4LL | let t = &mut *s; // this borrow should last for the entire function
2c00a5a8 5 | ------- borrow of `*s` occurs here
0531ce1d 6LL | let x = &t.0;
532ac7d7 7LL | *s = (2,);
2c00a5a8 8 | ^^^^^^^^^ assignment to borrowed `*s` occurs here
0531ce1d
XL
9LL | *x
10 | -- borrow later used here
2c00a5a8 11
3c0e092e 12error: lifetime may not live long enough
923072b8 13 --> $DIR/guarantor-issue-46974.rs:13:5
2c00a5a8 14 |
3c0e092e
XL
15LL | fn bar(s: &Box<(i32,)>) -> &'static i32 {
16 | - let's call the lifetime of this reference `'1`
17LL | // FIXME(#46983): error message should be better
532ac7d7 18LL | &s.0
3c0e092e 19 | ^^^^ returning this value requires that `'1` must outlive `'static`
2c00a5a8
XL
20
21error: aborting due to 2 previous errors
22
3c0e092e 23For more information about this error, try `rustc --explain E0506`.