Skip to content

Commit 18089df

Browse files
committed
Fix ICE and invalid filenames in MIR printing code
1 parent de111e6 commit 18089df

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustc_mir/util/pretty.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ fn dump_path(
197197
.chars()
198198
.filter_map(|c| match c {
199199
' ' => None,
200-
':' => Some('_'),
200+
':' | '<' | '>' => Some('_'),
201201
c => Some(c)
202202
}));
203203
s
@@ -603,7 +603,8 @@ fn write_mir_sig(
603603
match (descr, src.promoted) {
604604
(_, Some(i)) => write!(w, "{:?} in ", i)?,
605605
(Some(Def::StructCtor(..)), _) => write!(w, "struct ")?,
606-
(Some(Def::Const(_)), _) => write!(w, "const ")?,
606+
(Some(Def::Const(_)), _)
607+
| (Some(Def::AssociatedConst(_)), _) => write!(w, "const ")?,
607608
(Some(Def::Static(_, /*is_mutbl*/false)), _) => write!(w, "static ")?,
608609
(Some(Def::Static(_, /*is_mutbl*/true)), _) => write!(w, "static mut ")?,
609610
(_, _) if is_function => write!(w, "fn ")?,

0 commit comments

Comments
 (0)