-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Batch up libsyntax breaking changes #34424
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
…hod of trait `HasAttrs`.
… of by reference)
…reams. Modified tests to point to the new file now.
I prefer having reviewer info stick around in the merge commit somehow. I have a process for this 😄 |
you may also find this git alias useful for future stuff: |
Ok, didn't mean to disrupt your process. There were a lot of merge conflicts, mostly from my PRs, so I figured I'd take care of them. If you'd like to integrate that work from this branch into your process, feel free :) |
Nah, it's fine. I'm okay with others doing it, just leave the reviewer info and PR text in there somehow. Especially if you've already fixed merge conflicts. Could you use mergerollup() {
echo "Merging $@"
git branch -D current
git fetch origin pull/$2/head:current
NL="
"
A=$(wget -O - https://api.github.com/repos/rust-lang/rust/pulls/$2 -q| grep "\"body\":"| sed 's/^ "body": "//'|sed 's/",$//'| sed 's/\\n/\n/g' | sed 's/\\r//g')
git merge --no-ff current -m "Rollup merge of #$2 - $1, r=$3 $NL $A";
git mergetool
} which can be run using the code in #31645 (comment) |
Will do. |
☔ The latest upstream changes (presumably #34253) made this pull request unmergeable. Please resolve the merge conflicts. |
📌 Commit 542ba8c has been approved by |
@jseyfried - thanks :) |
⌛ Testing commit 542ba8c with merge df7ef54... |
💔 Test failed - auto-linux-64-opt-rustbuild |
@bors force r=Manishearth |
📌 Commit 360dcae has been approved by |
Batch up libsyntax breaking changes Batch of the following syntax-[breaking-change] changes: - #34213: Add a variant `Macro` to `TraitItemKind` - #34368: Merge the variant `QPath` of `PatKind` into the variant `PatKind::Path` - #34385: Move `syntax::ast::TokenTree` into a new module `syntax::tokenstream` - #33943: - Remove the type parameter from `visit::Visitor` - Remove `attr::WithAttrs` -- use `attr::HasAttrs` instead. - Change `fold_tt`/`fold_tts` to take token trees by value and avoid wrapping token trees in `Rc`. - Remove the field `ctxt` of `ast::Mac_` - Remove inherent method `attrs()` of types -- use the method `attrs` of `HasAttrs` instead. - #34316: - Remove `ast::Decl`/`ast::DeclKind` and add variants `Local` and `Item` to `StmtKind`. - Move the node id for statements from the `StmtKind` variants to a field of `Stmt` (making `Stmt` a struct instead of an alias for `Spanned<StmtKind>`) - Rename `ast::ExprKind::Again` to `Continue`. - #34339: Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>` - Use `.into()` in convert between `Vec<Attribute>` and `ThinVec<Attribute>` - Use autoderef instead of `.as_attr_slice()` - #34436: Remove the optional expression from `ast::Block` and instead use a `StmtKind::Expr` at the end of the statement list. - #34403: Move errors into a separate crate (unlikely to cause breakage)
That top comment is really helpful, thanks @jseyfried. |
Fix expansion performance regression **syntax-[breaking-change] cc #31645** This fixes #34630 by reverting commit 5bf7970 of PR #33943, which landed in #34424. By removing the `Rc<_>` wrapping around `Delimited` and `SequenceRepetition` in `TokenTree`, 5bf7970 made cloning `TokenTree`s more expensive. While this had no measurable performance impact on the compiler's crates, it caused an order of magnitude performance regression on some macro-heavy code in the wild. I believe this is due to clones of `TokenTree`s in `macro_parser.rs` and/or `macro_rules.rs`. r? @nrc
Fix expansion performance regression **syntax-[breaking-change] cc #31645** This fixes #34630 by reverting commit 5bf7970 of PR #33943, which landed in #34424. By removing the `Rc<_>` wrapping around `Delimited` and `SequenceRepetition` in `TokenTree`, 5bf7970 made cloning `TokenTree`s more expensive. While this had no measurable performance impact on the compiler's crates, it caused an order of magnitude performance regression on some macro-heavy code in the wild. I believe this is due to clones of `TokenTree`s in `macro_parser.rs` and/or `macro_rules.rs`. r? @nrc
Batch of the following syntax-[breaking-change] changes:
Macro
toTraitItemKind
QPath
ofPatKind
into the variantPatKind::Path
syntax::ast::TokenTree
into a new modulesyntax::tokenstream
visit::Visitor
attr::WithAttrs
-- useattr::HasAttrs
instead.fold_tt
/fold_tts
to take token trees by value and avoid wrapping token trees inRc
.ctxt
ofast::Mac_
attrs()
of types -- use the methodattrs
ofHasAttrs
instead.ast::Stmt
and renameExprKind::Again
toContinue
#34316:ast::Decl
/ast::DeclKind
and add variantsLocal
andItem
toStmtKind
.StmtKind
variants to a field ofStmt
(makingStmt
a struct instead of an alias forSpanned<StmtKind>
)ast::ExprKind::Again
toContinue
.ThinAttributes
toThinVec<Attribute>
#34339: Generalize and abstractThinAttributes
toThinVec<Attribute>
.into()
in convert betweenVec<Attribute>
andThinVec<Attribute>
.as_attr_slice()
ast::Block
and instead use aStmtKind::Expr
at the end of the statement list.