about summary refs log tree commit diff
path: root/compiler/rustc_attr_data_structures/src/attributes.rs
diff options
context:
space:
mode:
authorJana Dönszelmann <jana@donsz.nl>2025-03-09 23:46:47 +0100
committerJana Dönszelmann <jana@donsz.nl>2025-06-18 13:48:42 +0200
commitb64fd13a04e03bd260b550430daa6fbdf1fb27c9 (patch)
treee0146f6e81a64818c98c623035d4fe2609c20367 /compiler/rustc_attr_data_structures/src/attributes.rs
parent1bb335244c311a07cee165c28c553c869e6f64a9 (diff)
downloadrust-b64fd13a04e03bd260b550430daa6fbdf1fb27c9.tar.gz
rust-b64fd13a04e03bd260b550430daa6fbdf1fb27c9.zip
convert the `optimize` attribute to a new parser
Diffstat (limited to 'compiler/rustc_attr_data_structures/src/attributes.rs')
-rw-r--r--compiler/rustc_attr_data_structures/src/attributes.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_attr_data_structures/src/attributes.rs b/compiler/rustc_attr_data_structures/src/attributes.rs
index d4c43456049..e0b0015f365 100644
--- a/compiler/rustc_attr_data_structures/src/attributes.rs
+++ b/compiler/rustc_attr_data_structures/src/attributes.rs
@@ -38,7 +38,8 @@ pub enum InstructionSetAttr {
     ArmT32,
 }
 
-#[derive(Clone, Encodable, Decodable, Debug, PartialEq, Eq, HashStable_Generic, Default)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Default, PrintAttribute)]
+#[derive(Encodable, Decodable, HashStable_Generic)]
 pub enum OptimizeAttr {
     /// No `#[optimize(..)]` attribute
     #[default]
@@ -226,7 +227,8 @@ pub enum AttributeKind {
 
     /// Represents `#[rustc_macro_transparency]`.
     MacroTransparency(Transparency),
-
+    /// Represents `#[optimize(size|speed)]`
+    Optimize(OptimizeAttr, Span),
     /// Represents [`#[repr]`](https://doc.rust-lang.org/stable/reference/type-layout.html#representations).
     Repr(ThinVec<(ReprAttr, Span)>),