Skip to content

Commit 8536514

Browse files
committed
Rustup to rustc 1.40.0-nightly (10a52c25c 2019-10-24)
1 parent dda5ea8 commit 8536514

File tree

7 files changed

+35
-26
lines changed

7 files changed

+35
-26
lines changed

Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ cranelift-simplejit = { git = "https://github.com/CraneStation/cranelift.git" }
5252
# By compiling dependencies with optimizations, performing tests gets much faster.
5353
opt-level = 3
5454

55-
[profile.dev.overrides."rustc_codegen_cranelift"]
55+
[profile.dev.package.rustc_codegen_cranelift]
5656
# Disabling optimizations for cg_clif itself makes compilation after a change faster.
5757
opt-level = 0
5858

@@ -62,14 +62,14 @@ opt-level = 0
6262
opt-level = 0
6363
debug = false
6464

65-
[profile.dev.overrides.cranelift-codegen-meta]
65+
[profile.dev.package.cranelift-codegen-meta]
6666
opt-level = 0
6767
debug = false
6868

69-
[profile.dev.overrides.syn]
69+
[profile.dev.package.syn]
7070
opt-level = 0
7171
debug = false
7272

73-
[profile.dev.overrides.synstructure]
73+
[profile.dev.package.synstructure]
7474
opt-level = 0
7575
debug = false

example/mini_core.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(
22
no_core, lang_items, intrinsics, unboxed_closures, type_ascription, extern_types,
3-
untagged_unions, decl_macro, rustc_attrs
3+
untagged_unions, decl_macro, rustc_attrs, transparent_unions
44
)]
55
#![no_core]
66
#![allow(dead_code)]
@@ -448,10 +448,17 @@ pub trait Drop {
448448
fn drop(&mut self);
449449
}
450450

451-
#[allow(unions_with_drop_fields)]
451+
#[lang = "manually_drop"]
452+
#[repr(transparent)]
453+
pub struct ManuallyDrop<T: ?Sized> {
454+
pub value: T,
455+
}
456+
457+
#[lang = "maybe_uninit"]
458+
#[repr(transparent)]
452459
pub union MaybeUninit<T> {
453460
pub uninit: (),
454-
pub value: T,
461+
pub value: ManuallyDrop<T>,
455462
}
456463

457464
pub mod intrinsics {

example/mini_core_hello_world.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ fn main() {
196196
}
197197

198198
unsafe fn uninitialized<T>() -> T {
199-
MaybeUninit { uninit: () }.value
199+
MaybeUninit { uninit: () }.value.value
200200
}
201201

202202
zeroed::<(u8, u8)>();

patches/0017-Fix-libtest-compilation.patch

+13-13
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ index 8b76080..9e65de2 100644
1212
--- a/src/libtest/lib.rs
1313
+++ b/src/libtest/lib.rs
1414
@@ -52,7 +52,7 @@ use std::fmt;
15-
use std::fs::File;
16-
use std::io;
17-
use std::io::prelude::*;
18-
-use std::panic::{self, catch_unwind, AssertUnwindSafe, PanicInfo};
19-
+use std::panic::{self, PanicInfo};
20-
use std::path::PathBuf;
21-
use std::process;
22-
use std::process::{ExitStatus, Command, Termination};
15+
env,
16+
io,
17+
io::prelude::Write,
18+
- panic::{self, catch_unwind, AssertUnwindSafe, PanicInfo},
19+
+ panic::{self, PanicInfo},
20+
process,
21+
process::{Command, Termination},
22+
sync::mpsc::{channel, Sender},
2323
@@ -1493,7 +1493,7 @@ pub fn run_test(
2424
fn run_test_inner(
2525
desc: TestDesc,
26-
monitor_ch: Sender<MonitorMsg>,
26+
monitor_ch: Sender<CompletedTest>,
2727
- testfn: Box<dyn FnOnce() + Send>,
2828
+ testfn: Box<impl FnOnce() + Send + 'static>,
2929
opts: TestRunOpts,
@@ -65,8 +65,8 @@ index 8b76080..9e65de2 100644
6565
report_time: bool,
6666
- testfn: Box<dyn FnOnce() + Send>,
6767
+ testfn: Box<impl FnOnce() + Send + 'static>,
68-
monitor_ch: Sender<MonitorMsg>,
69-
time_opts: Option<TestTimeOptions>,
68+
monitor_ch: Sender<CompletedTest>,
69+
time_opts: Option<time::TestTimeOptions>,
7070
) {
7171
// Buffer for capturing standard I/O
7272
let data = Arc::new(Mutex::new(Vec::new()));
@@ -75,12 +75,12 @@ index 8b76080..9e65de2 100644
7575
None
7676
};
7777
- let result = catch_unwind(AssertUnwindSafe(testfn));
78-
+ let result = Ok::<(), Box<dyn Any + Send>>(testfn());
78+
+ let result = Ok::<(), Box<dyn std::any::Any + Send>>(testfn());
7979
let exec_time = start.map(|start| {
8080
let duration = start.elapsed();
8181
TestExecTime(duration)
8282
@@ -1688,10 +1676,10 @@ fn spawn_test_subprocess(desc: TestDesc, report_time: bool, monitor_ch: Sender<M
83-
monitor_ch.send((desc.clone(), result, exec_time, test_output)).unwrap();
83+
monitor_ch.send(message).unwrap();
8484
}
8585

8686
fn run_test_in_spawned_subprocess(

prepare.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash --verbose
22
set -e
33

4-
rustup component add rust-src
4+
rustup component add rust-src rustc-dev
55
./build_sysroot/prepare_sysroot_src.sh
66
cargo install hyperfine || echo "Skipping hyperfine install"
77

src/common.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,9 @@ pub struct FunctionCx<'clif, 'tcx, B: Backend + 'static> {
286286
pub clif_comments: crate::pretty_clif::CommentWriter,
287287
pub constants_cx: &'clif mut crate::constant::ConstantCx,
288288
pub caches: &'clif mut Caches<'tcx>,
289-
pub source_info_set: indexmap::IndexSet<SourceInfo>,
289+
290+
// FIXME switch back to `SourceInfo`, once it derives `Eq` and `Hash` again.
291+
pub source_info_set: indexmap::IndexSet<(Span, mir::SourceScope)>,
290292
}
291293

292294
impl<'tcx, B: Backend> LayoutOf for FunctionCx<'_, 'tcx, B> {
@@ -365,7 +367,7 @@ impl<'tcx, B: Backend + 'static> FunctionCx<'_, 'tcx, B> {
365367
}
366368

367369
pub fn set_debug_loc(&mut self, source_info: mir::SourceInfo) {
368-
let (index, _) = self.source_info_set.insert_full(source_info);
370+
let (index, _) = self.source_info_set.insert_full((source_info.span, source_info.scope));
369371
self.bcx.set_srcloc(SourceLoc::new(index as u32));
370372
}
371373
}

src/debuginfo.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ impl<'a, 'tcx> FunctionDebugContext<'a, 'tcx> {
252252
tcx: TyCtxt,
253253
context: &Context,
254254
isa: &dyn cranelift::codegen::isa::TargetIsa,
255-
source_info_set: &indexmap::IndexSet<SourceInfo>,
255+
source_info_set: &indexmap::IndexSet<(Span, mir::SourceScope)>,
256256
) {
257257
let line_program = &mut self.debug_context.dwarf.unit.line_program;
258258

@@ -292,7 +292,7 @@ impl<'a, 'tcx> FunctionDebugContext<'a, 'tcx> {
292292
line_program.row().address_offset = offset as u64;
293293
if !srcloc.is_default() {
294294
let source_info = *source_info_set.get_index(srcloc.bits() as usize).unwrap();
295-
create_row_for_span(line_program, source_info.span);
295+
create_row_for_span(line_program, source_info.0);
296296
} else {
297297
create_row_for_span(line_program, self.mir_span);
298298
}

0 commit comments

Comments
 (0)