Add a test for rustc_deprecated
This commit is contained in:
parent
c8752415dc
commit
b5fa870760
2 changed files with 29 additions and 0 deletions
15
src/test/ui/deprecation/rustc_deprecation-in-future.rs
Normal file
15
src/test/ui/deprecation/rustc_deprecation-in-future.rs
Normal file
|
@ -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
src/test/ui/deprecation/rustc_deprecation-in-future.stderr
Normal file
14
src/test/ui/deprecation/rustc_deprecation-in-future.stderr
Normal file
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue