Skip to content

Commit

Permalink
Make const parent errors delay_span_bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed May 10, 2019
1 parent cff1bdb commit 385d012
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/librustc_typeck/collect.rs
Expand Up @@ -1404,15 +1404,27 @@ pub fn checked_type_of<'a, 'tcx>(
if !fail {
return None;
}
bug!("unexpected const parent path def {:?}", x);
tcx.sess.delay_span_bug(
DUMMY_SP,
&format!(
"unexpected const parent path def {:?}", x
),
);
tcx.types.err
}
}
}
x => {
if !fail {
return None;
}
bug!("unexpected const parent path {:?}", x);
tcx.sess.delay_span_bug(
DUMMY_SP,
&format!(
"unexpected const parent path {:?}", x
),
);
tcx.types.err
}
}
}
Expand All @@ -1421,7 +1433,13 @@ pub fn checked_type_of<'a, 'tcx>(
if !fail {
return None;
}
bug!("unexpected const parent in type_of_def_id(): {:?}", x);
tcx.sess.delay_span_bug(
DUMMY_SP,
&format!(
"unexpected const parent in type_of_def_id(): {:?}", x
),
);
tcx.types.err
}
}
}
Expand Down

0 comments on commit 385d012

Please sign in to comment.