From a2e9e94b7ecbf31782d30b8679ff7d03528fbe0e Mon Sep 17 00:00:00 2001 From: Ori Ziv Date: Mon, 30 Oct 2023 12:02:22 +0200 Subject: [PATCH] Made unsupported attribute error not happen on dropped elements. --- crates/cairo-lang-defs/src/db.rs | 14 +++++++------- crates/cairo-lang-plugins/src/test_data/config | 4 ++++ .../plugin/plugin_test_data/contracts/diagnostics | 4 ++-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/crates/cairo-lang-defs/src/db.rs b/crates/cairo-lang-defs/src/db.rs index c24b2ed3d40..40be6b86512 100644 --- a/crates/cairo-lang-defs/src/db.rs +++ b/crates/cairo-lang-defs/src/db.rs @@ -362,13 +362,6 @@ fn priv_module_data(db: &dyn DefsGroup, module_id: ModuleId) -> Maybe Maybe { let item_id = diff --git a/crates/cairo-lang-plugins/src/test_data/config b/crates/cairo-lang-plugins/src/test_data/config index 9a3967f13b7..948df8e24ed 100644 --- a/crates/cairo-lang-plugins/src/test_data/config +++ b/crates/cairo-lang-plugins/src/test_data/config @@ -42,6 +42,10 @@ fn f9() -> felt252 { 0 } #[cfg(b)] fn f10() -> felt252 { 0 } +#[cfg(no_cfg)] +#[unsupported_attr] +fn f11() -> felt252 { 0 } + trait RemoveTraitItem { fn f0(); #[cfg(a)] diff --git a/crates/cairo-lang-starknet/src/plugin/plugin_test_data/contracts/diagnostics b/crates/cairo-lang-starknet/src/plugin/plugin_test_data/contracts/diagnostics index 20ab2cd75e4..b9cb185254d 100644 --- a/crates/cairo-lang-starknet/src/plugin/plugin_test_data/contracts/diagnostics +++ b/crates/cairo-lang-starknet/src/plugin/plugin_test_data/contracts/diagnostics @@ -1956,12 +1956,12 @@ trait ContractAbi { } //! > expected_diagnostics -error: Plugin diagnostic: Unsupported attribute. +error: Plugin diagnostic: The 'contract' attribute was deprecated, please use `starknet::contract` instead. --> lib.cairo:1:1 #[contract] ^*********^ -error: Plugin diagnostic: The 'contract' attribute was deprecated, please use `starknet::contract` instead. +error: Plugin diagnostic: Unsupported attribute. --> lib.cairo:1:1 #[contract] ^*********^