Merge missing_non_modrs with modules

This commit is contained in:
reddevilmidzy 2025-11-28 16:10:18 +09:00
parent aa97acce62
commit cd618a9ccb
9 changed files with 16 additions and 20 deletions

View file

@ -939,12 +939,6 @@ Something is missing which could be added to fix (e.g. suggestions).
**FIXME**: this is way too vague, tests should be rehomed.
## `tests/ui/missing_non_modrs_mod/`
This directory is a small tree of `mod` dependencies, but the root, `foo.rs`, is looking for a file which does not exist. The test checks that the error is reported at the top-level module.
**FIXME**: Merge with `tests/ui/modules/`.
## `tests/ui/missing-trait-bounds/`
Tests for checking missing trait bounds, and their diagnostics.

View file

@ -1,4 +0,0 @@
mod foo;
fn main() {}
//~? ERROR file not found for module `missing`

View file

@ -1,4 +0,0 @@
mod foo_inline;
fn main() {}
//~? ERROR file not found for module `missing`

View file

@ -1,3 +1,3 @@
//@ ignore-auxiliary (used by `./missing_non_modrs_mod.rs`)
// looking for a file which does not exist.
mod missing;

View file

@ -1,5 +1,5 @@
//@ ignore-auxiliary (used by `./missing_non_modrs_mod_inline.rs`)
// looking for a file which does not exist.
mod inline {
mod missing;
}

View file

@ -0,0 +1,5 @@
//! Tests the error reporting when a declared module file is missing.
mod missing_mod;
fn main() {}
//~? ERROR file not found for module `missing`

View file

@ -1,10 +1,10 @@
error[E0583]: file not found for module `missing`
--> $DIR/foo.rs:3:1
--> $DIR/missing_mod.rs:3:1
|
LL | mod missing;
| ^^^^^^^^^^^^
|
= help: to create the module `missing`, create file "$DIR/foo/missing.rs" or "$DIR/foo/missing/mod.rs"
= help: to create the module `missing`, create file "$DIR/missing_mod/missing.rs" or "$DIR/missing_mod/missing/mod.rs"
= note: if there is a `mod missing` elsewhere in the crate already, import it with `use crate::...` instead
error: aborting due to 1 previous error

View file

@ -0,0 +1,5 @@
//! Tests the error reporting when a declared module file is missing.
mod missing_mod_inline;
fn main() {}
//~? ERROR file not found for module `missing`

View file

@ -1,10 +1,10 @@
error[E0583]: file not found for module `missing`
--> $DIR/foo_inline.rs:4:5
--> $DIR/missing_mod_inline.rs:4:5
|
LL | mod missing;
| ^^^^^^^^^^^^
|
= help: to create the module `missing`, create file "$DIR/foo_inline/inline/missing.rs" or "$DIR/foo_inline/inline/missing/mod.rs"
= help: to create the module `missing`, create file "$DIR/missing_mod_inline/inline/missing.rs" or "$DIR/missing_mod_inline/inline/missing/mod.rs"
= note: if there is a `mod missing` elsewhere in the crate already, import it with `use crate::...` instead
error: aborting due to 1 previous error