2023-01-02 17:18:00 -06:00
|
|
|
// compile-flags: -Z trait-solver=chalk
|
2020-05-27 00:05:09 -05:00
|
|
|
|
|
|
|
fn main() -> () {
|
|
|
|
let t = || {};
|
|
|
|
t();
|
|
|
|
|
|
|
|
let mut a = 0;
|
|
|
|
let mut b = move || {
|
|
|
|
a = 1;
|
|
|
|
};
|
|
|
|
b();
|
|
|
|
|
|
|
|
let mut c = b;
|
|
|
|
|
|
|
|
c();
|
|
|
|
b();
|
|
|
|
|
|
|
|
let mut a = 0;
|
|
|
|
let mut b = || {
|
|
|
|
a = 1;
|
|
|
|
};
|
|
|
|
b();
|
|
|
|
|
|
|
|
let mut c = b;
|
|
|
|
|
|
|
|
c();
|
2022-11-13 13:53:35 -06:00
|
|
|
b(); //~ ERROR
|
2020-05-27 00:05:09 -05:00
|
|
|
|
|
|
|
// FIXME(chalk): this doesn't quite work
|
|
|
|
/*
|
|
|
|
let b = |c| {
|
|
|
|
c
|
|
|
|
};
|
|
|
|
|
|
|
|
let a = &32;
|
|
|
|
b(a);
|
|
|
|
*/
|
|
|
|
}
|