Port #[rustc_layout_scalar_valid_range_start/end] to the new attribute parsing infrastructure

Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
This commit is contained in:
Jonathan Brouwer
2025-06-25 09:44:52 +02:00
parent e61dd437f3
commit f98ea3d144
14 changed files with 146 additions and 69 deletions

View File

@@ -49,6 +49,16 @@ pub trait PrintAttribute {
fn print_attribute(&self, p: &mut Printer);
}
impl PrintAttribute for u128 {
fn should_render(&self) -> bool {
true
}
fn print_attribute(&self, p: &mut Printer) {
p.word(self.to_string())
}
}
impl<T: PrintAttribute> PrintAttribute for &T {
fn should_render(&self) -> bool {
T::should_render(self)