about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2020-11-13 18:47:37 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2020-11-13 18:47:37 +0100
commit753e6bcd5f2e1be9ad05833398d6df8ebc1229d6 (patch)
tree562d35d9d0a95eeb2f85668d004920d98edde79b
parent4e547b942daf9b6786fabdb8ee52056a448d8c9f (diff)
parenta5ec85758b4b425a08b3401422543fe756f980b2 (diff)
downloadrust-753e6bcd5f2e1be9ad05833398d6df8ebc1229d6.tar.gz
rust-753e6bcd5f2e1be9ad05833398d6df8ebc1229d6.zip
Sync from rust f2a11a25378293e41cfcb00dbf67c524ffd79b39
-rw-r--r--src/archive.rs4
-rw-r--r--src/bin/cg_clif.rs4
-rw-r--r--src/common.rs12
-rw-r--r--src/debuginfo/mod.rs2
-rw-r--r--src/driver/aot.rs4
-rw-r--r--src/metadata.rs2
-rw-r--r--src/toolchain.rs4
7 files changed, 15 insertions, 17 deletions
diff --git a/src/archive.rs b/src/archive.rs
index 87cfc45be8c..96579054389 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -63,9 +63,9 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
             sess,
             dst: output.to_path_buf(),
             lib_search_paths: archive_search_paths(sess),
-            use_gnu_style_archive: sess.target.options.archive_format == "gnu",
+            use_gnu_style_archive: sess.target.archive_format == "gnu",
             // FIXME fix builtin ranlib on macOS
-            no_builtin_ranlib: sess.target.options.is_like_osx,
+            no_builtin_ranlib: sess.target.is_like_osx,
 
             src_archives,
             entries,
diff --git a/src/bin/cg_clif.rs b/src/bin/cg_clif.rs
index 891353e4b31..497c20f59d6 100644
--- a/src/bin/cg_clif.rs
+++ b/src/bin/cg_clif.rs
@@ -27,8 +27,8 @@ impl rustc_driver::Callbacks for CraneliftPassesCallbacks {
         config.opts.cg.panic = Some(PanicStrategy::Abort);
         config.opts.debugging_opts.panic_abort_tests = true;
         config.opts.maybe_sysroot = Some(
-            config.opts.maybe_sysroot.clone().unwrap_or(
-                std::env::current_exe()
+            config.opts.maybe_sysroot.clone().unwrap_or_else(
+                || std::env::current_exe()
                     .unwrap()
                     .parent()
                     .unwrap()
diff --git a/src/common.rs b/src/common.rs
index eda77bf19d3..466758f2f86 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -361,13 +361,11 @@ impl<'tcx, M: Module> FunctionCx<'_, 'tcx, M> {
     where
         T: TypeFoldable<'tcx> + Copy,
     {
-        if let Some(substs) = self.instance.substs_for_mir_body() {
-            self.tcx
-                .subst_and_normalize_erasing_regions(substs, ty::ParamEnv::reveal_all(), value)
-        } else {
-            self.tcx
-                .normalize_erasing_regions(ty::ParamEnv::reveal_all(), *value)
-        }
+        self.instance.subst_mir_and_normalize_erasing_regions(
+            self.tcx,
+            ty::ParamEnv::reveal_all(),
+            value
+        )
     }
 
     pub(crate) fn clif_type(&self, ty: Ty<'tcx>) -> Option<Type> {
diff --git a/src/debuginfo/mod.rs b/src/debuginfo/mod.rs
index cbf9522b1d7..85e8158af27 100644
--- a/src/debuginfo/mod.rs
+++ b/src/debuginfo/mod.rs
@@ -50,7 +50,7 @@ impl<'tcx> DebugContext<'tcx> {
             // TODO: this should be configurable
             // macOS doesn't seem to support DWARF > 3
             // 5 version is required for md5 file hash
-            version: if tcx.sess.target.options.is_like_osx {
+            version: if tcx.sess.target.is_like_osx {
                 3
             } else {
                 // FIXME change to version 5 once the gdb and lldb shipping with the latest debian
diff --git a/src/driver/aot.rs b/src/driver/aot.rs
index f4e8f910d24..491d6cbbf79 100644
--- a/src/driver/aot.rs
+++ b/src/driver/aot.rs
@@ -324,8 +324,8 @@ fn codegen_global_asm(tcx: TyCtxt<'_>, cgu_name: &str, global_asm: &str) {
     }
 
     if cfg!(not(feature = "inline_asm"))
-        || tcx.sess.target.options.is_like_osx
-        || tcx.sess.target.options.is_like_windows
+        || tcx.sess.target.is_like_osx
+        || tcx.sess.target.is_like_windows
     {
         if global_asm.contains("__rust_probestack") {
             return;
diff --git a/src/metadata.rs b/src/metadata.rs
index cda2a187ff9..2e3b9fb8364 100644
--- a/src/metadata.rs
+++ b/src/metadata.rs
@@ -101,7 +101,7 @@ pub(crate) fn write_metadata<P: WriteMetadata>(
     product.add_rustc_section(
         rustc_middle::middle::exported_symbols::metadata_symbol_name(tcx),
         compressed,
-        tcx.sess.target.options.is_like_osx,
+        tcx.sess.target.is_like_osx,
     );
 
     metadata
diff --git a/src/toolchain.rs b/src/toolchain.rs
index 463afaf7cc5..735c59d70c1 100644
--- a/src/toolchain.rs
+++ b/src/toolchain.rs
@@ -91,7 +91,7 @@ fn linker_and_flavor(sess: &Session) -> (PathBuf, LinkerFlavor) {
                 } else if stem == "link" || stem == "lld-link" {
                     LinkerFlavor::Msvc
                 } else if stem == "lld" || stem == "rust-lld" {
-                    LinkerFlavor::Lld(sess.target.options.lld_flavor)
+                    LinkerFlavor::Lld(sess.target.lld_flavor)
                 } else {
                     // fall back to the value in the target spec
                     sess.target.linker_flavor
@@ -115,7 +115,7 @@ fn linker_and_flavor(sess: &Session) -> (PathBuf, LinkerFlavor) {
 
     if let Some(ret) = infer_from(
         sess,
-        sess.target.options.linker.clone().map(PathBuf::from),
+        sess.target.linker.clone().map(PathBuf::from),
         Some(sess.target.linker_flavor),
     ) {
         return ret;