Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor PathListItems #35618

Merged
merged 3 commits into from
Aug 30, 2016
Merged

Conversation

jseyfried
Copy link
Contributor

@jseyfried jseyfried commented Aug 12, 2016

syntax-[breaking-change] cc #31645
This refactors away variant Mod of ast::PathListItemKind and refactors the remaining variant Ident to a struct ast::PathListItem_.
r? @eddyb

@jseyfried
Copy link
Contributor Author

cc @Manishearth -- I'm not sure if this will cause breakage for plugins in practice.
cc @insaneinside @petrochenkov

@Manishearth
Copy link
Member

It will.

pub struct PathListItem_ {
pub name: Ident,
/// renamed in list, e.g. `use foo::{bar as baz};`
pub rename: Option<Ident>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name and rename can be Names (cc #28659)
(Unless we are trying to future proof for some kind of item hygiene.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless we are trying to future proof for some kind of item hygiene.

We are :)

@eddyb
Copy link
Member

eddyb commented Aug 12, 2016

LGTM, modulo more tests.

@jseyfried
Copy link
Contributor Author

This PR no longer changes diagnostics (c.f. this comment).

@bors
Copy link
Contributor

bors commented Aug 21, 2016

☔ The latest upstream changes (presumably #35776) made this pull request unmergeable. Please resolve the merge conflicts.

and refactor `ast::PathListItemKind::Ident` -> `ast::PathListItem_`.
and refacotor `hir::PathListItem_::Ident` -> `hir::PathListItem_`.
jseyfried added a commit to jseyfried/rust that referenced this pull request Aug 28, 2016
…=eddyb

Refactor `PathListItem`s

This refactors away variant `Mod` of `ast::PathListItemKind` and refactors the remaining variant `Ident` to a struct `ast::PathListItem_`.
bors added a commit that referenced this pull request Aug 30, 2016
Batch up libsyntax breaking changes

Batch of the following syntax-[breaking-change] changes:
 - #35591: Add a field `span: Span` to `ast::Generics`.
 - #35618: Remove variant `Mod` of `ast::PathListItemKind` and refactor the remaining variant `ast::PathListKind::Ident` to a struct `ast::PathListKind_`.
 - #35480: Change uses of `Constness` in the AST to `Spanned<Constness>`.
  - c.f. `MethodSig`, `ItemKind`
 - #35728: Refactor `cx.pat_enum()` into `cx.pat_tuple_struct()` and `cx.pat_path()`.
 - #35850: Generalize the elements of lists in attributes from `MetaItem` to a new type `NestedMetaItem` that can represent a `MetaItem` or a literal.
 - #35917: Remove traits `AttrMetaMethods`, `AttributeMethods`, and `AttrNestedMetaItemMethods`.
  - Besides removing imports of these traits, this won't cause fallout.
 - Add a variant `Union` to `ItemKind` to future proof for `union` (c.f. #36016).
 - Remove inherent methods `attrs` and `fold_attrs` of `Annotatable`.
  - Use methods `attrs` and `map_attrs` of `HasAttrs` instead.

r? @Manishearth
@bors bors merged commit 9d99fe9 into rust-lang:master Aug 30, 2016
@jseyfried jseyfried deleted the ast_view_path_refactor branch October 16, 2016 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants