Auto merge of #89395 - In-line:remove_visible_path_from_allowed_deprecated_lint, r=jyn514
Remove visible path calculation from allowed deprecation lint
This commit is contained in:
commit
4e4942dfa6
4 changed files with 78 additions and 47 deletions
|
|
@ -599,14 +599,14 @@ fn short_item_info(
|
|||
let mut extra_info = vec![];
|
||||
let error_codes = cx.shared.codes;
|
||||
|
||||
if let Some(Deprecation { note, since, is_since_rustc_version, suggestion: _ }) =
|
||||
if let Some(depr @ Deprecation { note, since, is_since_rustc_version: _, suggestion: _ }) =
|
||||
item.deprecation(cx.tcx())
|
||||
{
|
||||
// We display deprecation messages for #[deprecated] and #[rustc_deprecated]
|
||||
// but only display the future-deprecation messages for #[rustc_deprecated].
|
||||
let mut message = if let Some(since) = since {
|
||||
let since = &since.as_str();
|
||||
if !stability::deprecation_in_effect(is_since_rustc_version, Some(since)) {
|
||||
if !stability::deprecation_in_effect(&depr) {
|
||||
if *since == "TBD" {
|
||||
String::from("Deprecating in a future Rust version")
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -418,10 +418,7 @@ fn extra_info_tags(item: &clean::Item, parent: &clean::Item, tcx: TyCtxt<'_>) ->
|
|||
// The trailing space after each tag is to space it properly against the rest of the docs.
|
||||
if let Some(depr) = &item.deprecation(tcx) {
|
||||
let mut message = "Deprecated";
|
||||
if !stability::deprecation_in_effect(
|
||||
depr.is_since_rustc_version,
|
||||
depr.since.map(|s| s.as_str()).as_deref(),
|
||||
) {
|
||||
if !stability::deprecation_in_effect(depr) {
|
||||
message = "Deprecation planned";
|
||||
}
|
||||
tags += &tag_html("deprecated", "", message);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue