Skip to content

Commit

Permalink
Rollup merge of #128341 - Alexendoo:parse-version-pub, r=compiler-errors
Browse files Browse the repository at this point in the history
Make `rustc_attr::parse_version` pub

I'd like to use it in Clippy but I'll make those changes in the Clippy repo after the sync so it doesn't cause a conflict with rust-lang/rust-clippy#13168
  • Loading branch information
matthiaskrgr authored Jul 29, 2024
2 parents 5de94b6 + eb0e716 commit 83734f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_attr/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ fn gate_cfg(gated_cfg: &GatedCfg, cfg_span: Span, sess: &Session, features: &Fea
/// Parse a rustc version number written inside string literal in an attribute,
/// like appears in `since = "1.0.0"`. Suffixes like "-dev" and "-nightly" are
/// not accepted in this position, unlike when parsing CFG_RELEASE.
fn parse_version(s: Symbol) -> Option<RustcVersion> {
pub fn parse_version(s: Symbol) -> Option<RustcVersion> {
let mut components = s.as_str().split('-');
let d = components.next()?;
if components.next().is_some() {
Expand Down

0 comments on commit 83734f2

Please sign in to comment.