1 error[E0506]: cannot assign to `*s` because it is borrowed
2 --> $DIR/guarantor-issue-46974.rs:19:5
4 LL | let t = &mut *s; // this borrow should last for the entire function
5 | ------- borrow of `*s` occurs here
7 LL | *s = (2,); //~ ERROR cannot assign to `*s`
8 | ^^^^^^^^^ assignment to borrowed `*s` occurs here
10 | -- borrow later used here
12 error[E0621]: explicit lifetime required in the type of `s`
13 --> $DIR/guarantor-issue-46974.rs:25:5
15 LL | fn bar(s: &Box<(i32,)>) -> &'static i32 {
16 | ------------ help: add explicit lifetime `'static` to the type of `s`: `&'static std::boxed::Box<(i32,)>`
17 LL | // FIXME(#46983): error message should be better
18 LL | &s.0 //~ ERROR explicit lifetime required in the type of `s` [E0621]
19 | ^^^^ lifetime `'static` required
21 error: aborting due to 2 previous errors
23 Some errors occurred: E0506, E0621.
24 For more information about an error, try `rustc --explain E0506`.