File tree 3 files changed +35
-0
lines changed
3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ // check-pass
2
+ // compile-flags:--test -Zunstable-options --nocapture
3
+ // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
4
+ // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
5
+
6
+ /// ```compile_fail
7
+ /// fn foo() {
8
+ /// Input: 123
9
+ /// }
10
+ /// ```
11
+ pub struct Foo ;
Original file line number Diff line number Diff line change
1
+ error: struct literal body without path
2
+ --> $DIR/nocapture-fail.rs:7:10
3
+ |
4
+ LL | fn foo() {
5
+ | __________^
6
+ LL | | Input: 123
7
+ LL | | }
8
+ | |_^
9
+ |
10
+ help: you might have forgotten to add the struct literal inside the block
11
+ |
12
+ LL | fn foo() { SomeStruct {
13
+ LL | Input: 123
14
+ LL | } }
15
+ |
16
+
17
+ error: aborting due to previous error
18
+
Original file line number Diff line number Diff line change
1
+
2
+ running 1 test
3
+ test $DIR/nocapture-fail.rs - Foo (line 6) - compile fail ... ok
4
+
5
+ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
6
+
You can’t perform that action at this time.
0 commit comments