about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
diff options
context:
space:
mode:
authorGary Guo <gary@garyguo.net>2023-08-17 12:07:22 +0100
committerGary Guo <gary@garyguo.net>2023-08-18 17:44:04 +0100
commita7633b8a71d163a7392f4ef2cb80ea7076302f71 (patch)
tree95de5e4dfcddbee97537504bbbd795f75c50a53b /compiler/rustc_trait_selection
parent0f7f6b70617fbcda9f73755fa9b560bfb0a588eb (diff)
downloadrust-a7633b8a71d163a7392f4ef2cb80ea7076302f71.tar.gz
rust-a7633b8a71d163a7392f4ef2cb80ea7076302f71.zip
Add an (perma-)unstable option to disable vtable vptr
This flag is intended for evaluation of trait upcasting
space cost for embedded use cases.
Diffstat (limited to 'compiler/rustc_trait_selection')
-rw-r--r--compiler/rustc_trait_selection/src/traits/vtable.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/vtable.rs b/compiler/rustc_trait_selection/src/traits/vtable.rs
index 427ac368432..e41073937be 100644
--- a/compiler/rustc_trait_selection/src/traits/vtable.rs
+++ b/compiler/rustc_trait_selection/src/traits/vtable.rs
@@ -152,7 +152,7 @@ fn prepare_vtable_segments_inner<'tcx, T>(
         while let Some((inner_most_trait_ref, emit_vptr, mut siblings)) = stack.pop() {
             segment_visitor(VtblSegment::TraitOwnEntries {
                 trait_ref: inner_most_trait_ref,
-                emit_vptr,
+                emit_vptr: emit_vptr && !tcx.sess.opts.unstable_opts.no_trait_vptr,
             })?;
 
             // If we've emitted (fed to `segment_visitor`) a trait that has methods present in the vtable,