From b7debe34e6fb2d329e21739c97ce3d7161303af5 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 26 Oct 2023 17:18:21 -0700 Subject: Parse rustc version at compile time --- src/librustdoc/html/render/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/librustdoc/html/render') diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index e01341acf43..88d01b7a5e5 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -48,13 +48,14 @@ use std::str; use std::string::ToString; use askama::Template; -use rustc_attr::{ConstStability, Deprecation, Since, StabilityLevel, CURRENT_RUSTC_VERSION}; +use rustc_attr::{ConstStability, Deprecation, Since, StabilityLevel}; use rustc_data_structures::captures::Captures; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_hir::def_id::{DefId, DefIdSet}; use rustc_hir::Mutability; use rustc_middle::middle::stability; use rustc_middle::ty::{self, TyCtxt}; +use rustc_session::RustcVersion; use rustc_span::{ symbol::{sym, Symbol}, BytePos, FileName, RealFileName, @@ -979,7 +980,7 @@ fn render_stability_since_raw_with_extra( fn since_to_string(since: &Since) -> Option { match since { Since::Version(since) => Some(since.to_string()), - Since::Current => Some(CURRENT_RUSTC_VERSION.to_owned()), + Since::Current => Some(RustcVersion::CURRENT.to_string()), Since::Err => None, } } -- cgit 1.4.1-3-g733a5