Skip to content

Commit 753e6bc

Browse files
committed
Sync from rust f2a11a2
2 parents 4e547b9 + a5ec857 commit 753e6bc

File tree

7 files changed

+15
-17
lines changed

7 files changed

+15
-17
lines changed

src/archive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
6363
sess,
6464
dst: output.to_path_buf(),
6565
lib_search_paths: archive_search_paths(sess),
66-
use_gnu_style_archive: sess.target.options.archive_format == "gnu",
66+
use_gnu_style_archive: sess.target.archive_format == "gnu",
6767
// FIXME fix builtin ranlib on macOS
68-
no_builtin_ranlib: sess.target.options.is_like_osx,
68+
no_builtin_ranlib: sess.target.is_like_osx,
6969

7070
src_archives,
7171
entries,

src/bin/cg_clif.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ impl rustc_driver::Callbacks for CraneliftPassesCallbacks {
2727
config.opts.cg.panic = Some(PanicStrategy::Abort);
2828
config.opts.debugging_opts.panic_abort_tests = true;
2929
config.opts.maybe_sysroot = Some(
30-
config.opts.maybe_sysroot.clone().unwrap_or(
31-
std::env::current_exe()
30+
config.opts.maybe_sysroot.clone().unwrap_or_else(
31+
|| std::env::current_exe()
3232
.unwrap()
3333
.parent()
3434
.unwrap()

src/common.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,11 @@ impl<'tcx, M: Module> FunctionCx<'_, 'tcx, M> {
361361
where
362362
T: TypeFoldable<'tcx> + Copy,
363363
{
364-
if let Some(substs) = self.instance.substs_for_mir_body() {
365-
self.tcx
366-
.subst_and_normalize_erasing_regions(substs, ty::ParamEnv::reveal_all(), value)
367-
} else {
368-
self.tcx
369-
.normalize_erasing_regions(ty::ParamEnv::reveal_all(), *value)
370-
}
364+
self.instance.subst_mir_and_normalize_erasing_regions(
365+
self.tcx,
366+
ty::ParamEnv::reveal_all(),
367+
value
368+
)
371369
}
372370

373371
pub(crate) fn clif_type(&self, ty: Ty<'tcx>) -> Option<Type> {

src/debuginfo/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl<'tcx> DebugContext<'tcx> {
5050
// TODO: this should be configurable
5151
// macOS doesn't seem to support DWARF > 3
5252
// 5 version is required for md5 file hash
53-
version: if tcx.sess.target.options.is_like_osx {
53+
version: if tcx.sess.target.is_like_osx {
5454
3
5555
} else {
5656
// FIXME change to version 5 once the gdb and lldb shipping with the latest debian

src/driver/aot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@ fn codegen_global_asm(tcx: TyCtxt<'_>, cgu_name: &str, global_asm: &str) {
324324
}
325325

326326
if cfg!(not(feature = "inline_asm"))
327-
|| tcx.sess.target.options.is_like_osx
328-
|| tcx.sess.target.options.is_like_windows
327+
|| tcx.sess.target.is_like_osx
328+
|| tcx.sess.target.is_like_windows
329329
{
330330
if global_asm.contains("__rust_probestack") {
331331
return;

src/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub(crate) fn write_metadata<P: WriteMetadata>(
101101
product.add_rustc_section(
102102
rustc_middle::middle::exported_symbols::metadata_symbol_name(tcx),
103103
compressed,
104-
tcx.sess.target.options.is_like_osx,
104+
tcx.sess.target.is_like_osx,
105105
);
106106

107107
metadata

src/toolchain.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fn linker_and_flavor(sess: &Session) -> (PathBuf, LinkerFlavor) {
9191
} else if stem == "link" || stem == "lld-link" {
9292
LinkerFlavor::Msvc
9393
} else if stem == "lld" || stem == "rust-lld" {
94-
LinkerFlavor::Lld(sess.target.options.lld_flavor)
94+
LinkerFlavor::Lld(sess.target.lld_flavor)
9595
} else {
9696
// fall back to the value in the target spec
9797
sess.target.linker_flavor
@@ -115,7 +115,7 @@ fn linker_and_flavor(sess: &Session) -> (PathBuf, LinkerFlavor) {
115115

116116
if let Some(ret) = infer_from(
117117
sess,
118-
sess.target.options.linker.clone().map(PathBuf::from),
118+
sess.target.linker.clone().map(PathBuf::from),
119119
Some(sess.target.linker_flavor),
120120
) {
121121
return ret;

0 commit comments

Comments
 (0)