Skip to content

Contracts have unused lifetime by default #1437

@SkymanOne

Description

@SkymanOne

Summary

If we create a contract template, clippy complains about unused lifetime at [ink::contract] macro. The warning is suppressed in CI, and has no affect on performance (not tested), but it definitely affect developer experience.

Illustration

Screenshot 2022-10-18 at 13 07 28

Reproduction

  1. Checkout ink4.0
  2. Create a template smart contract with cargo contract new <name>
  3. Run cargo clippy

The output should look similar to:

warning: this lifetime isn't used in the impl
 --> lib.rs:3:1
  |
3 | #[ink::contract]
  | ^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
  = note: this warning originates in the attribute macro `ink::contract` (in Nightly builds, run with -Z macro-backtrace for more info)

Metadata

Metadata

Assignees

Labels

A-examples[examples] Work item

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions