Rewrite and rename issue-22131 to rmake

This commit is contained in:
Oneirical 2024-07-11 14:01:37 -04:00
parent b01a977b07
commit 9dc08e30bd
4 changed files with 19 additions and 9 deletions

View File

@ -38,7 +38,6 @@ run-make/interdependent-c-libraries/Makefile
run-make/issue-107094/Makefile
run-make/issue-14698/Makefile
run-make/issue-15460/Makefile
run-make/issue-22131/Makefile
run-make/issue-26006/Makefile
run-make/issue-28595/Makefile
run-make/issue-33329/Makefile

View File

@ -1,8 +0,0 @@
# ignore-cross-compile
include ../tools.mk
all: foo.rs
$(RUSTC) --cfg 'feature="bar"' --crate-type lib foo.rs
$(RUSTDOC) --test --cfg 'feature="bar"' \
-L $(TMPDIR) foo.rs |\
$(CGREP) 'foo.rs - foo (line 1) ... ok'

View File

@ -0,0 +1,19 @@
// A rustdoc bug caused the `feature=bar` syntax for the cfg flag to be interpreted
// wrongly, with `feature=bar` instead of just `bar` being understood as the feature name.
// After this was fixed in #22135, this test checks that this bug does not make a resurgence.
// See https://github.com/rust-lang/rust/issues/22131
//FIXME(Oneirical): try test-various
use run_make_support::{rustc, rustdoc};
fn main() {
rustc().cfg(r#"feature="bar""#).crate_type("lib").input("foo.rs").run();
rustdoc()
.arg("--test")
.arg("--cfg")
.arg(r#"feature="bar""#)
.input("foo.rs")
.run()
.assert_stdout_contains("foo.rs - foo (line 1) ... ok");
}