immunant / c2rust

Migrate C code to Rust
https://c2rust.com/
Other
3.91k stars 229 forks source link

analyze: bring static handling in line with locals #911

Closed spernsteiner closed 1 year ago

spernsteiner commented 1 year ago

Gives statics separate addr_of_static (PointerId) and static_tys (LTy) information, analogous to addr_of_local and local_tys. Previously they had only a single LTy based on tcx.static_ptr_ty(did), which gives somewhat weird results (it's either a RawPtr or a Ref depending on whether or not the static is declared as mut).