Skip to content

Commit

Permalink
Remove support for namespace attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
IGI-111 committed Jul 18, 2024
1 parent f9d51e7 commit 4827625
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion examples/storage_namespace/src/main.sw
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::storage::storage_api::{read, write};
storage {
example_namespace {
foo: u64 = 0,
}
},
// ANCHOR_END: storage_namespace
}

Expand Down
13 changes: 3 additions & 10 deletions sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ use sway_types::{
ALLOW_ATTRIBUTE_NAME, CFG_ATTRIBUTE_NAME, CFG_EXPERIMENTAL_NEW_ENCODING,
CFG_PROGRAM_TYPE_ARG_NAME, CFG_TARGET_ARG_NAME, DEPRECATED_ATTRIBUTE_NAME,
DOC_ATTRIBUTE_NAME, DOC_COMMENT_ATTRIBUTE_NAME, FALLBACK_ATTRIBUTE_NAME,
INLINE_ATTRIBUTE_NAME, NAMESPACE_ATTRIBUTE_NAME, PAYABLE_ATTRIBUTE_NAME,
STORAGE_PURITY_ATTRIBUTE_NAME, STORAGE_PURITY_READ_NAME, STORAGE_PURITY_WRITE_NAME,
TEST_ATTRIBUTE_NAME, VALID_ATTRIBUTE_NAMES,
INLINE_ATTRIBUTE_NAME, PAYABLE_ATTRIBUTE_NAME, STORAGE_PURITY_ATTRIBUTE_NAME,
STORAGE_PURITY_READ_NAME, STORAGE_PURITY_WRITE_NAME, TEST_ATTRIBUTE_NAME,
VALID_ATTRIBUTE_NAMES,
},
integer_bits::IntegerBits,
BaseIdent,
Expand Down Expand Up @@ -4698,13 +4698,6 @@ fn item_attrs_to_map(
let attrs = attr_decl.attribute.get().into_iter();
for attr in attrs {
let name = attr.name.as_str();
if name == NAMESPACE_ATTRIBUTE_NAME {
handler.emit_warn(CompileWarning {
span: attr_decl.span().clone(),
warning_content: Warning::NamespaceAttributeDeprecated,
});
continue;
}
if !VALID_ATTRIBUTE_NAMES.contains(&name) {
handler.emit_warn(CompileWarning {
span: attr_decl.span().clone(),
Expand Down
2 changes: 0 additions & 2 deletions sway-types/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ pub const CFG_EXPERIMENTAL_NEW_ENCODING: &str = "experimental_new_encoding";

pub const DEPRECATED_ATTRIBUTE_NAME: &str = "deprecated";

pub const NAMESPACE_ATTRIBUTE_NAME: &str = "namespace";

pub const FALLBACK_ATTRIBUTE_NAME: &str = "fallback";

/// The list of valid attributes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const S_13: b256 = 0x00000000000000000000000000000000000000000000000000000000000
const S_14: b256 = 0x0000000000000000000000000000000000000000000000000000000000000014;
const S_15: b256 = 0x0000000000000000000000000000000000000000000000000000000000000015;

#[namespace(my_storage_namespace)]
abi StorageTest {
#[storage(read, write)]
fn store_bool(value: bool);
Expand Down

0 comments on commit 4827625

Please # to comment.