Skip to content

Commit a233646

Browse files
committed
Rustup to rustc 1.49.0-nightly (e160e5cb8 2020-10-14)
1 parent 6258b86 commit a233646

File tree

5 files changed

+21
-53
lines changed

5 files changed

+21
-53
lines changed

patches/0022-core-Disable-not-compiling-tests.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ index 6609bc3..241b497 100644
112112
#[cfg(not(target_arch = "wasm32"))]
113113
fn sort_unstable() {
114114
@@ -1394,6 +1395,7 @@ fn partition_at_index() {
115-
v.partition_at_index(0);
115+
v.select_nth_unstable(0);
116116
assert!(v == [0xDEADBEEF]);
117117
}
118118
+*/

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2020-10-12
1+
nightly-2020-10-15

src/base.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -299,19 +299,19 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, impl Module>) {
299299
TerminatorKind::SwitchInt {
300300
discr,
301301
switch_ty,
302-
values,
303302
targets,
304303
} => {
305304
let discr = trans_operand(fx, discr).load_scalar(fx);
306305

307306
if switch_ty.kind() == fx.tcx.types.bool.kind() {
308-
assert_eq!(targets.len(), 2);
309-
let then_block = fx.get_block(targets[0]);
310-
let else_block = fx.get_block(targets[1]);
311-
let test_zero = match **values {
312-
[0] => true,
313-
[1] => false,
314-
_ => unreachable!("{:?}", values),
307+
assert_eq!(targets.iter().count(), 1);
308+
let (then_value, then_block) = targets.iter().next().unwrap();
309+
let then_block = fx.get_block(then_block);
310+
let else_block = fx.get_block(targets.otherwise());
311+
let test_zero = match then_value {
312+
0 => true,
313+
1 => false,
314+
_ => unreachable!("{:?}", targets),
315315
};
316316

317317
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>) {
330330
}
331331
} else {
332332
let mut switch = ::cranelift_frontend::Switch::new();
333-
for (i, value) in values.iter().enumerate() {
334-
let block = fx.get_block(targets[i]);
335-
switch.set_entry(*value, block);
333+
for (value, block) in targets.iter() {
334+
let block = fx.get_block(block);
335+
switch.set_entry(value, block);
336336
}
337-
let otherwise_block = fx.get_block(targets[targets.len() - 1]);
337+
let otherwise_block = fx.get_block(targets.otherwise());
338338
switch.emit(&mut fx.bcx, discr, otherwise_block);
339339
}
340340
}

src/driver/aot.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ pub(super) fn run_aot(
302302
modules,
303303
allocator_module,
304304
metadata_module,
305-
crate_hash: tcx.crate_hash(LOCAL_CRATE),
306305
metadata,
307306
windows_subsystem: None, // Windows is not yet supported
308307
linker_info: LinkerInfo::new(tcx),

src/lib.rs

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use std::any::Any;
3737
use rustc_codegen_ssa::traits::CodegenBackend;
3838
use rustc_codegen_ssa::CodegenResults;
3939
use rustc_errors::ErrorReported;
40-
use rustc_middle::dep_graph::{DepGraph, WorkProduct, WorkProductId};
40+
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
4141
use rustc_middle::middle::cstore::{EncodedMetadata, MetadataLoader};
4242
use rustc_middle::ty::query::Providers;
4343
use rustc_session::config::OutputFilenames;
@@ -190,23 +190,7 @@ impl CodegenBackend for CraneliftCodegenBackend {
190190
Box::new(crate::metadata::CraneliftMetadataLoader)
191191
}
192192

193-
fn provide(&self, providers: &mut Providers) {
194-
providers.supported_target_features = |tcx, cnum| {
195-
assert_eq!(cnum, LOCAL_CRATE);
196-
if tcx.sess.opts.actually_rustdoc {
197-
// rustdoc needs to be able to document functions that use all the features, so
198-
// whitelist them all
199-
rustc_codegen_ssa::target_features::all_known_features()
200-
.map(|(a, b)| (a.to_string(), b))
201-
.collect()
202-
} else {
203-
rustc_codegen_ssa::target_features::supported_target_features(tcx.sess)
204-
.iter()
205-
.map(|&(a, b)| (a.to_string(), b))
206-
.collect()
207-
}
208-
};
209-
}
193+
fn provide(&self, _providers: &mut Providers) {}
210194
fn provide_extern(&self, _providers: &mut Providers) {}
211195

212196
fn target_features(&self, _sess: &Session) -> Vec<rustc_span::Symbol> {
@@ -229,34 +213,21 @@ impl CodegenBackend for CraneliftCodegenBackend {
229213
fn join_codegen(
230214
&self,
231215
ongoing_codegen: Box<dyn Any>,
232-
sess: &Session,
233-
dep_graph: &DepGraph,
234-
) -> Result<Box<dyn Any>, ErrorReported> {
235-
let (codegen_results, work_products) = *ongoing_codegen
216+
_sess: &Session,
217+
) -> Result<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>), ErrorReported> {
218+
Ok(*ongoing_codegen
236219
.downcast::<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>)>()
237-
.unwrap();
238-
239-
sess.time("serialize_work_products", move || {
240-
rustc_incremental::save_work_product_index(sess, &dep_graph, work_products)
241-
});
242-
243-
Ok(Box::new(codegen_results))
220+
.unwrap())
244221
}
245222

246223
fn link(
247224
&self,
248225
sess: &Session,
249-
res: Box<dyn Any>,
226+
codegen_results: CodegenResults,
250227
outputs: &OutputFilenames,
251228
) -> Result<(), ErrorReported> {
252229
use rustc_codegen_ssa::back::link::link_binary;
253230

254-
sess.abort_if_errors();
255-
256-
let codegen_results = *res
257-
.downcast::<CodegenResults>()
258-
.expect("Expected CraneliftCodegenBackend's CodegenResult, found Box<Any>");
259-
260231
let _timer = sess.prof.generic_activity("link_crate");
261232

262233
sess.time("linking", || {
@@ -270,8 +241,6 @@ impl CodegenBackend for CraneliftCodegenBackend {
270241
);
271242
});
272243

273-
rustc_incremental::finalize_session_directory(sess, codegen_results.crate_hash);
274-
275244
Ok(())
276245
}
277246
}

0 commit comments

Comments
 (0)