Improve formatting within make_mir_visitor
macro body.
rustfmt doesn't touch it because it's a macro body, but it's large enough that the misformatting is annoying. This commit improves it. The most common problems fixed: - Unnecessary multi-line patterns reduced to one line. - Multi-line function headers adjusted so the parameter indentation doesn't depend on the length of the function name. (This is Rust code, not C.) - `|` used at the start of lines, not the end. - More consistent formatting of empty function bodies. - Overly long lines are broken.
This commit is contained in:
parent
311e8d3e5d
commit
5bb37ce764
1 changed files with 127 additions and 141 deletions
|
@ -294,9 +294,11 @@ macro_rules! make_mir_visitor {
|
||||||
super_body!(self, body, $($mutability, true)?);
|
super_body!(self, body, $($mutability, true)?);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn super_basic_block_data(&mut self,
|
fn super_basic_block_data(
|
||||||
block: BasicBlock,
|
&mut self,
|
||||||
data: & $($mutability)? BasicBlockData<'tcx>) {
|
block: BasicBlock,
|
||||||
|
data: & $($mutability)? BasicBlockData<'tcx>)
|
||||||
|
{
|
||||||
let BasicBlockData {
|
let BasicBlockData {
|
||||||
statements,
|
statements,
|
||||||
terminator,
|
terminator,
|
||||||
|
@ -341,24 +343,24 @@ macro_rules! make_mir_visitor {
|
||||||
match callee_def {
|
match callee_def {
|
||||||
ty::InstanceKind::Item(_def_id) => {}
|
ty::InstanceKind::Item(_def_id) => {}
|
||||||
|
|
||||||
ty::InstanceKind::Intrinsic(_def_id) |
|
ty::InstanceKind::Intrinsic(_def_id)
|
||||||
ty::InstanceKind::VTableShim(_def_id) |
|
| ty::InstanceKind::VTableShim(_def_id)
|
||||||
ty::InstanceKind::ReifyShim(_def_id, _) |
|
| ty::InstanceKind::ReifyShim(_def_id, _)
|
||||||
ty::InstanceKind::Virtual(_def_id, _) |
|
| ty::InstanceKind::Virtual(_def_id, _)
|
||||||
ty::InstanceKind::ThreadLocalShim(_def_id) |
|
| ty::InstanceKind::ThreadLocalShim(_def_id)
|
||||||
ty::InstanceKind::ClosureOnceShim { call_once: _def_id, track_caller: _ } |
|
| ty::InstanceKind::ClosureOnceShim { call_once: _def_id, track_caller: _ }
|
||||||
ty::InstanceKind::ConstructCoroutineInClosureShim {
|
| ty::InstanceKind::ConstructCoroutineInClosureShim {
|
||||||
coroutine_closure_def_id: _def_id,
|
coroutine_closure_def_id: _def_id,
|
||||||
receiver_by_ref: _,
|
receiver_by_ref: _,
|
||||||
} |
|
}
|
||||||
ty::InstanceKind::AsyncDropGlueCtorShim(_def_id, None) |
|
| ty::InstanceKind::AsyncDropGlueCtorShim(_def_id, None)
|
||||||
ty::InstanceKind::DropGlue(_def_id, None) => {}
|
| ty::InstanceKind::DropGlue(_def_id, None) => {}
|
||||||
|
|
||||||
ty::InstanceKind::FnPtrShim(_def_id, ty) |
|
ty::InstanceKind::FnPtrShim(_def_id, ty)
|
||||||
ty::InstanceKind::DropGlue(_def_id, Some(ty)) |
|
| ty::InstanceKind::DropGlue(_def_id, Some(ty))
|
||||||
ty::InstanceKind::CloneShim(_def_id, ty) |
|
| ty::InstanceKind::CloneShim(_def_id, ty)
|
||||||
ty::InstanceKind::FnPtrAddrShim(_def_id, ty) |
|
| ty::InstanceKind::FnPtrAddrShim(_def_id, ty)
|
||||||
ty::InstanceKind::AsyncDropGlueCtorShim(_def_id, Some(ty)) => {
|
| ty::InstanceKind::AsyncDropGlueCtorShim(_def_id, Some(ty)) => {
|
||||||
// FIXME(eddyb) use a better `TyContext` here.
|
// FIXME(eddyb) use a better `TyContext` here.
|
||||||
self.visit_ty($(& $mutability)? *ty, TyContext::Location(location));
|
self.visit_ty($(& $mutability)? *ty, TyContext::Location(location));
|
||||||
}
|
}
|
||||||
|
@ -370,19 +372,16 @@ macro_rules! make_mir_visitor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn super_statement(&mut self,
|
fn super_statement(
|
||||||
statement: & $($mutability)? Statement<'tcx>,
|
&mut self,
|
||||||
location: Location) {
|
statement: & $($mutability)? Statement<'tcx>,
|
||||||
let Statement {
|
location: Location
|
||||||
source_info,
|
) {
|
||||||
kind,
|
let Statement { source_info, kind } = statement;
|
||||||
} = statement;
|
|
||||||
|
|
||||||
self.visit_source_info(source_info);
|
self.visit_source_info(source_info);
|
||||||
match kind {
|
match kind {
|
||||||
StatementKind::Assign(
|
StatementKind::Assign(box (place, rvalue)) => {
|
||||||
box (place, rvalue)
|
|
||||||
) => {
|
|
||||||
self.visit_assign(place, rvalue, location);
|
self.visit_assign(place, rvalue, location);
|
||||||
}
|
}
|
||||||
StatementKind::FakeRead(box (_, place)) => {
|
StatementKind::FakeRead(box (_, place)) => {
|
||||||
|
@ -430,11 +429,13 @@ macro_rules! make_mir_visitor {
|
||||||
location
|
location
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
StatementKind::AscribeUserType(
|
StatementKind::AscribeUserType(box (place, user_ty), variance) => {
|
||||||
box (place, user_ty),
|
self.visit_ascribe_user_ty(
|
||||||
variance
|
place,
|
||||||
) => {
|
$(& $mutability)? *variance,
|
||||||
self.visit_ascribe_user_ty(place, $(& $mutability)? *variance, user_ty, location);
|
user_ty,
|
||||||
|
location
|
||||||
|
);
|
||||||
}
|
}
|
||||||
StatementKind::Coverage(coverage) => {
|
StatementKind::Coverage(coverage) => {
|
||||||
self.visit_coverage(
|
self.visit_coverage(
|
||||||
|
@ -445,7 +446,11 @@ macro_rules! make_mir_visitor {
|
||||||
StatementKind::Intrinsic(box ref $($mutability)? intrinsic) => {
|
StatementKind::Intrinsic(box ref $($mutability)? intrinsic) => {
|
||||||
match intrinsic {
|
match intrinsic {
|
||||||
NonDivergingIntrinsic::Assume(op) => self.visit_operand(op, location),
|
NonDivergingIntrinsic::Assume(op) => self.visit_operand(op, location),
|
||||||
NonDivergingIntrinsic::CopyNonOverlapping(CopyNonOverlapping { src, dst, count }) => {
|
NonDivergingIntrinsic::CopyNonOverlapping(CopyNonOverlapping {
|
||||||
|
src,
|
||||||
|
dst,
|
||||||
|
count
|
||||||
|
}) => {
|
||||||
self.visit_operand(src, location);
|
self.visit_operand(src, location);
|
||||||
self.visit_operand(dst, location);
|
self.visit_operand(dst, location);
|
||||||
self.visit_operand(count, location);
|
self.visit_operand(count, location);
|
||||||
|
@ -458,10 +463,12 @@ macro_rules! make_mir_visitor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn super_assign(&mut self,
|
fn super_assign(
|
||||||
place: &$($mutability)? Place<'tcx>,
|
&mut self,
|
||||||
rvalue: &$($mutability)? Rvalue<'tcx>,
|
place: &$($mutability)? Place<'tcx>,
|
||||||
location: Location) {
|
rvalue: &$($mutability)? Rvalue<'tcx>,
|
||||||
|
location: Location
|
||||||
|
) {
|
||||||
self.visit_place(
|
self.visit_place(
|
||||||
place,
|
place,
|
||||||
PlaceContext::MutatingUse(MutatingUseContext::Store),
|
PlaceContext::MutatingUse(MutatingUseContext::Store),
|
||||||
|
@ -470,20 +477,22 @@ macro_rules! make_mir_visitor {
|
||||||
self.visit_rvalue(rvalue, location);
|
self.visit_rvalue(rvalue, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn super_terminator(&mut self,
|
fn super_terminator(
|
||||||
terminator: &$($mutability)? Terminator<'tcx>,
|
&mut self,
|
||||||
location: Location) {
|
terminator: &$($mutability)? Terminator<'tcx>,
|
||||||
|
location: Location
|
||||||
|
) {
|
||||||
let Terminator { source_info, kind } = terminator;
|
let Terminator { source_info, kind } = terminator;
|
||||||
|
|
||||||
self.visit_source_info(source_info);
|
self.visit_source_info(source_info);
|
||||||
match kind {
|
match kind {
|
||||||
TerminatorKind::Goto { .. } |
|
TerminatorKind::Goto { .. }
|
||||||
TerminatorKind::UnwindResume |
|
| TerminatorKind::UnwindResume
|
||||||
TerminatorKind::UnwindTerminate(_) |
|
| TerminatorKind::UnwindTerminate(_)
|
||||||
TerminatorKind::CoroutineDrop |
|
| TerminatorKind::CoroutineDrop
|
||||||
TerminatorKind::Unreachable |
|
| TerminatorKind::Unreachable
|
||||||
TerminatorKind::FalseEdge { .. } |
|
| TerminatorKind::FalseEdge { .. }
|
||||||
TerminatorKind::FalseUnwind { .. } => {}
|
| TerminatorKind::FalseUnwind { .. } => {}
|
||||||
|
|
||||||
TerminatorKind::Return => {
|
TerminatorKind::Return => {
|
||||||
// `return` logically moves from the return place `_0`. Note that the place
|
// `return` logically moves from the return place `_0`. Note that the place
|
||||||
|
@ -502,19 +511,11 @@ macro_rules! make_mir_visitor {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
TerminatorKind::SwitchInt {
|
TerminatorKind::SwitchInt { discr, targets: _ } => {
|
||||||
discr,
|
|
||||||
targets: _
|
|
||||||
} => {
|
|
||||||
self.visit_operand(discr, location);
|
self.visit_operand(discr, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
TerminatorKind::Drop {
|
TerminatorKind::Drop { place, target: _, unwind: _, replace: _ } => {
|
||||||
place,
|
|
||||||
target: _,
|
|
||||||
unwind: _,
|
|
||||||
replace: _,
|
|
||||||
} => {
|
|
||||||
self.visit_place(
|
self.visit_place(
|
||||||
place,
|
place,
|
||||||
PlaceContext::MutatingUse(MutatingUseContext::Drop),
|
PlaceContext::MutatingUse(MutatingUseContext::Drop),
|
||||||
|
@ -543,11 +544,7 @@ macro_rules! make_mir_visitor {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
TerminatorKind::TailCall {
|
TerminatorKind::TailCall { func, args, fn_span } => {
|
||||||
func,
|
|
||||||
args,
|
|
||||||
fn_span,
|
|
||||||
} => {
|
|
||||||
self.visit_span($(& $mutability)? *fn_span);
|
self.visit_span($(& $mutability)? *fn_span);
|
||||||
self.visit_operand(func, location);
|
self.visit_operand(func, location);
|
||||||
for arg in args {
|
for arg in args {
|
||||||
|
@ -555,23 +552,12 @@ macro_rules! make_mir_visitor {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
TerminatorKind::Assert {
|
TerminatorKind::Assert { cond, expected: _, msg, target: _, unwind: _ } => {
|
||||||
cond,
|
|
||||||
expected: _,
|
|
||||||
msg,
|
|
||||||
target: _,
|
|
||||||
unwind: _,
|
|
||||||
} => {
|
|
||||||
self.visit_operand(cond, location);
|
self.visit_operand(cond, location);
|
||||||
self.visit_assert_message(msg, location);
|
self.visit_assert_message(msg, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
TerminatorKind::Yield {
|
TerminatorKind::Yield { value, resume: _, resume_arg, drop: _ } => {
|
||||||
value,
|
|
||||||
resume: _,
|
|
||||||
resume_arg,
|
|
||||||
drop: _,
|
|
||||||
} => {
|
|
||||||
self.visit_operand(value, location);
|
self.visit_operand(value, location);
|
||||||
self.visit_place(
|
self.visit_place(
|
||||||
resume_arg,
|
resume_arg,
|
||||||
|
@ -624,9 +610,11 @@ macro_rules! make_mir_visitor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn super_assert_message(&mut self,
|
fn super_assert_message(
|
||||||
msg: & $($mutability)? AssertMessage<'tcx>,
|
&mut self,
|
||||||
location: Location) {
|
msg: & $($mutability)? AssertMessage<'tcx>,
|
||||||
|
location: Location
|
||||||
|
) {
|
||||||
use crate::mir::AssertKind::*;
|
use crate::mir::AssertKind::*;
|
||||||
match msg {
|
match msg {
|
||||||
BoundsCheck { len, index } => {
|
BoundsCheck { len, index } => {
|
||||||
|
@ -650,9 +638,11 @@ macro_rules! make_mir_visitor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn super_rvalue(&mut self,
|
fn super_rvalue(
|
||||||
rvalue: & $($mutability)? Rvalue<'tcx>,
|
&mut self,
|
||||||
location: Location) {
|
rvalue: & $($mutability)? Rvalue<'tcx>,
|
||||||
|
location: Location
|
||||||
|
) {
|
||||||
match rvalue {
|
match rvalue {
|
||||||
Rvalue::Use(operand) => {
|
Rvalue::Use(operand) => {
|
||||||
self.visit_operand(operand, location);
|
self.visit_operand(operand, location);
|
||||||
|
@ -679,6 +669,7 @@ macro_rules! make_mir_visitor {
|
||||||
};
|
};
|
||||||
self.visit_place(path, ctx, location);
|
self.visit_place(path, ctx, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
Rvalue::CopyForDeref(place) => {
|
Rvalue::CopyForDeref(place) => {
|
||||||
self.visit_place(
|
self.visit_place(
|
||||||
place,
|
place,
|
||||||
|
@ -742,8 +733,7 @@ macro_rules! make_mir_visitor {
|
||||||
AggregateKind::Array(ty) => {
|
AggregateKind::Array(ty) => {
|
||||||
self.visit_ty($(& $mutability)? *ty, TyContext::Location(location));
|
self.visit_ty($(& $mutability)? *ty, TyContext::Location(location));
|
||||||
}
|
}
|
||||||
AggregateKind::Tuple => {
|
AggregateKind::Tuple => {}
|
||||||
}
|
|
||||||
AggregateKind::Adt(
|
AggregateKind::Adt(
|
||||||
_adt_def,
|
_adt_def,
|
||||||
_variant_index,
|
_variant_index,
|
||||||
|
@ -753,22 +743,13 @@ macro_rules! make_mir_visitor {
|
||||||
) => {
|
) => {
|
||||||
self.visit_args(args, location);
|
self.visit_args(args, location);
|
||||||
}
|
}
|
||||||
AggregateKind::Closure(
|
AggregateKind::Closure(_, closure_args) => {
|
||||||
_,
|
|
||||||
closure_args
|
|
||||||
) => {
|
|
||||||
self.visit_args(closure_args, location);
|
self.visit_args(closure_args, location);
|
||||||
}
|
}
|
||||||
AggregateKind::Coroutine(
|
AggregateKind::Coroutine(_, coroutine_args) => {
|
||||||
_,
|
|
||||||
coroutine_args,
|
|
||||||
) => {
|
|
||||||
self.visit_args(coroutine_args, location);
|
self.visit_args(coroutine_args, location);
|
||||||
}
|
}
|
||||||
AggregateKind::CoroutineClosure(
|
AggregateKind::CoroutineClosure(_, coroutine_closure_args) => {
|
||||||
_,
|
|
||||||
coroutine_closure_args,
|
|
||||||
) => {
|
|
||||||
self.visit_args(coroutine_closure_args, location);
|
self.visit_args(coroutine_closure_args, location);
|
||||||
}
|
}
|
||||||
AggregateKind::RawPtr(ty, _) => {
|
AggregateKind::RawPtr(ty, _) => {
|
||||||
|
@ -793,9 +774,11 @@ macro_rules! make_mir_visitor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn super_operand(&mut self,
|
fn super_operand(
|
||||||
operand: & $($mutability)? Operand<'tcx>,
|
&mut self,
|
||||||
location: Location) {
|
operand: & $($mutability)? Operand<'tcx>,
|
||||||
|
location: Location
|
||||||
|
) {
|
||||||
match operand {
|
match operand {
|
||||||
Operand::Copy(place) => {
|
Operand::Copy(place) => {
|
||||||
self.visit_place(
|
self.visit_place(
|
||||||
|
@ -817,28 +800,36 @@ macro_rules! make_mir_visitor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn super_ascribe_user_ty(&mut self,
|
fn super_ascribe_user_ty(
|
||||||
place: & $($mutability)? Place<'tcx>,
|
&mut self,
|
||||||
variance: $(& $mutability)? ty::Variance,
|
place: & $($mutability)? Place<'tcx>,
|
||||||
user_ty: & $($mutability)? UserTypeProjection,
|
variance: $(& $mutability)? ty::Variance,
|
||||||
location: Location) {
|
user_ty: & $($mutability)? UserTypeProjection,
|
||||||
|
location: Location)
|
||||||
|
{
|
||||||
self.visit_place(
|
self.visit_place(
|
||||||
place,
|
place,
|
||||||
PlaceContext::NonUse(NonUseContext::AscribeUserTy($(* &$mutability *)? variance)),
|
PlaceContext::NonUse(
|
||||||
|
NonUseContext::AscribeUserTy($(* &$mutability *)? variance)
|
||||||
|
),
|
||||||
location
|
location
|
||||||
);
|
);
|
||||||
self.visit_user_type_projection(user_ty);
|
self.visit_user_type_projection(user_ty);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn super_coverage(&mut self,
|
fn super_coverage(
|
||||||
_kind: & $($mutability)? coverage::CoverageKind,
|
&mut self,
|
||||||
_location: Location) {
|
_kind: & $($mutability)? coverage::CoverageKind,
|
||||||
|
_location: Location
|
||||||
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn super_retag(&mut self,
|
fn super_retag(
|
||||||
_kind: $(& $mutability)? RetagKind,
|
&mut self,
|
||||||
place: & $($mutability)? Place<'tcx>,
|
_kind: $(& $mutability)? RetagKind,
|
||||||
location: Location) {
|
place: & $($mutability)? Place<'tcx>,
|
||||||
|
location: Location
|
||||||
|
) {
|
||||||
self.visit_place(
|
self.visit_place(
|
||||||
place,
|
place,
|
||||||
PlaceContext::MutatingUse(MutatingUseContext::Retag),
|
PlaceContext::MutatingUse(MutatingUseContext::Retag),
|
||||||
|
@ -846,9 +837,11 @@ macro_rules! make_mir_visitor {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn super_local_decl(&mut self,
|
fn super_local_decl(
|
||||||
local: Local,
|
&mut self,
|
||||||
local_decl: & $($mutability)? LocalDecl<'tcx>) {
|
local: Local,
|
||||||
|
local_decl: & $($mutability)? LocalDecl<'tcx>
|
||||||
|
) {
|
||||||
let LocalDecl {
|
let LocalDecl {
|
||||||
mutability: _,
|
mutability: _,
|
||||||
ty,
|
ty,
|
||||||
|
@ -892,7 +885,10 @@ macro_rules! make_mir_visitor {
|
||||||
|
|
||||||
self.visit_source_info(source_info);
|
self.visit_source_info(source_info);
|
||||||
let location = Location::START;
|
let location = Location::START;
|
||||||
if let Some(box VarDebugInfoFragment { ref $($mutability)? ty, ref $($mutability)? projection }) = composite {
|
if let Some(box VarDebugInfoFragment {
|
||||||
|
ref $($mutability)? ty,
|
||||||
|
ref $($mutability)? projection
|
||||||
|
}) = composite {
|
||||||
self.visit_ty($(& $mutability)? *ty, TyContext::Location(location));
|
self.visit_ty($(& $mutability)? *ty, TyContext::Location(location));
|
||||||
for elem in projection {
|
for elem in projection {
|
||||||
let ProjectionElem::Field(_, ty) = elem else { bug!() };
|
let ProjectionElem::Field(_, ty) = elem else { bug!() };
|
||||||
|
@ -910,10 +906,7 @@ macro_rules! make_mir_visitor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn super_source_scope(
|
fn super_source_scope(&mut self, _scope: $(& $mutability)? SourceScope) {}
|
||||||
&mut self,
|
|
||||||
_scope: $(& $mutability)? SourceScope
|
|
||||||
) {}
|
|
||||||
|
|
||||||
fn super_const_operand(
|
fn super_const_operand(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -929,8 +922,12 @@ macro_rules! make_mir_visitor {
|
||||||
self.visit_span($(& $mutability)? *span);
|
self.visit_span($(& $mutability)? *span);
|
||||||
match const_ {
|
match const_ {
|
||||||
Const::Ty(_, ct) => self.visit_ty_const($(&$mutability)? *ct, location),
|
Const::Ty(_, ct) => self.visit_ty_const($(&$mutability)? *ct, location),
|
||||||
Const::Val(_, ty) => self.visit_ty($(& $mutability)? *ty, TyContext::Location(location)),
|
Const::Val(_, ty) => {
|
||||||
Const::Unevaluated(_, ty) => self.visit_ty($(& $mutability)? *ty, TyContext::Location(location)),
|
self.visit_ty($(& $mutability)? *ty, TyContext::Location(location));
|
||||||
|
}
|
||||||
|
Const::Unevaluated(_, ty) => {
|
||||||
|
self.visit_ty($(& $mutability)? *ty, TyContext::Location(location));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -939,27 +936,18 @@ macro_rules! make_mir_visitor {
|
||||||
_ct: $(& $mutability)? ty::Const<'tcx>,
|
_ct: $(& $mutability)? ty::Const<'tcx>,
|
||||||
_location: Location,
|
_location: Location,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn super_span(&mut self, _span: $(& $mutability)? Span) {
|
fn super_span(&mut self, _span: $(& $mutability)? Span) {}
|
||||||
}
|
|
||||||
|
|
||||||
fn super_source_info(&mut self, source_info: & $($mutability)? SourceInfo) {
|
fn super_source_info(&mut self, source_info: & $($mutability)? SourceInfo) {
|
||||||
let SourceInfo {
|
let SourceInfo { span, scope } = source_info;
|
||||||
span,
|
|
||||||
scope,
|
|
||||||
} = source_info;
|
|
||||||
|
|
||||||
self.visit_span($(& $mutability)? *span);
|
self.visit_span($(& $mutability)? *span);
|
||||||
self.visit_source_scope($(& $mutability)? *scope);
|
self.visit_source_scope($(& $mutability)? *scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn super_user_type_projection(
|
fn super_user_type_projection(&mut self, _ty: & $($mutability)? UserTypeProjection) {}
|
||||||
&mut self,
|
|
||||||
_ty: & $($mutability)? UserTypeProjection,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
fn super_user_type_annotation(
|
fn super_user_type_annotation(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -970,14 +958,11 @@ macro_rules! make_mir_visitor {
|
||||||
self.visit_ty($(& $mutability)? ty.inferred_ty, TyContext::UserTy(ty.span));
|
self.visit_ty($(& $mutability)? ty.inferred_ty, TyContext::UserTy(ty.span));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn super_ty(&mut self, _ty: $(& $mutability)? Ty<'tcx>) {
|
fn super_ty(&mut self, _ty: $(& $mutability)? Ty<'tcx>) {}
|
||||||
}
|
|
||||||
|
|
||||||
fn super_region(&mut self, _region: $(& $mutability)? ty::Region<'tcx>) {
|
fn super_region(&mut self, _region: $(& $mutability)? ty::Region<'tcx>) {}
|
||||||
}
|
|
||||||
|
|
||||||
fn super_args(&mut self, _args: & $($mutability)? GenericArgsRef<'tcx>) {
|
fn super_args(&mut self, _args: & $($mutability)? GenericArgsRef<'tcx>) {}
|
||||||
}
|
|
||||||
|
|
||||||
// Convenience methods
|
// Convenience methods
|
||||||
|
|
||||||
|
@ -986,7 +971,8 @@ macro_rules! make_mir_visitor {
|
||||||
body: &$($mutability)? Body<'tcx>,
|
body: &$($mutability)? Body<'tcx>,
|
||||||
location: Location
|
location: Location
|
||||||
) {
|
) {
|
||||||
let basic_block = & $($mutability)? basic_blocks!(body, $($mutability, true)?)[location.block];
|
let basic_block =
|
||||||
|
& $($mutability)? basic_blocks!(body, $($mutability, true)?)[location.block];
|
||||||
if basic_block.statements.len() == location.statement_index {
|
if basic_block.statements.len() == location.statement_index {
|
||||||
if let Some(ref $($mutability)? terminator) = basic_block.terminator {
|
if let Some(ref $($mutability)? terminator) = basic_block.terminator {
|
||||||
self.visit_terminator(terminator, location)
|
self.visit_terminator(terminator, location)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue