]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/html/render/context.rs
Remove unnecessary `item_name` parameter to `mod_item_out`
[rust.git] / src / librustdoc / html / render / context.rs
index afdba5f0579f529790f7bc4ab96f9a03142905eb..d3ef97c0d59f9b45e9487b9d2c1a362d72d70f92 100644 (file)
     crate static_root_path: Option<String>,
     /// The fs handle we are working with.
     crate fs: DocFS,
-    /// The default edition used to parse doctests.
-    crate edition: Edition,
     pub(super) codes: ErrorCodes,
     pub(super) playground: Option<markdown::Playground>,
     all: RefCell<AllTypes>,
@@ -141,6 +139,10 @@ impl SharedContext<'_> {
     crate fn maybe_collapsed_doc_value<'a>(&self, item: &'a clean::Item) -> Option<String> {
         if self.collapsed { item.collapsed_doc_value() } else { item.doc_value() }
     }
+
+    crate fn edition(&self) -> Edition {
+        self.tcx.sess.edition()
+    }
 }
 
 impl<'tcx> Context<'tcx> {
@@ -346,7 +348,6 @@ fn descr() -> &'static str {
     fn init(
         mut krate: clean::Crate,
         options: RenderOptions,
-        edition: Edition,
         mut cache: Cache,
         tcx: TyCtxt<'tcx>,
     ) -> Result<(Self, clean::Crate), Error> {
@@ -435,7 +436,6 @@ fn init(
             resource_suffix,
             static_root_path,
             fs: DocFS::new(sender),
-            edition,
             codes: ErrorCodes::from(unstable_features.is_nightly_build()),
             playground,
             all: RefCell::new(AllTypes::new()),
@@ -617,7 +617,7 @@ fn mod_item_in(&mut self, item: &clean::Item, item_name: &str) -> Result<(), Err
         Ok(())
     }
 
-    fn mod_item_out(&mut self, _item_name: &str) -> Result<(), Error> {
+    fn mod_item_out(&mut self) -> Result<(), Error> {
         info!("Recursed; leaving {}", self.dst.display());
 
         // Go back to where we were at