diff options
| author | Gary Guo <gary@garyguo.net> | 2023-08-17 12:07:22 +0100 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2023-08-18 17:44:04 +0100 |
| commit | a7633b8a71d163a7392f4ef2cb80ea7076302f71 (patch) | |
| tree | 95de5e4dfcddbee97537504bbbd795f75c50a53b /compiler/rustc_trait_selection | |
| parent | 0f7f6b70617fbcda9f73755fa9b560bfb0a588eb (diff) | |
| download | rust-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.rs | 2 |
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, |
