rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structures

This commit is contained in:
Jonathan Dönszelmann
2024-12-13 14:47:11 +01:00
parent 1341366af9
commit efb98b6552
103 changed files with 481 additions and 395 deletions

View File

@@ -0,0 +1,21 @@
use std::fmt::{self, Display};
use rustc_macros::{Decodable, Encodable, HashStable_Generic, current_rustc_version};
#[derive(Encodable, Decodable, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(HashStable_Generic)]
pub struct RustcVersion {
pub major: u16,
pub minor: u16,
pub patch: u16,
}
impl RustcVersion {
pub const CURRENT: Self = current_rustc_version!();
}
impl Display for RustcVersion {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(formatter, "{}.{}.{}", self.major, self.minor, self.patch)
}
}