Skip to content

Rollup of 10 pull requests #142750

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

Closed
wants to merge 28 commits into from
Closed
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
32cb8f1
Add trim_prefix and trim_suffix for slice and str.
deven Jun 11, 2025
067a99b
install docs for each target in different directory
Forist2034 Jun 13, 2025
71afc6f
Add test.
cjgillot Jun 16, 2025
c4b67c6
Reason about borrowed classes in CopyProp.
cjgillot Jun 16, 2025
b391494
add ChildExt(::send_signal)
Qelxiros Jun 18, 2025
b64fd13
convert the `optimize` attribute to a new parser
jdonszelmann Mar 9, 2025
5bd918f
vec_deque tests: remove static mut
hkBst Jun 18, 2025
3c418ec
bump rustdoc json format number for pretty print change of attribute
jdonszelmann Jun 18, 2025
021bcb9
fmt tests: remove static mut
hkBst Jun 18, 2025
c6e77b3
Reduce uses of `hir_crate`.
cjgillot Jun 18, 2025
7fa94af
Make feature suggestion more consistent.
cjgillot Jun 18, 2025
95cd989
expand: Remove some unnecessary generic parameters
petrochenkov Jun 18, 2025
f45ab4f
Update books
rustbot Jun 19, 2025
7760f8e
add comment to `src/bootstrap/build.rs`
fee1-dead Jun 19, 2025
ede4891
Update compiler/rustc_interface/src/passes.rs
cjgillot Jun 19, 2025
ecdf220
vec tests: remove static mut
hkBst Jun 19, 2025
456c9da
vec_deque alloctests: remove static mut
hkBst Jun 19, 2025
9c22768
atomic tests: remove static mut
hkBst Jun 19, 2025
6c3cf25
Rollup merge of #138291 - jdonszelmann:optimize-attr, r=oli-obk
jhpratt Jun 19, 2025
ec293fd
Rollup merge of #141990 - Qelxiros:141975-unix_send_signal, r=ChrisDe…
jhpratt Jun 19, 2025
ae2b09e
Rollup merge of #142331 - deven:trim_prefix_suffix, r=Amanieu
jhpratt Jun 19, 2025
aa370b5
Rollup merge of #142478 - Forist2034:master, r=clubby789
jhpratt Jun 19, 2025
b8e28b7
Rollup merge of #142571 - cjgillot:borrowed-classes, r=oli-obk
jhpratt Jun 19, 2025
2d582ad
Rollup merge of #142668 - hkBst:less-static-mut, r=tgross35
jhpratt Jun 19, 2025
433ead3
Rollup merge of #142687 - cjgillot:less-hir_crate, r=oli-obk
jhpratt Jun 19, 2025
ce4a04c
Rollup merge of #142690 - petrochenkov:expnoparam, r=compiler-errors
jhpratt Jun 19, 2025
ed57a53
Rollup merge of #142699 - rustbot:docs-update, r=ehuss
jhpratt Jun 19, 2025
1f9b14b
Rollup merge of #142714 - fee1-dead-contrib:push-roxtwrlvtzur, r=Kobzol
jhpratt Jun 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 46 additions & 46 deletions compiler/rustc_expand/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ macro_rules! ast_fragments {
}
}

fn make_from<'a>(self, result: Box<dyn MacResult + 'a>) -> Option<AstFragment> {
fn make_from(self, result: Box<dyn MacResult + '_>) -> Option<AstFragment> {
match self {
AstFragmentKind::OptExpr =>
result.make_expr().map(Some).map(AstFragment::OptExpr),
Expand Down Expand Up @@ -136,7 +136,7 @@ macro_rules! ast_fragments {
T::fragment_to_output(self)
}

pub(crate) fn mut_visit_with<F: MutVisitor>(&mut self, vis: &mut F) {
pub(crate) fn mut_visit_with(&mut self, vis: &mut impl MutVisitor) {
match self {
AstFragment::OptExpr(opt_expr) => {
if let Some(expr) = opt_expr.take() {
Expand Down Expand Up @@ -316,9 +316,9 @@ impl AstFragmentKind {
}
}

pub(crate) fn expect_from_annotatables<I: IntoIterator<Item = Annotatable>>(
pub(crate) fn expect_from_annotatables(
self,
items: I,
items: impl IntoIterator<Item = Annotatable>,
) -> AstFragment {
let mut items = items.into_iter();
match self {
Expand Down Expand Up @@ -1218,10 +1218,10 @@ trait InvocationCollectorNode: HasAttrs + HasNodeId + Sized {
fn descr() -> &'static str {
unreachable!()
}
fn walk_flat_map<V: MutVisitor>(self, _visitor: &mut V) -> Self::OutputTy {
fn walk_flat_map(self, _collector: &mut InvocationCollector<'_, '_>) -> Self::OutputTy {
unreachable!()
}
fn walk<V: MutVisitor>(&mut self, _visitor: &mut V) {
fn walk(&mut self, _collector: &mut InvocationCollector<'_, '_>) {
unreachable!()
}
fn is_mac_call(&self) -> bool {
Expand Down Expand Up @@ -1276,8 +1276,8 @@ impl InvocationCollectorNode for P<ast::Item> {
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_items()
}
fn walk_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy {
walk_flat_map_item(visitor, self)
fn walk_flat_map(self, collector: &mut InvocationCollector<'_, '_>) -> Self::OutputTy {
walk_flat_map_item(collector, self)
}
fn is_mac_call(&self) -> bool {
matches!(self.kind, ItemKind::MacCall(..))
Expand Down Expand Up @@ -1431,8 +1431,8 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::AssocItem>, TraitItemTag>
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_trait_items()
}
fn walk_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy {
walk_flat_map_assoc_item(visitor, self.wrapped, AssocCtxt::Trait)
fn walk_flat_map(self, collector: &mut InvocationCollector<'_, '_>) -> Self::OutputTy {
walk_flat_map_assoc_item(collector, self.wrapped, AssocCtxt::Trait)
}
fn is_mac_call(&self) -> bool {
matches!(self.wrapped.kind, AssocItemKind::MacCall(..))
Expand Down Expand Up @@ -1472,8 +1472,8 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::AssocItem>, ImplItemTag>
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_impl_items()
}
fn walk_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy {
walk_flat_map_assoc_item(visitor, self.wrapped, AssocCtxt::Impl { of_trait: false })
fn walk_flat_map(self, collector: &mut InvocationCollector<'_, '_>) -> Self::OutputTy {
walk_flat_map_assoc_item(collector, self.wrapped, AssocCtxt::Impl { of_trait: false })
}
fn is_mac_call(&self) -> bool {
matches!(self.wrapped.kind, AssocItemKind::MacCall(..))
Expand Down Expand Up @@ -1513,8 +1513,8 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::AssocItem>, TraitImplItem
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_trait_impl_items()
}
fn walk_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy {
walk_flat_map_assoc_item(visitor, self.wrapped, AssocCtxt::Impl { of_trait: true })
fn walk_flat_map(self, collector: &mut InvocationCollector<'_, '_>) -> Self::OutputTy {
walk_flat_map_assoc_item(collector, self.wrapped, AssocCtxt::Impl { of_trait: true })
}
fn is_mac_call(&self) -> bool {
matches!(self.wrapped.kind, AssocItemKind::MacCall(..))
Expand Down Expand Up @@ -1551,8 +1551,8 @@ impl InvocationCollectorNode for P<ast::ForeignItem> {
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_foreign_items()
}
fn walk_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy {
walk_flat_map_foreign_item(visitor, self)
fn walk_flat_map(self, collector: &mut InvocationCollector<'_, '_>) -> Self::OutputTy {
walk_flat_map_foreign_item(collector, self)
}
fn is_mac_call(&self) -> bool {
matches!(self.kind, ForeignItemKind::MacCall(..))
Expand All @@ -1573,8 +1573,8 @@ impl InvocationCollectorNode for ast::Variant {
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_variants()
}
fn walk_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy {
walk_flat_map_variant(visitor, self)
fn walk_flat_map(self, collector: &mut InvocationCollector<'_, '_>) -> Self::OutputTy {
walk_flat_map_variant(collector, self)
}
}

Expand All @@ -1586,8 +1586,8 @@ impl InvocationCollectorNode for ast::WherePredicate {
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_where_predicates()
}
fn walk_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy {
walk_flat_map_where_predicate(visitor, self)
fn walk_flat_map(self, collector: &mut InvocationCollector<'_, '_>) -> Self::OutputTy {
walk_flat_map_where_predicate(collector, self)
}
}

Expand All @@ -1599,8 +1599,8 @@ impl InvocationCollectorNode for ast::FieldDef {
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_field_defs()
}
fn walk_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy {
walk_flat_map_field_def(visitor, self)
fn walk_flat_map(self, collector: &mut InvocationCollector<'_, '_>) -> Self::OutputTy {
walk_flat_map_field_def(collector, self)
}
}

Expand All @@ -1612,8 +1612,8 @@ impl InvocationCollectorNode for ast::PatField {
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_pat_fields()
}
fn walk_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy {
walk_flat_map_pat_field(visitor, self)
fn walk_flat_map(self, collector: &mut InvocationCollector<'_, '_>) -> Self::OutputTy {
walk_flat_map_pat_field(collector, self)
}
}

Expand All @@ -1625,8 +1625,8 @@ impl InvocationCollectorNode for ast::ExprField {
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_expr_fields()
}
fn walk_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy {
walk_flat_map_expr_field(visitor, self)
fn walk_flat_map(self, collector: &mut InvocationCollector<'_, '_>) -> Self::OutputTy {
walk_flat_map_expr_field(collector, self)
}
}

Expand All @@ -1638,8 +1638,8 @@ impl InvocationCollectorNode for ast::Param {
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_params()
}
fn walk_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy {
walk_flat_map_param(visitor, self)
fn walk_flat_map(self, collector: &mut InvocationCollector<'_, '_>) -> Self::OutputTy {
walk_flat_map_param(collector, self)
}
}

Expand All @@ -1651,8 +1651,8 @@ impl InvocationCollectorNode for ast::GenericParam {
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_generic_params()
}
fn walk_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy {
walk_flat_map_generic_param(visitor, self)
fn walk_flat_map(self, collector: &mut InvocationCollector<'_, '_>) -> Self::OutputTy {
walk_flat_map_generic_param(collector, self)
}
}

Expand All @@ -1664,8 +1664,8 @@ impl InvocationCollectorNode for ast::Arm {
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_arms()
}
fn walk_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy {
walk_flat_map_arm(visitor, self)
fn walk_flat_map(self, collector: &mut InvocationCollector<'_, '_>) -> Self::OutputTy {
walk_flat_map_arm(collector, self)
}
}

Expand All @@ -1677,8 +1677,8 @@ impl InvocationCollectorNode for ast::Stmt {
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_stmts()
}
fn walk_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy {
walk_flat_map_stmt(visitor, self)
fn walk_flat_map(self, collector: &mut InvocationCollector<'_, '_>) -> Self::OutputTy {
walk_flat_map_stmt(collector, self)
}
fn is_mac_call(&self) -> bool {
match &self.kind {
Expand Down Expand Up @@ -1751,8 +1751,8 @@ impl InvocationCollectorNode for ast::Crate {
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_crate()
}
fn walk<V: MutVisitor>(&mut self, visitor: &mut V) {
walk_crate(visitor, self)
fn walk(&mut self, collector: &mut InvocationCollector<'_, '_>) {
walk_crate(collector, self)
}
fn expand_cfg_false(
&mut self,
Expand All @@ -1777,8 +1777,8 @@ impl InvocationCollectorNode for ast::Ty {
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_ty()
}
fn walk<V: MutVisitor>(&mut self, visitor: &mut V) {
walk_ty(visitor, self)
fn walk(&mut self, collector: &mut InvocationCollector<'_, '_>) {
walk_ty(collector, self)
}
fn is_mac_call(&self) -> bool {
matches!(self.kind, ast::TyKind::MacCall(..))
Expand All @@ -1800,8 +1800,8 @@ impl InvocationCollectorNode for ast::Pat {
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_pat()
}
fn walk<V: MutVisitor>(&mut self, visitor: &mut V) {
walk_pat(visitor, self)
fn walk(&mut self, collector: &mut InvocationCollector<'_, '_>) {
walk_pat(collector, self)
}
fn is_mac_call(&self) -> bool {
matches!(self.kind, PatKind::MacCall(..))
Expand All @@ -1826,8 +1826,8 @@ impl InvocationCollectorNode for ast::Expr {
fn descr() -> &'static str {
"an expression"
}
fn walk<V: MutVisitor>(&mut self, visitor: &mut V) {
walk_expr(visitor, self)
fn walk(&mut self, collector: &mut InvocationCollector<'_, '_>) {
walk_expr(collector, self)
}
fn is_mac_call(&self) -> bool {
matches!(self.kind, ExprKind::MacCall(..))
Expand All @@ -1850,8 +1850,8 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::Expr>, OptExprTag> {
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
fragment.make_opt_expr()
}
fn walk_flat_map<V: MutVisitor>(mut self, visitor: &mut V) -> Self::OutputTy {
walk_expr(visitor, &mut self.wrapped);
fn walk_flat_map(mut self, collector: &mut InvocationCollector<'_, '_>) -> Self::OutputTy {
walk_expr(collector, &mut self.wrapped);
Some(self.wrapped)
}
fn is_mac_call(&self) -> bool {
Expand Down Expand Up @@ -1885,8 +1885,8 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::Expr>, MethodReceiverTag>
fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy {
AstNodeWrapper::new(fragment.make_method_receiver_expr(), MethodReceiverTag)
}
fn walk<V: MutVisitor>(&mut self, visitor: &mut V) {
walk_expr(visitor, &mut self.wrapped)
fn walk(&mut self, collector: &mut InvocationCollector<'_, '_>) {
walk_expr(collector, &mut self.wrapped)
}
fn is_mac_call(&self) -> bool {
matches!(self.wrapped.kind, ast::ExprKind::MacCall(..))
Expand Down