We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d51fe6e commit 942b449Copy full SHA for 942b449
tests/rustdoc-ui/doctest/nested-main.rs
@@ -0,0 +1,15 @@
1
+//@ check-pass
2
+//@ compile-flags:--test
3
+//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
4
+//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
5
+
6
+// Regression test for <https://github.com/rust-lang/rust/issues/131893>.
7
+// It ensures that if a function called `main` is nested, it will not consider
8
+// it as the `main` function.
9
10
+/// ```
11
+/// fn dox() {
12
+/// fn main() {}
13
+/// }
14
15
+pub fn foo() {}
tests/rustdoc-ui/doctest/nested-main.stdout
@@ -0,0 +1,6 @@
+running 1 test
+test $DIR/nested-main.rs - foo (line 10) ... ok
+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
0 commit comments