Fortify dummy span checking

This commit is contained in:
Vadim Petrochenkov 2018-06-25 01:00:21 +03:00
parent 297109ea32
commit 9f92fce77c
21 changed files with 59 additions and 59 deletions

View file

@ -219,7 +219,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
let span = mir.span;
// This can be the case for functions inlined from another crate
if span == syntax_pos::DUMMY_SP {
if span.is_dummy() {
// FIXME(simulacrum): Probably can't happen; remove.
return FunctionDebugContext::FunctionWithoutDebugInfo;
}