about summary refs log tree commit diff
path: root/tests/ui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-01-23 13:07:16 +0000
committerbors <bors@rust-lang.org>2023-01-23 13:07:16 +0000
commitc8e6a9e8b6251bbc8276cb78cabe1998deecbed7 (patch)
treef3fe6240d1392fe749d539d18df606b3b5b719fa /tests/ui
parent5bef91c6e902f3bded724713bd2a64ea50abbd25 (diff)
parenteae7f947b5394aabaa9ec104ce9bc7a8633badfc (diff)
downloadrust-c8e6a9e8b6251bbc8276cb78cabe1998deecbed7.tar.gz
rust-c8e6a9e8b6251bbc8276cb78cabe1998deecbed7.zip
Auto merge of #107220 - JohnTitor:rollup-5pvuz0z, r=JohnTitor
Rollup of 7 pull requests

Successful merges:

 - #106796 (BPF: Disable atomic CAS)
 - #106886 (Make stage2 rustdoc and proc-macro-srv disableable in x.py install)
 - #107101 (Filter param-env predicates for errors before calling `to_opt_poly_trait_pred`)
 - #107109 (ThinBox: Add intra-doc-links for Metadata)
 - #107148 (remove error code from `E0789`, add UI test/docs)
 - #107151 (Instantiate dominators algorithm only once)
 - #107153 (Consistently use dominates instead of is_dominated_by)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/error-codes/E0789.rs12
-rw-r--r--tests/ui/error-codes/E0789.stderr15
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/ui/error-codes/E0789.rs b/tests/ui/error-codes/E0789.rs
new file mode 100644
index 00000000000..c0cbbcc9d2d
--- /dev/null
+++ b/tests/ui/error-codes/E0789.rs
@@ -0,0 +1,12 @@
+// compile-flags: --crate-type lib
+
+#![feature(rustc_attrs)]
+#![feature(staged_api)]
+#![unstable(feature = "foo_module", reason = "...", issue = "123")]
+
+#[rustc_allowed_through_unstable_modules]
+// #[stable(feature = "foo", since = "1.0")]
+struct Foo;
+//~^ ERROR `rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute
+//~^^ ERROR `rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute
+// FIXME: we shouldn't have two errors here, only occurs when using `-Zdeduplicate-diagnostics=no`
diff --git a/tests/ui/error-codes/E0789.stderr b/tests/ui/error-codes/E0789.stderr
new file mode 100644
index 00000000000..faab92bae03
--- /dev/null
+++ b/tests/ui/error-codes/E0789.stderr
@@ -0,0 +1,15 @@
+error[E0789]: `rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute
+  --> $DIR/E0789.rs:9:1
+   |
+LL | struct Foo;
+   | ^^^^^^^^^^^
+
+error[E0789]: `rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute
+  --> $DIR/E0789.rs:9:1
+   |
+LL | struct Foo;
+   | ^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0789`.