Skip to content

Commit 629a414

Browse files
committedOct 26, 2022
Auto merge of #103562 - Dylan-DPC:rollup-sheepp5, r=Dylan-DPC
Rollup of 10 pull requests Successful merges: - #102951 (suggest type annotation for local statement initialed by ref expression) - #103209 (Diagnostic derives: allow specifying multiple alternative suggestions) - #103287 (Use a faster allocation size check in slice::from_raw_parts) - #103416 (Name the `impl Trait` in region bound suggestions) - #103430 (Workaround unstable stmt_expr_attributes for method receiver expressions) - #103444 (Remove extra type error after missing semicolon error) - #103520 (rustc_middle: Rearrange resolver outputs structures slightly) - #103533 (Use &self instead of &mut self for cast methods) - #103536 (Remove `rustc_driver::set_sigpipe_handler()`) - #103542 (Pinning tests for some `macro_rules!` errors discussed in the lang meeting) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
·
1.89.01.66.0
2 parents d49e7e7 + 703fb66 commit 629a414

File tree

50 files changed

+753
-180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+753
-180
lines changed
 

‎compiler/rustc_ast/src/mut_visit.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ pub trait MutVisitor: Sized {
152152
noop_visit_expr(e, self);
153153
}
154154

155+
/// This method is a hack to workaround unstable of `stmt_expr_attributes`.
156+
/// It can be removed once that feature is stabilized.
157+
fn visit_method_receiver_expr(&mut self, ex: &mut P<Expr>) {
158+
self.visit_expr(ex)
159+
}
160+
155161
fn filter_map_expr(&mut self, e: P<Expr>) -> Option<P<Expr>> {
156162
noop_filter_map_expr(e, self)
157163
}
@@ -1301,7 +1307,7 @@ pub fn noop_visit_expr<T: MutVisitor>(
13011307
vis.visit_ident(ident);
13021308
vis.visit_id(id);
13031309
visit_opt(args, |args| vis.visit_generic_args(args));
1304-
vis.visit_expr(receiver);
1310+
vis.visit_method_receiver_expr(receiver);
13051311
visit_exprs(exprs, vis);
13061312
vis.visit_span(span);
13071313
}
@@ -1589,3 +1595,9 @@ impl DummyAstNode for Crate {
15891595
}
15901596
}
15911597
}
1598+
1599+
impl<N: DummyAstNode, T: DummyAstNode> DummyAstNode for crate::ast_traits::AstNodeWrapper<N, T> {
1600+
fn dummy() -> Self {
1601+
crate::ast_traits::AstNodeWrapper::new(N::dummy(), T::dummy())
1602+
}
1603+
}

‎compiler/rustc_ast/src/visit.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ pub trait Visitor<'ast>: Sized {
140140
fn visit_expr(&mut self, ex: &'ast Expr) {
141141
walk_expr(self, ex)
142142
}
143+
/// This method is a hack to workaround unstable of `stmt_expr_attributes`.
144+
/// It can be removed once that feature is stabilized.
145+
fn visit_method_receiver_expr(&mut self, ex: &'ast Expr) {
146+
self.visit_expr(ex)
147+
}
143148
fn visit_expr_post(&mut self, _ex: &'ast Expr) {}
144149
fn visit_ty(&mut self, t: &'ast Ty) {
145150
walk_ty(self, t)

0 commit comments

Comments
 (0)
Please sign in to comment.