Catch cyclic imports harder. Add 2 tests to confirm.
This commit is contained in:
parent
fdaa723c4a
commit
ab3921f27e
3 changed files with 34 additions and 11 deletions
13
src/test/compile-fail/import-loop-2.rs
Normal file
13
src/test/compile-fail/import-loop-2.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
// error-pattern:cyclic import
|
||||
|
||||
mod a {
|
||||
import b.x;
|
||||
}
|
||||
|
||||
mod b {
|
||||
import a.x;
|
||||
|
||||
fn main() {
|
||||
auto y = x;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue