mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
Rustup to rustc 1.49.0-nightly (e160e5cb8
2020-10-14)
This commit is contained in:
parent
6258b86c40
commit
a233646dfc
@ -112,7 +112,7 @@ index 6609bc3..241b497 100644
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn sort_unstable() {
|
||||
@@ -1394,6 +1395,7 @@ fn partition_at_index() {
|
||||
v.partition_at_index(0);
|
||||
v.select_nth_unstable(0);
|
||||
assert!(v == [0xDEADBEEF]);
|
||||
}
|
||||
+*/
|
||||
|
@ -1 +1 @@
|
||||
nightly-2020-10-12
|
||||
nightly-2020-10-15
|
||||
|
24
src/base.rs
24
src/base.rs
@ -299,19 +299,19 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, impl Module>) {
|
||||
TerminatorKind::SwitchInt {
|
||||
discr,
|
||||
switch_ty,
|
||||
values,
|
||||
targets,
|
||||
} => {
|
||||
let discr = trans_operand(fx, discr).load_scalar(fx);
|
||||
|
||||
if switch_ty.kind() == fx.tcx.types.bool.kind() {
|
||||
assert_eq!(targets.len(), 2);
|
||||
let then_block = fx.get_block(targets[0]);
|
||||
let else_block = fx.get_block(targets[1]);
|
||||
let test_zero = match **values {
|
||||
[0] => true,
|
||||
[1] => false,
|
||||
_ => unreachable!("{:?}", values),
|
||||
assert_eq!(targets.iter().count(), 1);
|
||||
let (then_value, then_block) = targets.iter().next().unwrap();
|
||||
let then_block = fx.get_block(then_block);
|
||||
let else_block = fx.get_block(targets.otherwise());
|
||||
let test_zero = match then_value {
|
||||
0 => true,
|
||||
1 => false,
|
||||
_ => unreachable!("{:?}", targets),
|
||||
};
|
||||
|
||||
let discr = crate::optimize::peephole::maybe_unwrap_bint(&mut fx.bcx, discr);
|
||||
@ -330,11 +330,11 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, impl Module>) {
|
||||
}
|
||||
} else {
|
||||
let mut switch = ::cranelift_frontend::Switch::new();
|
||||
for (i, value) in values.iter().enumerate() {
|
||||
let block = fx.get_block(targets[i]);
|
||||
switch.set_entry(*value, block);
|
||||
for (value, block) in targets.iter() {
|
||||
let block = fx.get_block(block);
|
||||
switch.set_entry(value, block);
|
||||
}
|
||||
let otherwise_block = fx.get_block(targets[targets.len() - 1]);
|
||||
let otherwise_block = fx.get_block(targets.otherwise());
|
||||
switch.emit(&mut fx.bcx, discr, otherwise_block);
|
||||
}
|
||||
}
|
||||
|
@ -302,7 +302,6 @@ pub(super) fn run_aot(
|
||||
modules,
|
||||
allocator_module,
|
||||
metadata_module,
|
||||
crate_hash: tcx.crate_hash(LOCAL_CRATE),
|
||||
metadata,
|
||||
windows_subsystem: None, // Windows is not yet supported
|
||||
linker_info: LinkerInfo::new(tcx),
|
||||
|
45
src/lib.rs
45
src/lib.rs
@ -37,7 +37,7 @@ use std::any::Any;
|
||||
use rustc_codegen_ssa::traits::CodegenBackend;
|
||||
use rustc_codegen_ssa::CodegenResults;
|
||||
use rustc_errors::ErrorReported;
|
||||
use rustc_middle::dep_graph::{DepGraph, WorkProduct, WorkProductId};
|
||||
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
|
||||
use rustc_middle::middle::cstore::{EncodedMetadata, MetadataLoader};
|
||||
use rustc_middle::ty::query::Providers;
|
||||
use rustc_session::config::OutputFilenames;
|
||||
@ -190,23 +190,7 @@ impl CodegenBackend for CraneliftCodegenBackend {
|
||||
Box::new(crate::metadata::CraneliftMetadataLoader)
|
||||
}
|
||||
|
||||
fn provide(&self, providers: &mut Providers) {
|
||||
providers.supported_target_features = |tcx, cnum| {
|
||||
assert_eq!(cnum, LOCAL_CRATE);
|
||||
if tcx.sess.opts.actually_rustdoc {
|
||||
// rustdoc needs to be able to document functions that use all the features, so
|
||||
// whitelist them all
|
||||
rustc_codegen_ssa::target_features::all_known_features()
|
||||
.map(|(a, b)| (a.to_string(), b))
|
||||
.collect()
|
||||
} else {
|
||||
rustc_codegen_ssa::target_features::supported_target_features(tcx.sess)
|
||||
.iter()
|
||||
.map(|&(a, b)| (a.to_string(), b))
|
||||
.collect()
|
||||
}
|
||||
};
|
||||
}
|
||||
fn provide(&self, _providers: &mut Providers) {}
|
||||
fn provide_extern(&self, _providers: &mut Providers) {}
|
||||
|
||||
fn target_features(&self, _sess: &Session) -> Vec<rustc_span::Symbol> {
|
||||
@ -229,34 +213,21 @@ impl CodegenBackend for CraneliftCodegenBackend {
|
||||
fn join_codegen(
|
||||
&self,
|
||||
ongoing_codegen: Box<dyn Any>,
|
||||
sess: &Session,
|
||||
dep_graph: &DepGraph,
|
||||
) -> Result<Box<dyn Any>, ErrorReported> {
|
||||
let (codegen_results, work_products) = *ongoing_codegen
|
||||
_sess: &Session,
|
||||
) -> Result<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>), ErrorReported> {
|
||||
Ok(*ongoing_codegen
|
||||
.downcast::<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>)>()
|
||||
.unwrap();
|
||||
|
||||
sess.time("serialize_work_products", move || {
|
||||
rustc_incremental::save_work_product_index(sess, &dep_graph, work_products)
|
||||
});
|
||||
|
||||
Ok(Box::new(codegen_results))
|
||||
.unwrap())
|
||||
}
|
||||
|
||||
fn link(
|
||||
&self,
|
||||
sess: &Session,
|
||||
res: Box<dyn Any>,
|
||||
codegen_results: CodegenResults,
|
||||
outputs: &OutputFilenames,
|
||||
) -> Result<(), ErrorReported> {
|
||||
use rustc_codegen_ssa::back::link::link_binary;
|
||||
|
||||
sess.abort_if_errors();
|
||||
|
||||
let codegen_results = *res
|
||||
.downcast::<CodegenResults>()
|
||||
.expect("Expected CraneliftCodegenBackend's CodegenResult, found Box<Any>");
|
||||
|
||||
let _timer = sess.prof.generic_activity("link_crate");
|
||||
|
||||
sess.time("linking", || {
|
||||
@ -270,8 +241,6 @@ impl CodegenBackend for CraneliftCodegenBackend {
|
||||
);
|
||||
});
|
||||
|
||||
rustc_incremental::finalize_session_directory(sess, codegen_results.crate_hash);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user