diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-06-25 01:00:21 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-06-30 01:53:32 +0300 |
| commit | 9f92fce77c74cf3c47035e9ff69c29daee0517b3 (patch) | |
| tree | e724e8e72a43d71053f4de32fa893a661ee163bf /src/librustc_codegen_llvm | |
| parent | 297109ea3263a4ea90a7143a82e46903a8890269 (diff) | |
| download | rust-9f92fce77c74cf3c47035e9ff69c29daee0517b3.tar.gz rust-9f92fce77c74cf3c47035e9ff69c29daee0517b3.zip | |
Fortify dummy span checking
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/debuginfo/metadata.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/debuginfo/mod.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs index 1eec57c9c87..6d727f7b048 100644 --- a/src/librustc_codegen_llvm/debuginfo/metadata.rs +++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs @@ -1662,7 +1662,7 @@ pub fn create_global_var_metadata(cx: &CodegenCx, let var_scope = get_namespace_for_item(cx, def_id); let span = tcx.def_span(def_id); - let (file_metadata, line_number) = if span != syntax_pos::DUMMY_SP { + let (file_metadata, line_number) = if !span.is_dummy() { let loc = span_start(cx, span); (file_metadata(cx, &loc.file.name, LOCAL_CRATE), loc.line as c_uint) } else { diff --git a/src/librustc_codegen_llvm/debuginfo/mod.rs b/src/librustc_codegen_llvm/debuginfo/mod.rs index 803966145f7..068dd9821ac 100644 --- a/src/librustc_codegen_llvm/debuginfo/mod.rs +++ b/src/librustc_codegen_llvm/debuginfo/mod.rs @@ -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; } |
