]> git.lizzy.rs Git - rust.git/commit
Auto merge of #23265 - eddyb:meth-ast-refactor, r=nikomatsakis
authorbors <bors@rust-lang.org>
Thu, 12 Mar 2015 20:13:23 +0000 (20:13 +0000)
committerbors <bors@rust-lang.org>
Thu, 12 Mar 2015 20:13:23 +0000 (20:13 +0000)
commitc9b03c24ec346e6405883032094f47805ef9c43e
treecbb2bb6a0cd2a2e65b2cacd87d31bd8737f02e7d
parent538840bc2d1b634a2a34b2c8bd72d99894058b66
parent9da918548d77182ca64f375fb6da24036d5ad60c
Auto merge of #23265 - eddyb:meth-ast-refactor, r=nikomatsakis

The end result is that common fields (id, name, attributes, etc.) are stored in now-structures `ImplItem` and `TraitItem`.
The signature of a method is no longer duplicated between methods with a body (default/impl) and those without, they now share `MethodSig`.

This is also a [breaking-change] because of minor bugfixes and changes to syntax extensions:
* `pub fn` methods in a trait no longer parse - remove the `pub`, it has no meaning anymore
* `MacResult::make_methods` is now `make_impl_items` and the return type has changed accordingly
* `quote_method` is gone, because `P<ast::Method>` doesn't exist and it couldn't represent a full method anyways - could be replaced by `quote_impl_item`/`quote_trait_item` in the future, but I do hope we realize how silly that combinatorial macro expansion is and settle on a single `quote` macro + some type hints - or just no types at all (only token-trees)

r? @nikomatsakis This is necessary (hopefully also sufficient) for associated constants.
src/librustc/middle/ty.rs
src/libsyntax/ext/expand.rs
src/libsyntax/parse/parser.rs