Skip to content

Commit ad92dc0

Browse files
Add regression test to use RUSTFLAGS value in doctests
1 parent 782d228 commit ad92dc0

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/rustdoc-ui/doctest/rustflags.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ check-pass
2+
//@ compile-flags: --test
3+
//@ rustc-env:RUSTFLAGS=--cap-lints=warn
4+
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
5+
6+
/// ```
7+
/// #![deny(warnings)]
8+
/// #![feature(async_await)]
9+
///
10+
/// let x = 12;
11+
/// ```
12+
pub struct Bar;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
running 1 test
3+
test $DIR/rustflags.rs - Bar (line 6) ... ok
4+
5+
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s
6+

0 commit comments

Comments
 (0)