forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#58202 - varkor:deprecated-future-external, …
…r=GuillaumeGomez Ignore future deprecations in #[deprecated] The future deprecation warnings should only apply to `#[rustc_deprecated]` as they take into account rustc's version. Fixes rust-lang#57952. I've also slightly modified rustdoc's display of future deprecation notices to make it more consistent, so I'm assigning a rustdoc team member for review to make sure this is okay. r? @GuillaumeGomez
- Loading branch information
Showing
10 changed files
with
134 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
#![feature(deprecated)] | ||
|
||
// @has deprecated_future/index.html '//*[@class="stab deprecated"]' \ | ||
// 'Deprecated' | ||
// @has deprecated_future/struct.S.html '//*[@class="stab deprecated"]' \ | ||
// 'Deprecating in 99.99.99: effectively never' | ||
// 'Deprecated since 99.99.99: effectively never' | ||
#[deprecated(since = "99.99.99", note = "effectively never")] | ||
pub struct S; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![feature(staged_api)] | ||
|
||
#![stable(feature = "rustc_deprecated-future-test", since = "1.0.0")] | ||
|
||
// @has rustc_deprecated_future/index.html '//*[@class="stab deprecated"]' \ | ||
// 'Deprecation planned' | ||
// @has rustc_deprecated_future/struct.S.html '//*[@class="stab deprecated"]' \ | ||
// 'Deprecating in 99.99.99: effectively never' | ||
#[rustc_deprecated(since = "99.99.99", reason = "effectively never")] | ||
#[stable(feature = "rustc_deprecated-future-test", since = "1.0.0")] | ||
pub struct S; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
// ignore-tidy-linelength | ||
|
||
// run-pass | ||
|
||
#![deny(deprecated_in_future)] | ||
|
||
#[deprecated(since = "99.99.99", note = "text")] | ||
pub fn deprecated_future() {} | ||
|
||
fn test() { | ||
deprecated_future(); //~ ERROR use of item 'deprecated_future' that will be deprecated in future version 99.99.99: text | ||
deprecated_future(); // ok; deprecated_in_future only applies to rustc_deprecated | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,8 @@ | ||
error: use of item 'deprecated_future' that will be deprecated in future version 99.99.99: text | ||
--> $DIR/deprecation-in-future.rs:9:5 | ||
warning: use of deprecated item 'deprecated_future': text | ||
--> $DIR/deprecation-in-future.rs:11:5 | ||
| | ||
LL | deprecated_future(); //~ ERROR use of item 'deprecated_future' that will be deprecated in future version 99.99.99: text | ||
LL | deprecated_future(); // ok; deprecated_in_future only applies to rustc_deprecated | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
note: lint level defined here | ||
--> $DIR/deprecation-in-future.rs:3:9 | ||
| | ||
LL | #![deny(deprecated_in_future)] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
= note: #[warn(deprecated)] on by default | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.