Skip to content

Review primary lint diagnostic location #3

@jamie-osec

Description

@jamie-osec
warning: account `profile` is initialized but the following fields are never assigned: display_name
   --> src/lib.rs:433:5
    |
433 |     pub profile: Account<'info, UserProfile>, // [missing_account_field_init]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: In this function
   --> src/lib.rs:121:5
    |
121 | /     pub fn init_collection_and_profile_incomplete(
122 | |         ctx: Context<InitCollectionAndProfileIncomplete>,
123 | |         max_collectable_tokens: u64,
124 | |         display_name: String,
...   |
135 | |         Ok(())
136 | |     }
    | |_____^
    = note: `#[warn(missing_account_field_init)]` on by default

In this case, the error is the function failing to initialze the account, so the primary lint span should be there (with a note pointing to the init attribute).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions