Skip to content

Fully implement #[deprecated] attribute #6942

Open
@ironcev

Description

@ironcev

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 the following directions:

  • allowing it on all elements where it makes sense.
  • checking for usages of deprecated items in all places.
  • supporting deprecating parent elements and propagating the deprecation to all child elements. E.g., if we deprecated the whole module by annotating the module kind as #[deprecated] this should deprecated all the items in that module. Same is with deprecating, e.g., impls.

Metadata

Metadata

Assignees

Labels

compilerGeneral 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