---
source: crates/laburnum-syntax-macro/src/tests/error_tests.rs
expression: "use laburnum_syntax_macro::tests::error_tests::test_error_function_instead_of_struct"
snapshot_kind: text
---
Input: >
  #[laburnum_syntax(AST)]
  pub fn not_a_struct() -> i32 {
      42
  }

Error: >
  Error(
      [
          "#[laburnum_syntax] can only be applied to structs",
          "help: This attribute is designed to work with struct definitions only",
          "hint: Try using: #[laburnum_syntax(AST)] pub struct MyStruct { ... }",
      ],
  )
