Skip to content

Commit edeb631

Browse files
committedJan 17, 2021
Auto merge of #81113 - m-ou-se:rollup-a1unz4x, r=m-ou-se
Rollup of 13 pull requests Successful merges: - #79298 (correctly deal with late-bound lifetimes in anon consts) - #80031 (resolve: Reject ambiguity built-in attr vs different built-in attr) - #80201 (Add benchmark and fast path for BufReader::read_exact) - #80635 (Improve diagnostics when closure doesn't meet trait bound) - #80765 (resolve: Simplify collection of traits in scope) - #80932 (Allow downloading LLVM on Windows and MacOS) - #80983 (Remove is_dllimport_foreign_item definition from cg_ssa) - #81064 (Support non-stage0 check) - #81080 (Force vec![] to expression position only) - #81082 (BTreeMap: clean up a few more comments) - #81084 (Use Option::map instead of open-coding it) - #81095 (Use Option::unwrap_or instead of open-coding it) - #81107 (Add NonZeroUn::is_power_of_two) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 7d38181 + 8016846 commit edeb631

File tree

60 files changed

+812
-399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+812
-399
lines changed
 

‎compiler/rustc_codegen_llvm/src/llvm_util.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,7 @@ fn handle_native(name: &str) -> &str {
214214
}
215215

216216
pub fn target_cpu(sess: &Session) -> &str {
217-
let name = match sess.opts.cg.target_cpu {
218-
Some(ref s) => &**s,
219-
None => &*sess.target.cpu,
220-
};
221-
217+
let name = sess.opts.cg.target_cpu.as_ref().unwrap_or(&sess.target.cpu);
222218
handle_native(name)
223219
}
224220

@@ -254,8 +250,6 @@ pub fn handle_native_features(sess: &Session) -> Vec<String> {
254250
}
255251

256252
pub fn tune_cpu(sess: &Session) -> Option<&str> {
257-
match sess.opts.debugging_opts.tune_cpu {
258-
Some(ref s) => Some(handle_native(&**s)),
259-
None => None,
260-
}
253+
let name = sess.opts.debugging_opts.tune_cpu.as_ref()?;
254+
Some(handle_native(name))
261255
}

‎compiler/rustc_codegen_ssa/src/base.rs

-27
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ use rustc_middle::ty::query::Providers;
2929
use rustc_middle::ty::{self, Instance, Ty, TyCtxt};
3030
use rustc_session::cgu_reuse_tracker::CguReuse;
3131
use rustc_session::config::{self, EntryFnType};
32-
use rustc_session::utils::NativeLibKind;
3332
use rustc_session::Session;
3433
use rustc_target::abi::{Align, LayoutOf, VariantIdx};
3534

@@ -817,32 +816,6 @@ pub fn provide_both(providers: &mut Providers) {
817816
}
818817
tcx.sess.opts.optimize
819818
};
820-
821-
providers.dllimport_foreign_items = |tcx, krate| {
822-
let module_map = tcx.foreign_modules(krate);
823-
824-
let dllimports = tcx
825-
.native_libraries(krate)
826-
.iter()
827-
.filter(|lib| {
828-
if !matches!(lib.kind, NativeLibKind::Dylib | NativeLibKind::Unspecified) {
829-
return false;
830-
}
831-
let cfg = match lib.cfg {
832-
Some(ref cfg) => cfg,
833-
None => return true,
834-
};
835-
attr::cfg_matches(cfg, &tcx.sess.parse_sess, None)
836-
})
837-
.filter_map(|lib| lib.foreign_module)
838-
.map(|id| &module_map[&id])
839-
.flat_map(|module| module.foreign_items.iter().cloned())
840-
.collect();
841-
dllimports
842-
};
843-
844-
providers.is_dllimport_foreign_item =
845-
|tcx, def_id| tcx.dllimport_foreign_items(def_id.krate).contains(&def_id);
846819
}
847820

848821
fn determine_cgu_reuse<'tcx>(tcx: TyCtxt<'tcx>, cgu: &CodegenUnit<'tcx>) -> CguReuse {

0 commit comments

Comments
 (0)
Please sign in to comment.