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