Skip to content

Commit

Permalink
Expand the version placeholder to the current version in stability at…
Browse files Browse the repository at this point in the history
…tribute parsing

That way, the current version is shown in rustdoc etc.
  • Loading branch information
est31 committed Aug 27, 2022
1 parent d06e0e5 commit 7a5b1d7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions compiler/rustc_passes/src/lib_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ impl<'tcx> LibFeatureCollector<'tcx> {
}
}
}
const VERSION_PLACEHOLDER: &str = "CURRENT_RUSTC_VERSION";

if let Some(s) = since && s.as_str() == VERSION_PLACEHOLDER {
let version = option_env!("CFG_VERSION").unwrap_or("<current>");
let version = version.split(' ').next().unwrap();
since = Some(Symbol::intern(&version));
}

if let Some(feature) = feature {
// This additional check for stability is to make sure we
// don't emit additional, irrelevant errors for malformed
Expand Down

0 comments on commit 7a5b1d7

Please sign in to comment.