about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-07-20 10:47:49 -0400
committerRalf Jung <post@ralfj.de>2022-07-20 17:12:08 -0400
commit0318f07bddd9911cb23d33eb668a911de2a02f3a (patch)
treed8c18addb24245c6a8d7ecf32f727a18ac2b34b2
parent9cbd1066d711ef4b5de00fc105f05ee6a3db9ae9 (diff)
downloadrust-0318f07bddd9911cb23d33eb668a911de2a02f3a.tar.gz
rust-0318f07bddd9911cb23d33eb668a911de2a02f3a.zip
various nits from review
-rw-r--r--compiler/rustc_codegen_cranelift/src/constant.rs1
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/intrinsic.rs5
-rw-r--r--compiler/rustc_middle/src/mir/interpret/mod.rs2
-rw-r--r--compiler/rustc_monomorphize/src/collector.rs3
-rw-r--r--library/core/src/ptr/metadata.rs3
5 files changed, 6 insertions, 8 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/constant.rs b/compiler/rustc_codegen_cranelift/src/constant.rs
index b5a14348589..94a2fb2fbdd 100644
--- a/compiler/rustc_codegen_cranelift/src/constant.rs
+++ b/compiler/rustc_codegen_cranelift/src/constant.rs
@@ -369,7 +369,6 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
     while let Some(todo_item) = cx.todo.pop() {
         let (data_id, alloc, section_name) = match todo_item {
             TodoItem::Alloc(alloc_id) => {
-                //println!("alloc_id {}", alloc_id);
                 let alloc = match tcx.global_alloc(alloc_id) {
                     GlobalAlloc::Memory(alloc) => alloc,
                     GlobalAlloc::Function(_) | GlobalAlloc::Static(_) | GlobalAlloc::VTable(..) => {
diff --git a/compiler/rustc_codegen_ssa/src/mir/intrinsic.rs b/compiler/rustc_codegen_ssa/src/mir/intrinsic.rs
index 0a8bd914823..94ac71a4dd2 100644
--- a/compiler/rustc_codegen_ssa/src/mir/intrinsic.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/intrinsic.rs
@@ -9,7 +9,10 @@ use crate::MemFlags;
 
 use rustc_middle::ty::{self, Ty, TyCtxt};
 use rustc_span::{sym, Span};
-use rustc_target::abi::{WrappingRange, call::{FnAbi, PassMode}};
+use rustc_target::abi::{
+    call::{FnAbi, PassMode},
+    WrappingRange,
+};
 
 fn copy_intrinsic<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
     bx: &mut Bx,
diff --git a/compiler/rustc_middle/src/mir/interpret/mod.rs b/compiler/rustc_middle/src/mir/interpret/mod.rs
index 7ef4dfe7c0d..967f8ece16c 100644
--- a/compiler/rustc_middle/src/mir/interpret/mod.rs
+++ b/compiler/rustc_middle/src/mir/interpret/mod.rs
@@ -366,7 +366,7 @@ impl<'s> AllocDecodingSession<'s> {
                 }
                 AllocDiscriminant::VTable => {
                     assert!(alloc_id.is_none());
-                    trace!("creating static alloc ID");
+                    trace!("creating vtable alloc ID");
                     let ty = <Ty<'_> as Decodable<D>>::decode(decoder);
                     let poly_trait_ref =
                         <Option<ty::PolyExistentialTraitRef<'_>> as Decodable<D>>::decode(decoder);
diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs
index 86331056d44..68b65658c72 100644
--- a/compiler/rustc_monomorphize/src/collector.rs
+++ b/compiler/rustc_monomorphize/src/collector.rs
@@ -1428,9 +1428,6 @@ fn collect_miri<'tcx>(tcx: TyCtxt<'tcx>, alloc_id: AllocId, output: &mut MonoIte
             }
         }
         GlobalAlloc::VTable(ty, trait_ref) => {
-            // FIXME(RJ) no ideas if this is correct. There is this nice
-            // `create_mono_items_for_vtable_methods` method but I wouldn't know how to call it from
-            // here. So instead we just generate the actual vtable and recurse.
             let alloc_id = tcx.vtable_allocation((ty, trait_ref));
             collect_miri(tcx, alloc_id, output)
         }
diff --git a/library/core/src/ptr/metadata.rs b/library/core/src/ptr/metadata.rs
index 2becaa83362..cd5edee0460 100644
--- a/library/core/src/ptr/metadata.rs
+++ b/library/core/src/ptr/metadata.rs
@@ -185,8 +185,7 @@ extern "C" {
     /// Opaque type for accessing vtables.
     ///
     /// Private implementation detail of `DynMetadata::size_of` etc.
-    /// Must be zero-sized since there is conceptually not actually any Abstract Machine memory behind this pointer.
-    /// However, we can require pointer alignment.
+    /// There is conceptually not actually any Abstract Machine memory behind this pointer.
     type VTable;
 }