mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-01 17:40:16 +00:00
Fix invalid type suggestion for item nested in function
Fixes rust-lang/rust#146786
I also tried to add the `omit_parent` logic in pretty formatter here:
69b6d26d05/compiler/rustc_middle/src/ty/print/pretty.rs (L2240-L2295)
so that we don't need to add `should_omit_parent_def_path` and `reset_path`.
but seems there will be duplicate print code with `default_print_def_path`.
maybe r? @estebank
For high-level intro to how type checking works in rustc, see the hir typeck chapter of the rustc dev guide.