about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/debuginfo
diff options
context:
space:
mode:
authorDavid Wood <david@davidtw.co>2020-06-22 13:57:03 +0100
committerDavid Wood <david@davidtw.co>2020-07-20 19:35:30 +0100
commit2989fea88a489a01b3e2243bb84b0ec20b8a0e28 (patch)
tree3fc7bedb5e5c8531c204b79510f7d61dd33f1e65 /src/librustc_codegen_llvm/debuginfo
parent47756bb0faaf49be5c4086fd0fdbdd57f055781b (diff)
downloadrust-2989fea88a489a01b3e2243bb84b0ec20b8a0e28.tar.gz
rust-2989fea88a489a01b3e2243bb84b0ec20b8a0e28.zip
mir: `unused_generic_params` query
This commit implements the `unused_generic_params` query, an initial
version of polymorphization which detects when an item does not use
generic parameters and is being needlessly monomorphized as a result.

Signed-off-by: David Wood <david@davidtw.co>
Diffstat (limited to 'src/librustc_codegen_llvm/debuginfo')
-rw-r--r--src/librustc_codegen_llvm/debuginfo/metadata.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs
index c34c6caa8ca..6ae7c7efaee 100644
--- a/src/librustc_codegen_llvm/debuginfo/metadata.rs
+++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs
@@ -2481,7 +2481,7 @@ pub fn create_global_var_metadata(cx: &CodegenCx<'ll, '_>, def_id: DefId, global
     };
 
     let is_local_to_unit = is_node_local_to_unit(cx, def_id);
-    let variable_type = Instance::mono(cx.tcx, def_id).monomorphic_ty(cx.tcx);
+    let variable_type = Instance::mono(cx.tcx, def_id).ty(cx.tcx, ty::ParamEnv::reveal_all());
     let type_metadata = type_metadata(cx, variable_type, span);
     let var_name = tcx.item_name(def_id).as_str();
     let linkage_name = mangled_name_of_instance(cx, Instance::mono(tcx, def_id)).name;