Skip to content

Commit

Permalink
actually print out non local anon consts
Browse files Browse the repository at this point in the history
  • Loading branch information
BoxyUwU committed Jan 18, 2023
1 parent 88f81a0 commit a2a50f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_middle/src/ty/print/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1295,10 +1295,10 @@ pub trait PrettyPrinter<'tcx>:
if let Ok(snip) = self.tcx().sess.source_map().span_to_snippet(span) {
p!(write("{}", snip))
} else {
print_underscore!()
p!(print_value_path(def.did, substs))
}
} else {
print_underscore!()
p!(print_value_path(def.did, substs))
}
}
defkind => bug!("`{:?}` has unexpcted defkind {:?}", ct, defkind),
Expand All @@ -1323,7 +1323,7 @@ pub trait PrettyPrinter<'tcx>:
ty::ConstKind::Placeholder(placeholder) => p!(write("Placeholder({:?})", placeholder)),
// FIXME(generic_const_exprs):
// write out some legible representation of an abstract const?
ty::ConstKind::Expr(_) => p!("[Const Expr]"),
ty::ConstKind::Expr(_) => p!("[const expr]"),
ty::ConstKind::Error(_) => p!("[const error]"),
};
Ok(self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ error[E0308]: mismatched types
--> $DIR/non_local_anon_const_diagnostics.rs:12:43
|
LL | let _: anon_const_non_local::Foo<2> = anon_const_non_local::foo::<M>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2`, found `_`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2`, found `foo::<M>::{constant#0}`
|
= note: expected constant `2`
found constant `_`
found constant `foo::<M>::{constant#0}`

error: aborting due to previous error

Expand Down

0 comments on commit a2a50f9

Please sign in to comment.