-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Ignore future deprecations in #[deprecated] #58202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3737d4d
Do not apply future deprecation warning for #[deprecated]
varkor 87cd09b
Don't display "Deprecated since" for non-rustc deprecated items
varkor 2a8a25b
Display "Deprecation planned" in rustdoc for future rustc deprecations
varkor 3dc660f
Update existing rustdoc test
varkor 01df8fe
Add a rustdoc test for future rustc_deprecated attributes
varkor c875241
Add rustdoc index page test for future deprecation attributes
varkor b5fa870
Add a test for rustc_deprecated
varkor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.