blob: 5c718638d8016a3316ef97472404f1b90675945d [file] [log] [blame] [edit]
//@ edition: 2021
//@ check-pass
#![feature(async_closure)]
pub struct Struct {
pub path: String,
}
// In `upvar.rs`, `truncate_capture_for_optimization` means that we don't actually
// capture `&(*s.path)` here, but instead just `&(*s)`, but ONLY when the upvar is
// immutable. This means that the assumption we have in `ByMoveBody` pass is wrong.
pub fn test(s: &Struct) {
let c = async move || { let path = &s.path; };
}
fn main() {}