about summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-10-17 10:51:40 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2022-10-19 08:09:40 +1100
commitca2561a07b01841ceef6790d78e12aaa1d2e3aec (patch)
tree87c8e48616e64f4fe1790b7178a5feddb9b101b7 /src/librustdoc/html/render
parent38988e62bc7672e1e85b7db4e3a885608d9a3888 (diff)
downloadrust-ca2561a07b01841ceef6790d78e12aaa1d2e3aec.tar.gz
rust-ca2561a07b01841ceef6790d78e12aaa1d2e3aec.zip
Avoid cloning `RenderOptions`.
By moving `RenderOptions` out of `Option`, because the two structs' uses
are almost entirely separate.

The only complication is that `unstable_features` is needed in both
structs, but it's a tiny `Copy` type so its duplication seems fine.
Diffstat (limited to 'src/librustdoc/html/render')
-rw-r--r--src/librustdoc/html/render/context.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs
index e303dd8bdaf..5733d1f9c79 100644
--- a/src/librustdoc/html/render/context.rs
+++ b/src/librustdoc/html/render/context.rs
@@ -430,7 +430,6 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
             extension_css,
             resource_suffix,
             static_root_path,
-            unstable_features,
             generate_redirect_map,
             show_type_layout,
             generate_link_to_definition,
@@ -511,7 +510,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
             resource_suffix,
             static_root_path,
             fs: DocFS::new(sender),
-            codes: ErrorCodes::from(unstable_features.is_nightly_build()),
+            codes: ErrorCodes::from(options.unstable_features.is_nightly_build()),
             playground,
             all: RefCell::new(AllTypes::new()),
             errors: receiver,