Skip to content

Commit deedf6f

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

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

example/mini_core.rs

Lines changed: 10 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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)>();

src/common.rs

Lines changed: 4 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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)