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

Fully implement #[deprecated] attribute #6942

Open
ironcev opened this issue Feb 19, 2025 · 0 comments
Open

Fully implement #[deprecated] attribute #6942

ironcev opened this issue Feb 19, 2025 · 0 comments
Assignees
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 team:compiler Compiler Team

Comments

@ironcev
Copy link
Member

ironcev commented Feb 19, 2025

Currently, only structs can be marked as #[deprecated] and the warning for using deprecated structs will not be emitted for all expressions in which a struct can be used.

Since we do not emit any error or warning for using #[deprecated] aside of stucts, this leads to a misleading usage, where items are annotated as #[depricated] but that annotation does not have any effect.

E.g., some examples of using #[deprecated] without any effect in the standard library:

  • std::constants::ZERO_B256
  • std::ecr::ec_recover
  • std::evm::ecr::ec_recover_evm_address

Warning for usages of #[deprecated] outside of struct declarations will be done in #6880.

This issues calls for step-wise implementation of #[deprecated] in two directions:

  • allowing it on all items where it makes sense.
  • checking for usages of deprecated items in all places.
@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 team:compiler Compiler Team labels Feb 19, 2025
@IGI-111 IGI-111 self-assigned this Feb 19, 2025
IGI-111 added a commit that referenced this issue Feb 20, 2025
Add support for the `#[deprecated]` attribute to functions, enums,
struct items, enum variants and propagate deprecation check exhaustively
throughout expressions variants.

Partially addresses #6942.

Support for deprecating traits, abis and the methods thereof in their
definitions is still missing, as well as scrutinees and storage fields.
IGI-111 added a commit that referenced this issue Feb 20, 2025
Add support for the `#[deprecated]` attribute to functions, enums,
struct items, enum variants and propagate deprecation check exhaustively
throughout expressions variants.

Partially addresses #6942.

Support for deprecating traits, abis and the methods thereof in their
definitions is still missing, as well as scrutinees and storage fields.
IGI-111 added a commit that referenced this issue Feb 20, 2025
Add support for the `#[deprecated]` attribute to functions, enums,
struct items, enum variants and propagate deprecation check exhaustively
throughout expressions variants.

Partially addresses #6942.

Support for deprecating traits, abis and the methods thereof in their
definitions is still missing, as well as scrutinees and storage fields.
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 team:compiler Compiler Team
Projects
None yet
Development

No branches or pull requests

2 participants