Skip to content

Commit 08af772

Browse files
Add regression test for rust-lang#122722
1 parent 5467af2 commit 08af772

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//! ```
2+
//! let x = 12;
3+
//! ```
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
extern crate run_make_support;
2+
3+
use run_make_support::{out_dir, rustdoc};
4+
use std::{fs, iter};
5+
use std::path::Path;
6+
7+
fn generate_a_lot_of_cfgs(path: &Path) {
8+
let content = iter::repeat("--cfg=a\n").take(75_000).collect::<String>();
9+
fs::write(path, content.as_bytes()).expect("failed to create args file");
10+
}
11+
12+
fn main() -> Result<(), ()> {
13+
let arg_file = out_dir().join("args");
14+
generate_a_lot_of_cfgs(&arg_file);
15+
16+
let arg_file = format!("@{}", arg_file.display());
17+
if !rustdoc().arg("--test").arg(&arg_file).arg("foo.rs").run().status.success() {
18+
return Err(());
19+
}
20+
Ok(())
21+
}

0 commit comments

Comments
 (0)