The solution I found is to force Cargo to update to compatible versions of `proc-macro2`, `syn`, etc.
so first run this:
```
cargo clean
cargo update
and then try rebuilding:
anchor build