1
Fork 0

add UI test + docs for E0789

This commit is contained in:
Ezra Shaw 2023-01-21 21:32:05 +13:00
parent 94a300b9b8
commit 00ff718da8
No known key found for this signature in database
GPG key ID: 17CD5C2ADAE0D344
5 changed files with 59 additions and 2 deletions

View file

@ -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`

View file

@ -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`.