<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Module on ErrorVault — Developer Error Code Dictionary</title><link>https://errorvault.dev/tags/module/</link><description>Recent content in Module on ErrorVault — Developer Error Code Dictionary</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 18 Sep 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://errorvault.dev/tags/module/feed.xml" rel="self" type="application/rss+xml"/><item><title>Fix E0001: Expected item, found semicolon in Rust module</title><link>https://errorvault.dev/rust/rust-e0001-expected-item-found-semicolon/</link><pubDate>Wed, 18 Sep 2024 00:00:00 +0000</pubDate><guid>https://errorvault.dev/rust/rust-e0001-expected-item-found-semicolon/</guid><description>&lt;h1 id="fix-e0001-expected-item-found-semicolon-in-rust-module">Fix E0001: Expected item, found semicolon in Rust module&lt;/h1>
&lt;h2 id="1-symptoms">1. Symptoms&lt;/h2>
&lt;p>Rust compiler error &lt;code>E0001&lt;/code> manifests during parsing when a semicolon (&lt;code>;&lt;/code>) appears in a context expecting a top-level &lt;em>item&lt;/em>. Items in Rust include functions (&lt;code>fn&lt;/code>), structs (&lt;code>struct&lt;/code>), enums (&lt;code>enum&lt;/code>), modules (&lt;code>mod&lt;/code>), traits (&lt;code>trait&lt;/code>), impl blocks (&lt;code>impl&lt;/code>), constants (&lt;code>const&lt;/code>), and statics (&lt;code>static&lt;/code>).&lt;/p>
&lt;p>The error message typically looks like this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>error[E0001]: expected item, found `;`
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> --&amp;gt; src/main.rs:3:1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> |
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>3 | ;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> | ^ expected item
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This occurs at module scope (file or &lt;code>mod&lt;/code> block level), not inside functions where statements are allowed.&lt;/p></description></item></channel></rss>