1
Fork 0

Auto merge of #110811 - compiler-errors:vars-are-question-mark, r=WaffleLapkin

Use `?0` notation for ty/ct/int/float/region vars

Aligns the notation for infer vars that T-types and friends most often uses for inference variables with the notation in the compiler (which is kinda a sigil nightmare IMO: `_#`) by adopting `?0` style infer vars.

This mostly affects debug output since verbose infer vars shouldn't show up in user-facing places.

Does this need an MCP? It's debug output, so I'm thinking no, but happy to open one. 🤔

r? types
This commit is contained in:
bors 2023-04-25 22:11:09 +00:00
commit f33379b0a6
46 changed files with 307 additions and 307 deletions

View file

@ -95,7 +95,7 @@ impl<'tcx> fmt::Debug for ty::FnSig<'tcx> {
impl<'tcx> fmt::Debug for ty::ConstVid<'tcx> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "_#{}c", self.index)
write!(f, "?{}c", self.index)
}
}

View file

@ -1436,7 +1436,7 @@ pub struct ConstVid<'tcx> {
rustc_index::newtype_index! {
/// A **region** (lifetime) **v**ariable **ID**.
#[derive(HashStable)]
#[debug_format = "'_#{}r"]
#[debug_format = "'?{}"]
pub struct RegionVid {}
}

View file

@ -537,7 +537,7 @@ pub struct FloatVarValue(pub FloatTy);
rustc_index::newtype_index! {
/// A **ty**pe **v**ariable **ID**.
#[debug_format = "_#{}t"]
#[debug_format = "?{}t"]
pub struct TyVid {}
}
@ -739,13 +739,13 @@ impl fmt::Debug for FloatVarValue {
impl fmt::Debug for IntVid {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "_#{}i", self.index)
write!(f, "?{}i", self.index)
}
}
impl fmt::Debug for FloatVid {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "_#{}f", self.index)
write!(f, "?{}f", self.index)
}
}