@@ -10,7 +10,7 @@ use cairo_lang_semantic::types::get_impl_at_context;
1010use cairo_lang_semantic:: {
1111 ConcreteTraitId , ConcreteTraitLongId , ConcreteTypeId , GenericArgumentId , TypeId , TypeLongId ,
1212} ;
13- use cairo_lang_syntax:: attribute:: consts:: STARKNET_INTERFACE_ATTR ;
13+ use cairo_lang_syntax:: attribute:: consts:: { ALLOW_ATTR , STARKNET_INTERFACE_ATTR } ;
1414use cairo_lang_syntax:: node:: helpers:: QueryAttrs ;
1515use cairo_lang_syntax:: node:: ids:: SyntaxStablePtrId ;
1616use cairo_lang_syntax:: node:: { Terminal , TypedStablePtr , TypedSyntaxNode } ;
@@ -130,7 +130,7 @@ impl AnalyzerPlugin for StorageAnalyzer {
130130 if let Ok ( module_enums) = db. module_enums ( module_id) {
131131 for ( id, item) in module_enums. iter ( ) {
132132 if has_derive ( item, syntax_db, STORE_TRAIT ) . is_some ( )
133- && !item. has_attr_with_arg ( syntax_db, "allow" , ALLOW_NO_DEFAULT_VARIANT_ATTR )
133+ && !item. has_attr_with_arg ( syntax_db, ALLOW_ATTR , ALLOW_NO_DEFAULT_VARIANT_ATTR )
134134 {
135135 add_derive_store_enum_diags ( db, * id, & mut diagnostics) ;
136136 }
@@ -160,9 +160,9 @@ fn analyze_storage_struct(
160160 return ;
161161 } ;
162162 let allow_invalid_members =
163- struct_id. has_attr_with_arg ( db, "allow" , ALLOW_INVALID_STORAGE_MEMBERS_ATTR ) == Ok ( true ) ;
163+ struct_id. has_attr_with_arg ( db, ALLOW_ATTR , ALLOW_INVALID_STORAGE_MEMBERS_ATTR ) == Ok ( true ) ;
164164 let allow_collisions =
165- struct_id. has_attr_with_arg ( db, "allow" , ALLOW_COLLIDING_PATHS_ATTR ) == Ok ( true ) ;
165+ struct_id. has_attr_with_arg ( db, ALLOW_ATTR , ALLOW_COLLIDING_PATHS_ATTR ) == Ok ( true ) ;
166166
167167 let lookup_context = ImplLookupContext :: new (
168168 struct_id. module_file_id ( db. upcast ( ) ) . 0 ,
@@ -178,8 +178,11 @@ fn analyze_storage_struct(
178178 let member_type = member. ty . lookup_intern ( db) ;
179179 let concrete_trait_id = concrete_valid_storage_trait ( db, db. intern_type ( member_type) ) ;
180180
181- let member_allows_invalid =
182- member_ast. has_attr_with_arg ( db. upcast ( ) , "allow" , ALLOW_INVALID_STORAGE_MEMBERS_ATTR ) ;
181+ let member_allows_invalid = member_ast. has_attr_with_arg (
182+ db. upcast ( ) ,
183+ ALLOW_ATTR ,
184+ ALLOW_INVALID_STORAGE_MEMBERS_ATTR ,
185+ ) ;
183186
184187 if !( allow_invalid_members || member_allows_invalid) {
185188 let inference_result =
@@ -203,7 +206,7 @@ fn analyze_storage_struct(
203206
204207 // Check for storage path collisions.
205208 if allow_collisions
206- || member_ast. has_attr_with_arg ( db. upcast ( ) , "allow" , ALLOW_COLLIDING_PATHS_ATTR )
209+ || member_ast. has_attr_with_arg ( db. upcast ( ) , ALLOW_ATTR , ALLOW_COLLIDING_PATHS_ATTR )
207210 {
208211 continue ;
209212 }
0 commit comments