about summary refs log tree commit diff
path: root/src/librustc/ty
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-01-09 00:22:05 +0100
committerGitHub <noreply@github.com>2020-01-09 00:22:05 +0100
commit60bef14bbc030f4b129de4967e5a9302067d1712 (patch)
tree5e991335c214dcb0f20c8c873a34940c44b5e335 /src/librustc/ty
parentcaa231d998a5e853c7ba1455d7a05b500df9d63c (diff)
parent097e14d19d6b74ab0a37846ae323862ace6ac259 (diff)
downloadrust-60bef14bbc030f4b129de4967e5a9302067d1712.tar.gz
rust-60bef14bbc030f4b129de4967e5a9302067d1712.zip
Rollup merge of #67630 - oli-obk:extern_ptr_dangling, r=spastorino
Treat extern statics just like statics in the "const pointer to static" representation

fixes #67612

r? @spastorino

cc @RalfJung this does not affect runtime promotion at all. This is just about promotion within static item bodies.
Diffstat (limited to 'src/librustc/ty')
-rw-r--r--src/librustc/ty/util.rs2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/librustc/ty/util.rs b/src/librustc/ty/util.rs
index aa93f35661a..ddff8258c6d 100644
--- a/src/librustc/ty/util.rs
+++ b/src/librustc/ty/util.rs
@@ -533,8 +533,6 @@ impl<'tcx> TyCtxt<'tcx> {
 
         if self.is_mutable_static(def_id) {
             self.mk_mut_ptr(static_ty)
-        } else if self.is_foreign_item(def_id) {
-            self.mk_imm_ptr(static_ty)
         } else {
             self.mk_imm_ref(self.lifetimes.re_erased, static_ty)
         }