Rust errors / Names, paths and imports
Rust compiler error · checked with rustc 1.99.0
Rust error E0761: multiple candidate files were found for an out-of-line module
What it meansMultiple candidate files were found for an out-of-line module.
The compiler team's explanation
Multiple candidate files were found for an out-of-line module.
Erroneous code example:
// file: ambiguous_module/mod.rs
fn foo() {}
// file: ambiguous_module.rs
fn foo() {}
// file: lib.rs
mod ambiguous_module; // error: file for module `ambiguous_module`
// found at both ambiguous_module.rs and
// ambiguous_module/mod.rs
Please remove this ambiguity by deleting/renaming one of the candidate files.
From rustc --explain E0761 (1.99.0), part of the Rust project, MIT or Apache-2.0. Official page.
Related errors
- E0425cannot find value in this scope
- E0603is private
- E0432unresolved import
- E0005refutable pattern in local binding
- E0742visibilities can only be restricted to ancestor modules
- E0754trying to load file for module `řųśť` with non-ascii identifier name
- E0780Cannot use `doc(inline)` with anonymous imports
- E0789`rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute
Up next
Often hit nextE0425: cannot find value in this scopeA related error from the same family.Read it next →Did this answer your question?