Skip to content

Provide proper warning span for deprecated Contract methods #6982

Open
@ironcev

Description

@ironcev

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 | }

Metadata

Metadata

Assignees

No one assigned

    Labels

    P: lowcompilerGeneral compiler. Should eventually become more specific as the issue is triagedcompiler: frontendEverything to do with type checking, control flow analysis, and everything between parsing and IRgenteam:compilerCompiler Team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions