mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 01:13:11 +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"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
fn sort_unstable() {
|
fn sort_unstable() {
|
||||||
@@ -1394,6 +1395,7 @@ fn partition_at_index() {
|
@@ -1394,6 +1395,7 @@ fn partition_at_index() {
|
||||||
v.partition_at_index(0);
|
v.select_nth_unstable(0);
|
||||||
assert!(v == [0xDEADBEEF]);
|
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 {
|
TerminatorKind::SwitchInt {
|
||||||
discr,
|
discr,
|
||||||
switch_ty,
|
switch_ty,
|
||||||
values,
|
|
||||||
targets,
|
targets,
|
||||||
} => {
|
} => {
|
||||||
let discr = trans_operand(fx, discr).load_scalar(fx);
|
let discr = trans_operand(fx, discr).load_scalar(fx);
|
||||||
|
|
||||||
if switch_ty.kind() == fx.tcx.types.bool.kind() {
|
if switch_ty.kind() == fx.tcx.types.bool.kind() {
|
||||||
assert_eq!(targets.len(), 2);
|
assert_eq!(targets.iter().count(), 1);
|
||||||
let then_block = fx.get_block(targets[0]);
|
let (then_value, then_block) = targets.iter().next().unwrap();
|
||||||
let else_block = fx.get_block(targets[1]);
|
let then_block = fx.get_block(then_block);
|
||||||
let test_zero = match **values {
|
let else_block = fx.get_block(targets.otherwise());
|
||||||
[0] => true,
|
let test_zero = match then_value {
|
||||||
[1] => false,
|
0 => true,
|
||||||
_ => unreachable!("{:?}", values),
|
1 => false,
|
||||||
|
_ => unreachable!("{:?}", targets),
|
||||||
};
|
};
|
||||||
|
|
||||||
let discr = crate::optimize::peephole::maybe_unwrap_bint(&mut fx.bcx, discr);
|
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 {
|
} else {
|
||||||
let mut switch = ::cranelift_frontend::Switch::new();
|
let mut switch = ::cranelift_frontend::Switch::new();
|
||||||
for (i, value) in values.iter().enumerate() {
|
for (value, block) in targets.iter() {
|
||||||
let block = fx.get_block(targets[i]);
|
let block = fx.get_block(block);
|
||||||
switch.set_entry(*value, 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);
|
switch.emit(&mut fx.bcx, discr, otherwise_block);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -302,7 +302,6 @@ pub(super) fn run_aot(
|
|||||||
modules,
|
modules,
|
||||||
allocator_module,
|
allocator_module,
|
||||||
metadata_module,
|
metadata_module,
|
||||||
crate_hash: tcx.crate_hash(LOCAL_CRATE),
|
|
||||||
metadata,
|
metadata,
|
||||||
windows_subsystem: None, // Windows is not yet supported
|
windows_subsystem: None, // Windows is not yet supported
|
||||||
linker_info: LinkerInfo::new(tcx),
|
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::traits::CodegenBackend;
|
||||||
use rustc_codegen_ssa::CodegenResults;
|
use rustc_codegen_ssa::CodegenResults;
|
||||||
use rustc_errors::ErrorReported;
|
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::middle::cstore::{EncodedMetadata, MetadataLoader};
|
||||||
use rustc_middle::ty::query::Providers;
|
use rustc_middle::ty::query::Providers;
|
||||||
use rustc_session::config::OutputFilenames;
|
use rustc_session::config::OutputFilenames;
|
||||||
@ -190,23 +190,7 @@ impl CodegenBackend for CraneliftCodegenBackend {
|
|||||||
Box::new(crate::metadata::CraneliftMetadataLoader)
|
Box::new(crate::metadata::CraneliftMetadataLoader)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn provide(&self, providers: &mut Providers) {
|
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_extern(&self, _providers: &mut Providers) {}
|
fn provide_extern(&self, _providers: &mut Providers) {}
|
||||||
|
|
||||||
fn target_features(&self, _sess: &Session) -> Vec<rustc_span::Symbol> {
|
fn target_features(&self, _sess: &Session) -> Vec<rustc_span::Symbol> {
|
||||||
@ -229,34 +213,21 @@ impl CodegenBackend for CraneliftCodegenBackend {
|
|||||||
fn join_codegen(
|
fn join_codegen(
|
||||||
&self,
|
&self,
|
||||||
ongoing_codegen: Box<dyn Any>,
|
ongoing_codegen: Box<dyn Any>,
|
||||||
sess: &Session,
|
_sess: &Session,
|
||||||
dep_graph: &DepGraph,
|
) -> Result<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>), ErrorReported> {
|
||||||
) -> Result<Box<dyn Any>, ErrorReported> {
|
Ok(*ongoing_codegen
|
||||||
let (codegen_results, work_products) = *ongoing_codegen
|
|
||||||
.downcast::<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>)>()
|
.downcast::<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>)>()
|
||||||
.unwrap();
|
.unwrap())
|
||||||
|
|
||||||
sess.time("serialize_work_products", move || {
|
|
||||||
rustc_incremental::save_work_product_index(sess, &dep_graph, work_products)
|
|
||||||
});
|
|
||||||
|
|
||||||
Ok(Box::new(codegen_results))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn link(
|
fn link(
|
||||||
&self,
|
&self,
|
||||||
sess: &Session,
|
sess: &Session,
|
||||||
res: Box<dyn Any>,
|
codegen_results: CodegenResults,
|
||||||
outputs: &OutputFilenames,
|
outputs: &OutputFilenames,
|
||||||
) -> Result<(), ErrorReported> {
|
) -> Result<(), ErrorReported> {
|
||||||
use rustc_codegen_ssa::back::link::link_binary;
|
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");
|
let _timer = sess.prof.generic_activity("link_crate");
|
||||||
|
|
||||||
sess.time("linking", || {
|
sess.time("linking", || {
|
||||||
@ -270,8 +241,6 @@ impl CodegenBackend for CraneliftCodegenBackend {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
rustc_incremental::finalize_session_directory(sess, codegen_results.crate_hash);
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user