Skip to content

Commit 068c8db

Browse files
Remove unused descr methods
1 parent d16e62b commit 068c8db

File tree

2 files changed

+1
-29
lines changed

2 files changed

+1
-29
lines changed

compiler/rustc_hir/src/hir.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3141,15 +3141,6 @@ pub enum TraitItemKind<'hir> {
31413141
/// type.
31423142
Type(GenericBounds<'hir>, Option<&'hir Ty<'hir>>),
31433143
}
3144-
impl TraitItemKind<'_> {
3145-
pub fn descr(&self) -> &'static str {
3146-
match self {
3147-
TraitItemKind::Const(..) => "associated constant",
3148-
TraitItemKind::Fn(..) => "function",
3149-
TraitItemKind::Type(..) => "associated type",
3150-
}
3151-
}
3152-
}
31533144

31543145
// The bodies for items are stored "out of line", in a separate
31553146
// hashmap in the `Crate`. Here we just record the hir-id of the item
@@ -3211,15 +3202,6 @@ pub enum ImplItemKind<'hir> {
32113202
/// An associated type.
32123203
Type(&'hir Ty<'hir>),
32133204
}
3214-
impl ImplItemKind<'_> {
3215-
pub fn descr(&self) -> &'static str {
3216-
match self {
3217-
ImplItemKind::Const(..) => "associated constant",
3218-
ImplItemKind::Fn(..) => "function",
3219-
ImplItemKind::Type(..) => "associated type",
3220-
}
3221-
}
3222-
}
32233205

32243206
/// A constraint on an associated item.
32253207
///
@@ -4545,16 +4527,6 @@ pub enum ForeignItemKind<'hir> {
45454527
Type,
45464528
}
45474529

4548-
impl ForeignItemKind<'_> {
4549-
pub fn descr(&self) -> &'static str {
4550-
match self {
4551-
ForeignItemKind::Fn(..) => "function",
4552-
ForeignItemKind::Static(..) => "static variable",
4553-
ForeignItemKind::Type => "type",
4554-
}
4555-
}
4556-
}
4557-
45584530
/// A variable captured by a closure.
45594531
#[derive(Debug, Copy, Clone, HashStable_Generic)]
45604532
pub struct Upvar {

tests/ui/did_you_mean/replace-impl-infer-ty-from-trait.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trait Foo<T>: Sized {
77

88
impl Foo<usize> for () {
99
fn bar(i: i32, t: usize, s: &()) -> (usize, i32) {
10-
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for functions
10+
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated functions
1111
//~| ERROR type annotations needed
1212
(1, 2)
1313
}

0 commit comments

Comments
 (0)