Skip to content

Commit 3d2d209

Browse files
committed
Auto merge of #11983 - jhpratt:remove-rustc_deprecated, r=lnicola
Remove handling of `#[rustc_deprecated]` This should be merged along with rust-lang/rust#95960. Because the attribute still exists in rustc, I've left the definition here. With that said, any use of it is an error, so I've removed any handling of `#[rustc_deprecated]`.
2 parents 5d5bbec + 3c376e5 commit 3d2d209

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

crates/hir-def/src/builtin_attr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
274274
ungated!(feature, CrateLevel, template!(List: "name1, name1, ...")),
275275
// FIXME(#14407) -- only looked at on-demand so we can't
276276
// guarantee they'll have already been checked.
277+
// FIXME(jhpratt) remove this when #[rustc_deprecated] is fully removed from the compiler
277278
ungated!(
278279
rustc_deprecated, AssumedUsed,
279280
template!(List: r#"since = "version", reason = "...""#)

crates/ide-completion/src/render.rs

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl<'a> RenderContext<'a> {
6767

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

7373
fn is_deprecated_assoc_item(&self, as_assoc_item: impl AsAssocItem) -> bool {
@@ -675,8 +675,6 @@ fn main() { let _: m::Spam = S$0 }
675675
r#"
676676
#[deprecated]
677677
fn something_deprecated() {}
678-
#[rustc_deprecated(since = "1.0.0")]
679-
fn something_else_deprecated() {}
680678
681679
fn main() { som$0 }
682680
"#,
@@ -685,8 +683,8 @@ fn main() { som$0 }
685683
[
686684
CompletionItem {
687685
label: "main()",
688-
source_range: 127..130,
689-
delete: 127..130,
686+
source_range: 56..59,
687+
delete: 56..59,
690688
insert: "main()$0",
691689
kind: SymbolKind(
692690
Function,
@@ -696,8 +694,8 @@ fn main() { som$0 }
696694
},
697695
CompletionItem {
698696
label: "something_deprecated()",
699-
source_range: 127..130,
700-
delete: 127..130,
697+
source_range: 56..59,
698+
delete: 56..59,
701699
insert: "something_deprecated()$0",
702700
kind: SymbolKind(
703701
Function,
@@ -706,18 +704,6 @@ fn main() { som$0 }
706704
detail: "fn()",
707705
deprecated: true,
708706
},
709-
CompletionItem {
710-
label: "something_else_deprecated()",
711-
source_range: 127..130,
712-
delete: 127..130,
713-
insert: "something_else_deprecated()$0",
714-
kind: SymbolKind(
715-
Function,
716-
),
717-
lookup: "something_else_deprecated",
718-
detail: "fn()",
719-
deprecated: true,
720-
},
721707
]
722708
"#]],
723709
);

0 commit comments

Comments
 (0)