1
Fork 0

Default methods of traits are also AssocFn defs as they essentially desugar to a method in a new impl block

This commit is contained in:
Oli Scherer 2022-05-12 07:43:41 +00:00
parent ecaf7b7cee
commit 0e3d8d2b13

View file

@ -92,6 +92,7 @@ pub enum DefKind {
/// [RFC 2593]: https://github.com/rust-lang/rfcs/pull/2593 /// [RFC 2593]: https://github.com/rust-lang/rfcs/pull/2593
Ctor(CtorOf, CtorKind), Ctor(CtorOf, CtorKind),
/// Associated function: `impl MyStruct { fn associated() {} }` /// Associated function: `impl MyStruct { fn associated() {} }`
/// or `trait Foo { fn associated() {} }`
AssocFn, AssocFn,
/// Associated constant: `trait MyTrait { const ASSOC: usize; }` /// Associated constant: `trait MyTrait { const ASSOC: usize; }`
AssocConst, AssocConst,