<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Proc-Macro on ErrorVault — Developer Error Code Dictionary</title>
    <link>https://errorvault.dev/tags/proc-macro/</link>
    <description>Recent content in Proc-Macro on ErrorVault — Developer Error Code Dictionary</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 09 Aug 2026 03:08:04 +0800</lastBuildDate>
    <atom:link href="https://errorvault.dev/tags/proc-macro/feed.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Fix E0438: Expected `;` or `=` after Expression in Rust Macro Context</title>
      <link>https://errorvault.dev/rust/rust-e0438-expected-semicolon-after-expression/</link>
      <pubDate>Sun, 09 Aug 2026 03:08:04 +0800</pubDate>
      <guid>https://errorvault.dev/rust/rust-e0438-expected-semicolon-after-expression/</guid>
      <description>&lt;h2 id=&#34;1-symptoms&#34;&gt;1. Symptoms&lt;/h2&gt;&#xA;&lt;p&gt;When Rust compiler error E0438 occurs, the compiler produces a diagnostic message indicating that it expected a semicolon (&lt;code&gt;;&lt;/code&gt;) or assignment operator (&lt;code&gt;=&lt;/code&gt;) after encountering an expression. This typically manifests when macro-generated code produces an incomplete statement that lacks proper termination.&lt;/p&gt;&#xA;&lt;p&gt;The error manifests with a message structure similar to the following:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;error[E0438]: expected `;` or `=` after expression&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  --&amp;gt; src/main.rs:12:5&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;   |&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;12 |     some_macro!(arg1 arg2)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;   |     ^^^^^^^^^^^^^^^^^^^^^ expected `;` or `=`&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In proc-macro contexts, the error may appear with slightly different wording but maintains the core semantics of expression termination failure. The error points to the macro invocation site rather than the macro definition itself, since the problem manifests during macro expansion evaluation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fix E0057: Invalid Attributes on Tuple Struct Constructor</title>
      <link>https://errorvault.dev/rust/rust-e0057-invalid-attributes-constructor/</link>
      <pubDate>Mon, 27 Jul 2026 07:56:04 +0800</pubDate>
      <guid>https://errorvault.dev/rust/rust-e0057-invalid-attributes-constructor/</guid>
      <description>&lt;h2 id=&#34;1-symptoms&#34;&gt;1. Symptoms&lt;/h2&gt;&#xA;&lt;p&gt;When attempting to compile code with invalid attributes on a tuple struct constructor, the Rust compiler emits error E0057 with a descriptive message indicating the specific problem. The error manifests during compilation and prevents the binary from being produced, even if the struct itself is syntactically correct.&lt;/p&gt;&#xA;&lt;p&gt;Typical compiler output includes the error code, a description of the issue, and the file location where the problematic attribute appears:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fix E0367: Malformed Attribute Syntax in Rust</title>
      <link>https://errorvault.dev/rust/rust-e0367-malformed-attribute-syntax/</link>
      <pubDate>Wed, 22 Jul 2026 03:08:04 +0800</pubDate>
      <guid>https://errorvault.dev/rust/rust-e0367-malformed-attribute-syntax/</guid>
      <description>&lt;h2 id=&#34;1-symptoms&#34;&gt;1. Symptoms&lt;/h2&gt;&#xA;&lt;p&gt;When the Rust compiler encounters a malformed attribute, it halts compilation and emits error E0367. This error manifests with several observable indicators that help developers identify the problematic code location.&lt;/p&gt;&#xA;&lt;p&gt;The compiler output typically includes the error code, a descriptive message, and a span pointing to the offending attribute. The error message generally reads &amp;ldquo;malformed &lt;code&gt;attribute&lt;/code&gt; attribute, expected &lt;code&gt;(&lt;/code&gt;&amp;rdquo; or a similar variant indicating the expected syntax structure.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fix E0798: Derive of #[serde]-like attribute should produce an item before calling set_proc_macro_attr</title>
      <link>https://errorvault.dev/rust/rust-e0798-derive-set-proc-macro-attr/</link>
      <pubDate>Wed, 03 Jun 2026 10:20:04 +0800</pubDate>
      <guid>https://errorvault.dev/rust/rust-e0798-derive-set-proc-macro-attr/</guid>
      <description>&lt;h1 id=&#34;fix-e0798-derive-of-serde-like-attribute-should-produce-an-item-before-calling-set_proc_macro_attr&#34;&gt;Fix E0798: Derive of &lt;code&gt;#[serde]&lt;/code&gt;-like attribute should produce an item before calling &lt;code&gt;set_proc_macro_attr&lt;/code&gt;&lt;/h1&gt;&#xA;&lt;h2 id=&#34;1-symptoms&#34;&gt;1. Symptoms&lt;/h2&gt;&#xA;&lt;p&gt;When compiling a Rust project that uses derive macros (commonly with &lt;code&gt;#[serde(Serialize, Deserialize)]&lt;/code&gt; or custom derive macros), you encounter the following error:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;error[E0798]: derive of `#[serde]`-like attribute should produce an item before calling `set_proc_macro_attr`&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  --&amp;gt; src/lib.rs:12:1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;   |&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;12 | #[derive(MyCustomDerive)]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;   |  ^^^^^^^^^^^^^^^^^^^^^^&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;---&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;The error appears at the `#[derive(...)]` attribute site on a struct, enum, or other item. The compiler message is unambiguous: the derive macro attempted to call `set_proc_macro_attr` (a proc-macro2 function) before producing any output item.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Additional symptoms that may accompany this error:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;```text&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;error: aborting due to 1 previous error&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;For more information about this error, try `rustc --explain E0798`.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&#xA;&lt;li&gt;The derive macro may fail to expand, leaving the original type untransformed.&lt;/li&gt;&#xA;&lt;li&gt;If the macro is used on multiple items, every invocation triggers the same error.&lt;/li&gt;&#xA;&lt;li&gt;The error is a hard compile-time failure — no binary or library is produced.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Example code that triggers E0798:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
