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

Provide proper warning span for deprecated Contract methods #6982

Open
ironcev opened this issue Mar 4, 2025 · 0 comments
Open

Provide proper warning span for deprecated Contract methods #6982

ironcev opened this issue Mar 4, 2025 · 0 comments
Labels
compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen compiler General compiler. Should eventually become more specific as the issue is triaged P: low team:compiler Compiler Team

Comments

@ironcev
Copy link
Member

ironcev commented Mar 4, 2025

Currently, if we deprecate ABI provided methods or contract methods, the warning span points to autogenerated code.

E.g., for this code:

abi Abi {
    fn other_deprecated_to_be_abi_method();
} {
    #[deprecated]
    fn deprecated_abi_provided_method() {}
}

impl Abi for Contract {
    #[deprecated]
    fn other_deprecated_to_be_abi_method() {}
}

we will get:

warning
  --> <autogenerated>:9:15
   |
 7 | }
 8 | if _method_name == "other_deprecated_to_be_abi_method" {
 9 | let _result = __contract_entry_other_deprecated_to_be_abi_method();
   |               -------------------------------------------------- deprecated function
10 | __contract_ret(asm() { zero: raw_ptr }, 0);
11 | }
   |
____

warning
  --> <autogenerated>:13:15
   |
11 | }
12 | if _method_name == "deprecated_abi_provided_method" {
13 | let _result = __contract_entry_deprecated_abi_provided_method();
   |               ----------------------------------------------- deprecated function
14 | __contract_ret(asm() { zero: raw_ptr }, 0);
15 | }
@ironcev ironcev added compiler General compiler. Should eventually become more specific as the issue is triaged compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen P: low team:compiler Compiler Team labels Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen compiler General compiler. Should eventually become more specific as the issue is triaged P: low team:compiler Compiler Team
Projects
None yet
Development

No branches or pull requests

1 participant