about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-05-07 16:24:46 +0000
committerbors <bors@rust-lang.org>2021-05-07 16:24:46 +0000
commitca712bc4255cd0912e00ec2eee5b6a547385c2b0 (patch)
treeff4d9ea888df4811d26c260f8bd532d901c016df /src/test
parente5f83d24aee866a14753a7cedbb4e301dfe5bef5 (diff)
parent42848090b588a53bc31cfe3718090f488a69633e (diff)
downloadrust-ca712bc4255cd0912e00ec2eee5b6a547385c2b0.tar.gz
rust-ca712bc4255cd0912e00ec2eee5b6a547385c2b0.zip
Auto merge of #85036 - Dylan-DPC:rollup-4qfabo3, r=Dylan-DPC
Rollup of 9 pull requests

Successful merges:

 - #84254 (illumos should put libc last in library search order)
 - #84442 (Unify rustc and rustdoc parsing of `cfg()`)
 - #84655 (Cleanup of `wasm`)
 - #84866 (linker: Avoid library duplication with `/WHOLEARCHIVE`)
 - #84930 (rename LLVM target for RustyHermit)
 - #84991 (rustc: Support Rust-specific features in -Ctarget-feature)
 - #85029 (SGX mutex is movable)
 - #85030 (Rearrange SGX split module files)
 - #85033 (some further small cleanups)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-ui/invalid-cfg.rs4
-rw-r--r--src/test/rustdoc-ui/invalid-cfg.stderr14
-rw-r--r--src/test/rustdoc/doc-cfg.rs8
-rw-r--r--src/test/ui/target-feature/rust-specific-name-no-warnings.rs5
4 files changed, 31 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/invalid-cfg.rs b/src/test/rustdoc-ui/invalid-cfg.rs
new file mode 100644
index 00000000000..d237b8605c0
--- /dev/null
+++ b/src/test/rustdoc-ui/invalid-cfg.rs
@@ -0,0 +1,4 @@
+#![feature(doc_cfg)]
+#[doc(cfg = "x")] //~ ERROR not followed by parentheses
+#[doc(cfg(x, y))] //~ ERROR multiple `cfg` predicates
+struct S {}
diff --git a/src/test/rustdoc-ui/invalid-cfg.stderr b/src/test/rustdoc-ui/invalid-cfg.stderr
new file mode 100644
index 00000000000..dae238b052b
--- /dev/null
+++ b/src/test/rustdoc-ui/invalid-cfg.stderr
@@ -0,0 +1,14 @@
+error: `cfg` is not followed by parentheses
+  --> $DIR/invalid-cfg.rs:2:7
+   |
+LL | #[doc(cfg = "x")]
+   |       ^^^^^^^^^ help: expected syntax is: `cfg(/* predicate */)`
+
+error: multiple `cfg` predicates are specified
+  --> $DIR/invalid-cfg.rs:3:14
+   |
+LL | #[doc(cfg(x, y))]
+   |              ^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/rustdoc/doc-cfg.rs b/src/test/rustdoc/doc-cfg.rs
index 89a61a289fd..1fc80b3e76c 100644
--- a/src/test/rustdoc/doc-cfg.rs
+++ b/src/test/rustdoc/doc-cfg.rs
@@ -91,3 +91,11 @@ pub unsafe fn uses_target_feature() {
 pub fn uses_cfg_target_feature() {
     uses_target_feature();
 }
+
+// multiple attributes should be allowed
+// @has doc_cfg/fn.multiple_attrs.html \
+//  '//*[@id="main"]/*[@class="item-info"]/*[@class="stab portability"]' \
+//  'This is supported on x and y and z only.'
+#[doc(inline, cfg(x))]
+#[doc(cfg(y), cfg(z))]
+pub fn multiple_attrs() {}
diff --git a/src/test/ui/target-feature/rust-specific-name-no-warnings.rs b/src/test/ui/target-feature/rust-specific-name-no-warnings.rs
new file mode 100644
index 00000000000..1708a71a981
--- /dev/null
+++ b/src/test/ui/target-feature/rust-specific-name-no-warnings.rs
@@ -0,0 +1,5 @@
+// build-pass
+// only-x86
+// compile-flags: -C target-feature=+pclmulqdq
+
+fn main() {}