Skip to content

Commit

Permalink
Remove handling of #[rustc_deprecated]
Browse files Browse the repository at this point in the history
  • Loading branch information
jhpratt committed Apr 14, 2022
1 parent 15844bf commit 5ca9ffe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
1 change: 1 addition & 0 deletions crates/hir_def/src/builtin_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
ungated!(feature, CrateLevel, template!(List: "name1, name1, ...")),
// FIXME(#14407) -- only looked at on-demand so we can't
// guarantee they'll have already been checked.
// FIXME(jhpratt) remove this when #[rustc_deprecated] is fully removed from the compiler
ungated!(
rustc_deprecated, AssumedUsed,
template!(List: r#"since = "version", reason = "...""#)
Expand Down
24 changes: 5 additions & 19 deletions crates/ide_completion/src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl<'a> RenderContext<'a> {

fn is_deprecated(&self, def: impl HasAttrs) -> bool {
let attrs = def.attrs(self.db());
attrs.by_key("deprecated").exists() || attrs.by_key("rustc_deprecated").exists()
attrs.by_key("deprecated").exists()
}

fn is_deprecated_assoc_item(&self, as_assoc_item: impl AsAssocItem) -> bool {
Expand Down Expand Up @@ -667,8 +667,6 @@ fn main() { let _: m::Spam = S$0 }
r#"
#[deprecated]
fn something_deprecated() {}
#[rustc_deprecated(since = "1.0.0")]
fn something_else_deprecated() {}
fn main() { som$0 }
"#,
Expand All @@ -677,8 +675,8 @@ fn main() { som$0 }
[
CompletionItem {
label: "main()",
source_range: 127..130,
delete: 127..130,
source_range: 56..59,
delete: 56..59,
insert: "main()$0",
kind: SymbolKind(
Function,
Expand All @@ -688,8 +686,8 @@ fn main() { som$0 }
},
CompletionItem {
label: "something_deprecated()",
source_range: 127..130,
delete: 127..130,
source_range: 56..59,
delete: 56..59,
insert: "something_deprecated()$0",
kind: SymbolKind(
Function,
Expand All @@ -698,18 +696,6 @@ fn main() { som$0 }
detail: "fn()",
deprecated: true,
},
CompletionItem {
label: "something_else_deprecated()",
source_range: 127..130,
delete: 127..130,
insert: "something_else_deprecated()$0",
kind: SymbolKind(
Function,
),
lookup: "something_else_deprecated",
detail: "fn()",
deprecated: true,
},
]
"#]],
);
Expand Down

0 comments on commit 5ca9ffe

Please sign in to comment.