Short answer:
The answer is that there's no difference. In this case, #[account]
has no effect in the generated code. The reason for this is that the parsing logic for the #[account]
macro in this specific case does nothing because no arguments are passed to it.
Long-winded answer:
You can see that here. The call to attr.parse_args_with
returns a list of comma-separated arguments for the #[account]
macro. In this case, it returns nothing because there are no arguments, hence constraints.add
is never called and the parse
function generates zero constraints.
Since the resulting ConstraintGroup
type is what anchor uses to generate the resulting code and it's "empty" in this case, nothing is generated. You can also see evidence of this in the codegen code here. Since we get back an empty vector, nothing gets generated.