Skip to content

Commit

Permalink
Add a test for rustc_deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Feb 11, 2019
1 parent c875241 commit b5fa870
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/ui/deprecation/rustc_deprecation-in-future.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// ignore-tidy-linelength

#![deny(deprecated_in_future)]

#![feature(staged_api)]

#![stable(feature = "rustc_deprecation-in-future-test", since = "1.0.0")]

#[rustc_deprecated(since = "99.99.99", reason = "effectively never")]
#[stable(feature = "rustc_deprecation-in-future-test", since = "1.0.0")]
pub struct S;

fn main() {
let _ = S; //~ ERROR use of item 'S' that will be deprecated in future version 99.99.99: effectively never
}
14 changes: 14 additions & 0 deletions src/test/ui/deprecation/rustc_deprecation-in-future.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error: use of item 'S' that will be deprecated in future version 99.99.99: effectively never
--> $DIR/rustc_deprecation-in-future.rs:14:13
|
LL | let _ = S; //~ ERROR use of item 'S' that will be deprecated in future version 99.99.99: effectively never
| ^
|
note: lint level defined here
--> $DIR/rustc_deprecation-in-future.rs:3:9
|
LL | #![deny(deprecated_in_future)]
| ^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

0 comments on commit b5fa870

Please sign in to comment.