Skip to content

Commit 0e3d8d2

Browse files
committed
Default methods of traits are also AssocFn defs as they essentially desugar to a method in a new impl block
1 parent ecaf7b7 commit 0e3d8d2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/rustc_hir/src/def.rs

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ pub enum DefKind {
9292
/// [RFC 2593]: https://github.com/rust-lang/rfcs/pull/2593
9393
Ctor(CtorOf, CtorKind),
9494
/// Associated function: `impl MyStruct { fn associated() {} }`
95+
/// or `trait Foo { fn associated() {} }`
9596
AssocFn,
9697
/// Associated constant: `trait MyTrait { const ASSOC: usize; }`
9798
AssocConst,

0 commit comments

Comments
 (0)