@@ -256,6 +256,9 @@ pub struct Cache {
256256    // the access levels from crateanalysis. 
257257    pub  access_levels :  Arc < AccessLevels < DefId > > , 
258258
259+     /// The version of the crate being documented, if given fron the `--crate-version` flag. 
260+ pub  crate_version :  Option < String > , 
261+ 
259262    // Private fields only used when initially crawling a crate to build a cache 
260263
261264    stack :  Vec < String > , 
@@ -534,6 +537,7 @@ pub fn run(mut krate: clean::Crate,
534537        primitive_locations :  FxHashMap ( ) , 
535538        stripped_mod :  false , 
536539        access_levels :  krate. access_levels . clone ( ) , 
540+         crate_version :  krate. version . take ( ) , 
537541        orphan_impl_items :  Vec :: new ( ) , 
538542        traits :  mem:: replace ( & mut  krate. external_traits ,  FxHashMap ( ) ) , 
539543        deref_trait_did, 
@@ -3422,6 +3426,16 @@ impl<'a> fmt::Display for Sidebar<'a> {
34223426            write ! ( fmt,  "{}" ,  it. name. as_ref( ) . unwrap( ) ) ?; 
34233427            write ! ( fmt,  "</p>" ) ?; 
34243428
3429+             if  it. is_crate ( )  { 
3430+                 if  let  Some ( ref  version)  = cache ( ) . crate_version  { 
3431+                     write ! ( fmt, 
3432+                            "<div class='block version'>\  
3433+ \ 
3434+ , 
3435+                            version) ?; 
3436+                 } 
3437+             } 
3438+ 
34253439            match  it. inner  { 
34263440                clean:: StructItem ( ref  s)  => sidebar_struct ( fmt,  it,  s) ?, 
34273441                clean:: TraitItem ( ref  t)  => sidebar_trait ( fmt,  it,  t) ?, 
0 commit comments