Skip to content

Commit 61c55e3

Browse files
authored
Rollup merge of #114093 - Enselic:stdin-unknown-mod, r=Mark-Simulacrum
Add regression test for `echo 'mod unknown;' | rustc -` Closes #65601 The bug is fixed since long ago, probably by #69838 (see #65601 (comment) for more details). Add a regression test so we can close the issue.
2 parents bab20b4 + 392bfc6 commit 61c55e3

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# ignore-windows
2+
3+
include ../tools.mk
4+
5+
all:
6+
echo 'mod unknown;' | $(RUSTC) --crate-type rlib - >$(TMPDIR)/unknown-mod.stdout 2>$(TMPDIR)/unknown-mod.stderr || echo "failed successfully"
7+
8+
# Bless like this: RUSTC_BLESS_TEST=1 ./x.py test tests/run-make/unknown-mod-stdin
9+
ifdef RUSTC_BLESS_TEST
10+
cp "$(TMPDIR)"/unknown-mod.stdout unknown-mod.stdout
11+
cp "$(TMPDIR)"/unknown-mod.stderr unknown-mod.stderr
12+
else
13+
$(DIFF) unknown-mod.stdout "$(TMPDIR)"/unknown-mod.stdout
14+
$(DIFF) unknown-mod.stderr "$(TMPDIR)"/unknown-mod.stderr
15+
endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0583]: file not found for module `unknown`
2+
--> <anon>:1:1
3+
|
4+
1 | mod unknown;
5+
| ^^^^^^^^^^^^
6+
|
7+
= help: to create the module `unknown`, create file "unknown.rs" or "unknown/mod.rs"
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0583`.

tests/run-make/unknown-mod-stdin/unknown-mod.stdout

Whitespace-only changes.

0 commit comments

Comments
 (0)