Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for namespace attribute #6279

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/storage_namespace/src/main.sw
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ contract;
use std::storage::storage_api::{read, write};

// ANCHOR: storage_namespace
#[namespace(example_namespace)]
storage {
example_namespace {
foo: u64 = 0,
},
// ANCHOR_END: storage_namespace
foo: u64 = 0,
}

abi StorageNamespaceExample {
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
Loading