librustc: Stop assuming that implementations and traits only contain
methods. This paves the way to associated items by introducing an extra level of abstraction ("impl-or-trait item") between traits/implementations and methods. This new abstraction is encoded in the metadata and used throughout the compiler where appropriate. There are no functional changes; this is purely a refactoring.
This commit is contained in:
parent
404978ea72
commit
9907fa4acc
49 changed files with 1909 additions and 1103 deletions
|
@ -154,7 +154,7 @@ pub struct Static {
|
|||
|
||||
pub struct Trait {
|
||||
pub name: Ident,
|
||||
pub methods: Vec<ast::TraitMethod>, //should be TraitMethod
|
||||
pub items: Vec<ast::TraitItem>, //should be TraitItem
|
||||
pub generics: ast::Generics,
|
||||
pub parents: Vec<ast::TraitRef>,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
|
@ -168,7 +168,7 @@ pub struct Impl {
|
|||
pub generics: ast::Generics,
|
||||
pub trait_: Option<ast::TraitRef>,
|
||||
pub for_: ast::P<ast::Ty>,
|
||||
pub methods: Vec<Gc<ast::Method>>,
|
||||
pub items: Vec<ast::ImplItem>,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub where: Span,
|
||||
pub vis: ast::Visibility,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue