Skip to content

Commit 4cbba98

Browse files
committed
Rustup to rustc 1.55.0-nightly (6d82086 2021-06-29)
1 parent 3ec2b44 commit 4cbba98

File tree

7 files changed

+18
-29
lines changed

7 files changed

+18
-29
lines changed

build_sysroot/Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build_system/prepare.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fn prepare_sysroot() {
8282
clone_repo(
8383
"build_sysroot/compiler-builtins",
8484
"https://github.com/rust-lang/compiler-builtins.git",
85-
"0.1.45",
85+
"0.1.46",
8686
);
8787
apply_patches("compiler-builtins", Path::new("build_sysroot/compiler-builtins"));
8888
}

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2021-06-17"
2+
channel = "nightly-2021-06-30"
33
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]

src/base.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ pub(crate) fn codegen_fn<'tcx>(
2121
debug_assert!(!instance.substs.needs_infer());
2222

2323
let mir = tcx.instance_mir(instance.def);
24+
let _mir_guard = crate::PrintOnPanic(|| {
25+
let mut buf = Vec::new();
26+
rustc_mir::util::write_mir_pretty(tcx, Some(instance.def_id()), &mut buf).unwrap();
27+
String::from_utf8_lossy(&buf).into_owned()
28+
});
2429

2530
// Declare function
2631
let symbol_name = tcx.symbol_name(instance);
@@ -52,7 +57,6 @@ pub(crate) fn codegen_fn<'tcx>(
5257
module,
5358
tcx,
5459
pointer_type,
55-
vtables: FxHashMap::default(),
5660
constants_cx: ConstantCx::new(),
5761

5862
instance,

src/common.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ pub(crate) struct FunctionCx<'m, 'clif, 'tcx: 'm> {
233233
pub(crate) module: &'m mut dyn Module,
234234
pub(crate) tcx: TyCtxt<'tcx>,
235235
pub(crate) pointer_type: Type, // Cached from module
236-
pub(crate) vtables: FxHashMap<(Ty<'tcx>, Option<ty::PolyExistentialTraitRef<'tcx>>), Pointer>,
237236
pub(crate) constants_cx: ConstantCx,
238237

239238
pub(crate) instance: Instance<'tcx>,

src/lib.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
#![feature(
2-
rustc_private,
3-
decl_macro,
4-
never_type,
5-
hash_drain_filter,
6-
vec_into_raw_parts,
7-
once_cell,
8-
)]
1+
#![feature(rustc_private, decl_macro, never_type, hash_drain_filter, vec_into_raw_parts, once_cell)]
92
#![warn(rust_2018_idioms)]
103
#![warn(unused_lifetimes)]
114
#![warn(unreachable_pub)]
@@ -23,6 +16,7 @@ extern crate rustc_incremental;
2316
extern crate rustc_index;
2417
extern crate rustc_interface;
2518
extern crate rustc_metadata;
19+
extern crate rustc_mir;
2620
extern crate rustc_session;
2721
extern crate rustc_span;
2822
extern crate rustc_target;

src/vtable.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
//! Codegen vtables and vtable accesses.
22
//!
33
//! See `rustc_codegen_ssa/src/meth.rs` for reference.
4-
// FIXME dedup this logic between miri, cg_llvm and cg_clif
54
6-
use crate::prelude::*;
75
use super::constant::pointer_for_allocation;
6+
use crate::prelude::*;
87

98
fn vtable_memflags() -> MemFlags {
109
let mut flags = MemFlags::trusted(); // A vtable access is always aligned and will never trap.
@@ -69,16 +68,9 @@ pub(crate) fn get_vtable<'tcx>(
6968
ty: Ty<'tcx>,
7069
trait_ref: Option<ty::PolyExistentialTraitRef<'tcx>>,
7170
) -> Value {
72-
let vtable_ptr = if let Some(vtable_ptr) = fx.vtables.get(&(ty, trait_ref)) {
73-
*vtable_ptr
74-
} else {
75-
let vtable_alloc_id = fx.tcx.vtable_allocation(ty, trait_ref);
76-
let vtable_allocation = fx.tcx.global_alloc(vtable_alloc_id).unwrap_memory();
77-
let vtable_ptr = pointer_for_allocation(fx, vtable_allocation);
78-
79-
fx.vtables.insert((ty, trait_ref), vtable_ptr);
80-
vtable_ptr
81-
};
71+
let vtable_alloc_id = fx.tcx.vtable_allocation(ty, trait_ref);
72+
let vtable_allocation = fx.tcx.global_alloc(vtable_alloc_id).unwrap_memory();
73+
let vtable_ptr = pointer_for_allocation(fx, vtable_allocation);
8274

8375
vtable_ptr.get_addr(fx)
8476
}

0 commit comments

Comments
 (0)