Skip to content

Commit 7d9130f

Browse files
committed
do not allow rustc::pass_by_value lint
1 parent c04106f commit 7d9130f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Diff for: compiler/rustc_middle/src/mir/visit.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,9 @@ macro_rules! make_mir_visitor {
192192
self.super_constant(constant, location);
193193
}
194194

195-
#[allow(rustc::pass_by_value)]
196195
fn visit_ty_const(
197196
&mut self,
198-
ct: & $($mutability)? ty::Const<'tcx>,
197+
ct: $( & $mutability)? ty::Const<'tcx>,
199198
location: Location,
200199
) {
201200
self.super_ty_const(ct, location);
@@ -636,7 +635,7 @@ macro_rules! make_mir_visitor {
636635

637636
Rvalue::Repeat(value, ct) => {
638637
self.visit_operand(value, location);
639-
self.visit_ty_const(ct, location);
638+
self.visit_ty_const($(&$mutability)? *ct, location);
640639
}
641640

642641
Rvalue::ThreadLocalRef(_) => {}
@@ -888,16 +887,15 @@ macro_rules! make_mir_visitor {
888887
self.visit_span($(& $mutability)? *span);
889888
drop(user_ty); // no visit method for this
890889
match literal {
891-
ConstantKind::Ty(ct) => self.visit_ty_const(ct, location),
890+
ConstantKind::Ty(ct) => self.visit_ty_const($(&$mutability)? *ct, location),
892891
ConstantKind::Val(_, ty) => self.visit_ty($(& $mutability)? *ty, TyContext::Location(location)),
893892
ConstantKind::Unevaluated(_, ty) => self.visit_ty($(& $mutability)? *ty, TyContext::Location(location)),
894893
}
895894
}
896895

897-
#[allow(rustc::pass_by_value)]
898896
fn super_ty_const(
899897
&mut self,
900-
_ct: & $($mutability)? ty::Const<'tcx>,
898+
_ct: $(& $mutability)? ty::Const<'tcx>,
901899
_location: Location,
902900
) {
903901

0 commit comments

Comments
 (0)