-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 PathListItem
s
#35618
Refactor PathListItem
s
#35618
Conversation
cc @Manishearth -- I'm not sure if this will cause breakage for plugins in practice. |
It will. |
pub struct PathListItem_ { | ||
pub name: Ident, | ||
/// renamed in list, e.g. `use foo::{bar as baz};` | ||
pub rename: Option<Ident>, |
There was a problem hiding this comment.
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 Name
s (cc #28659)
(Unless we are trying to future proof for some kind of item hygiene.)
There was a problem hiding this comment.
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 :)
LGTM, modulo more tests. |
40ef089
to
b725da1
Compare
This PR no longer changes diagnostics (c.f. this comment). |
☔ 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_`.
b725da1
to
9d99fe9
Compare
…=eddyb Refactor `PathListItem`s This refactors away variant `Mod` of `ast::PathListItemKind` and refactors the remaining variant `Ident` to a struct `ast::PathListItem_`.
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
syntax-[breaking-change] cc #31645
This refactors away variant
Mod
ofast::PathListItemKind
and refactors the remaining variantIdent
to a structast::PathListItem_
.r? @eddyb