]> git.lizzy.rs Git - rust.git/commit
Improve pretty-printing of `HirIdValidator` errors
authorArpad Borsos <swatinem@swatinem.de>
Tue, 31 Jan 2023 11:09:54 +0000 (12:09 +0100)
committerArpad Borsos <swatinem@swatinem.de>
Wed, 1 Feb 2023 19:09:22 +0000 (20:09 +0100)
commit3a75f10af12e959273d19cf0f867f066e3db8add
tree5646134adee1549436ab2f6d570e70e80ade2daf
parent3b639486c17e9144a9176382ecb2a0b801263935
Improve pretty-printing of `HirIdValidator` errors

This now uses `node_to_string` for both missing and seen Ids, which includes
the snippet of code for which the Id was allocated.
Also removes the duplicated printing of `HirId`, as `node_to_string` includes that already.
Similarly, changes all other users of `node_to_string` that do so, and changes the output of `node_to_string`, which is now "$hirid ($what `$span` in $path)".
compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs
compiler/rustc_hir_typeck/src/mem_categorization.rs
compiler/rustc_middle/src/hir/map/mod.rs
compiler/rustc_middle/src/ty/context.rs
compiler/rustc_middle/src/ty/typeck_results.rs
compiler/rustc_passes/src/hir_id_validator.rs
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs