]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #106873 - BoxyUwU:ty_const_formatting, r=compiler-errors
authorMatthias Krüger <matthias.krueger@famsik.de>
Wed, 18 Jan 2023 05:59:20 +0000 (06:59 +0100)
committerGitHub <noreply@github.com>
Wed, 18 Jan 2023 05:59:20 +0000 (06:59 +0100)
dont randomly use `_` to print out const generic arguments

const generics seem to get printed out as `_` for no reason a lot of the time, as someone who spends a lot of time with const generics this has gotten :sparkles: very annoying :sparkles:. Latest example would be #106423 where the ICE messaged formatted a `ty::Const` containing no infer vars, as `_`.

For some reason printing of the const argument on arrays was custom instead of using the existing logic for printing `ty::Const`. Additionally the existing logic for printing `ty::Const` would print out `_` for anon consts that are in a separate crate leading to weird diagnostics (see second commit). There ought to be less cases of consts randomly getting printed as `_` hiding valuable info now.


Trivial merge