Expand the version placeholder to the current version in stability attribute parsing
That way, the current version is shown in rustdoc etc.
This commit is contained in:
parent
d06e0e53eb
commit
7a5b1d7939
1 changed files with 8 additions and 0 deletions
|
@ -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 {
|
if let Some(feature) = feature {
|
||||||
// This additional check for stability is to make sure we
|
// This additional check for stability is to make sure we
|
||||||
// don't emit additional, irrelevant errors for malformed
|
// don't emit additional, irrelevant errors for malformed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue