]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_codegen_llvm/debuginfo/metadata.rs
Rollup merge of #69771 - GuillaumeGomez:cleanup-e0390, r=Dylan-DPC
[rust.git] / src / librustc_codegen_llvm / debuginfo / metadata.rs
index d1f70ad43bd2888622e7b9ff283f35d7a56917dd..9e52598f2e05a4b1a5f914bf5a8904f7424f93d3 100644 (file)
@@ -32,6 +32,7 @@
 use rustc::ty::Instance;
 use rustc::ty::{self, AdtKind, ParamEnv, Ty, TyCtxt};
 use rustc::{bug, span_bug};
+use rustc_ast::ast;
 use rustc_codegen_ssa::traits::*;
 use rustc_data_structures::const_cstr;
 use rustc_data_structures::fingerprint::Fingerprint;
@@ -45,7 +46,6 @@
 use rustc_span::symbol::{Interner, Symbol};
 use rustc_span::{self, FileName, Span};
 use rustc_target::abi::HasDataLayout;
-use syntax::ast;
 
 use libc::{c_longlong, c_uint};
 use std::collections::hash_map::Entry;
@@ -637,7 +637,7 @@ pub fn type_metadata(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>, usage_site_span: Sp
                 unsafe {
                     // The choice of type here is pretty arbitrary -
                     // anything reading the debuginfo for a recursive
-                    // type is going to see *somthing* weird - the only
+                    // type is going to see *something* weird - the only
                     // question is what exactly it will see.
                     let (size, align) = cx.size_and_align_of(t);
                     llvm::LLVMRustDIBuilderCreateBasicType(
@@ -2135,7 +2135,7 @@ fn set_members_of_composite_type(
 /// Computes the type parameters for a type, if any, for the given metadata.
 fn compute_type_parameters(cx: &CodegenCx<'ll, 'tcx>, ty: Ty<'tcx>) -> Option<&'ll DIArray> {
     if let ty::Adt(def, substs) = ty.kind {
-        if !substs.types().next().is_none() {
+        if substs.types().next().is_some() {
             let generics = cx.tcx.generics_of(def.did);
             let names = get_parameter_names(cx, generics);
             let template_params: Vec<_> = substs
@@ -2269,10 +2269,6 @@ pub fn create_global_var_metadata(cx: &CodegenCx<'ll, '_>, def_id: DefId, global
     let tcx = cx.tcx;
     let attrs = tcx.codegen_fn_attrs(def_id);
 
-    if attrs.flags.contains(CodegenFnAttrFlags::NO_DEBUG) {
-        return;
-    }
-
     let no_mangle = attrs.flags.contains(CodegenFnAttrFlags::NO_MANGLE);
     // We may want to remove the namespace scope if we're in an extern block (see
     // https://github.com/rust-lang/rust/pull/46457#issuecomment-351750952).