add UI test + docs for E0789
This commit is contained in:
parent
94a300b9b8
commit
00ff718da8
5 changed files with 59 additions and 2 deletions
12
tests/ui/error-codes/E0789.rs
Normal file
12
tests/ui/error-codes/E0789.rs
Normal 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`
|
15
tests/ui/error-codes/E0789.stderr
Normal file
15
tests/ui/error-codes/E0789.stderr
Normal 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`.
|
Loading…
Add table
Add a link
Reference in a new issue