Skip to content

Commit

Permalink
Fix ICE and invalid filenames in MIR printing code
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewjasper committed Feb 10, 2019
1 parent de111e6 commit 18089df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/librustc_mir/util/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ fn dump_path(
.chars()
.filter_map(|c| match c {
' ' => None,
':' => Some('_'),
':' | '<' | '>' => Some('_'),
c => Some(c)
}));
s
Expand Down Expand Up @@ -603,7 +603,8 @@ fn write_mir_sig(
match (descr, src.promoted) {
(_, Some(i)) => write!(w, "{:?} in ", i)?,
(Some(Def::StructCtor(..)), _) => write!(w, "struct ")?,
(Some(Def::Const(_)), _) => write!(w, "const ")?,
(Some(Def::Const(_)), _)
| (Some(Def::AssociatedConst(_)), _) => write!(w, "const ")?,
(Some(Def::Static(_, /*is_mutbl*/false)), _) => write!(w, "static ")?,
(Some(Def::Static(_, /*is_mutbl*/true)), _) => write!(w, "static mut ")?,
(_, _) if is_function => write!(w, "fn ")?,
Expand Down

0 comments on commit 18089df

Please sign in to comment.