Skip to content

Commit 637181a

Browse files
authored
Unrolled build for rust-lang#120750
Rollup merge of rust-lang#120750 - compiler-errors:itctx-by-val, r=cjgillot No need to take `ImplTraitContext` by ref We used to mutate `ImplTraitContext`, so it used to be `&mut` mutable ref. Then I think it used to have non-`Copy` data in it, so we took it by `&` ref. Now, none of that remains, so just copy it around.
2 parents c29082f + cd21b1d commit 637181a

File tree

8 files changed

+90
-92
lines changed

8 files changed

+90
-92
lines changed

compiler/rustc_ast_lowering/src/asm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
205205
&sym.qself,
206206
&sym.path,
207207
ParamMode::Optional,
208-
&ImplTraitContext::Disallowed(ImplTraitPosition::Path),
208+
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
209209
None,
210210
);
211211
hir::InlineAsmOperand::SymStatic { path, def_id }

compiler/rustc_ast_lowering/src/block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
8585
let ty = l
8686
.ty
8787
.as_ref()
88-
.map(|t| self.lower_ty(t, &ImplTraitContext::Disallowed(ImplTraitPosition::Variable)));
88+
.map(|t| self.lower_ty(t, ImplTraitContext::Disallowed(ImplTraitPosition::Variable)));
8989
let init = l.kind.init().map(|init| self.lower_expr(init));
9090
let hir_id = self.lower_node_id(l.id);
9191
let pat = self.lower_pat(&l.pat);

compiler/rustc_ast_lowering/src/delegation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
218218
&delegation.qself,
219219
&delegation.path,
220220
ParamMode::Optional,
221-
&ImplTraitContext::Disallowed(ImplTraitPosition::Path),
221+
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
222222
None,
223223
);
224224
let block = delegation.body.as_deref();

compiler/rustc_ast_lowering/src/expr.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
9999
seg,
100100
ParamMode::Optional,
101101
ParenthesizedGenericArgs::Err,
102-
&ImplTraitContext::Disallowed(ImplTraitPosition::Path),
102+
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
103103
None,
104104
// Method calls can't have bound modifiers
105105
None,
@@ -141,13 +141,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
141141
ExprKind::Cast(expr, ty) => {
142142
let expr = self.lower_expr(expr);
143143
let ty =
144-
self.lower_ty(ty, &ImplTraitContext::Disallowed(ImplTraitPosition::Cast));
144+
self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Cast));
145145
hir::ExprKind::Cast(expr, ty)
146146
}
147147
ExprKind::Type(expr, ty) => {
148148
let expr = self.lower_expr(expr);
149149
let ty =
150-
self.lower_ty(ty, &ImplTraitContext::Disallowed(ImplTraitPosition::Cast));
150+
self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Cast));
151151
hir::ExprKind::Type(expr, ty)
152152
}
153153
ExprKind::AddrOf(k, m, ohs) => {
@@ -267,7 +267,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
267267
qself,
268268
path,
269269
ParamMode::Optional,
270-
&ImplTraitContext::Disallowed(ImplTraitPosition::Path),
270+
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
271271
None,
272272
);
273273
hir::ExprKind::Path(qpath)
@@ -295,7 +295,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
295295
ExprKind::OffsetOf(container, fields) => hir::ExprKind::OffsetOf(
296296
self.lower_ty(
297297
container,
298-
&ImplTraitContext::Disallowed(ImplTraitPosition::OffsetOf),
298+
ImplTraitContext::Disallowed(ImplTraitPosition::OffsetOf),
299299
),
300300
self.arena.alloc_from_iter(fields.iter().map(|&ident| self.lower_ident(ident))),
301301
),
@@ -314,7 +314,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
314314
&se.qself,
315315
&se.path,
316316
ParamMode::Optional,
317-
&ImplTraitContext::Disallowed(ImplTraitPosition::Path),
317+
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
318318
None,
319319
)),
320320
self.arena
@@ -1241,7 +1241,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
12411241
qself,
12421242
path,
12431243
ParamMode::Optional,
1244-
&ImplTraitContext::Disallowed(ImplTraitPosition::Path),
1244+
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
12451245
None,
12461246
);
12471247
// Destructure like a tuple struct.
@@ -1261,7 +1261,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
12611261
qself,
12621262
path,
12631263
ParamMode::Optional,
1264-
&ImplTraitContext::Disallowed(ImplTraitPosition::Path),
1264+
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
12651265
None,
12661266
);
12671267
// Destructure like a unit struct.
@@ -1286,7 +1286,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
12861286
&se.qself,
12871287
&se.path,
12881288
ParamMode::Optional,
1289-
&ImplTraitContext::Disallowed(ImplTraitPosition::Path),
1289+
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
12901290
None,
12911291
);
12921292
let fields_omitted = match &se.rest {

0 commit comments

Comments
 (0)