mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 11:05:36 +00:00
Replace most `Ty::new_fn_def` calls with `type_of` queries directly This is so we can reduce the amount of code and changes in rust-lang/rust#159403. It should stand on its own, but really it's meant as an extended part of 159403. This allows getting the right `ty::FnDef` even cross-crate, as the `type_of` query results are stored in metadata, in contrast to the queries for computing the binder for various declarations. These binders are already cached via `fn_sig`, but using that is somewhat overkill and can cause cycle errors in some cases.
For high-level intro to how type checking works in rustc, see the hir typeck chapter of the rustc dev guide.