hir: Use InferArg
in ArrayLen::Infer
This commit is contained in:
parent
5f8030dcc9
commit
b2b5b91bfb
8 changed files with 16 additions and 11 deletions
|
@ -2529,7 +2529,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
|||
}
|
||||
hir::TyKind::Array(ty, length) => {
|
||||
let length = match length {
|
||||
&hir::ArrayLen::Infer(_, span) => self.ct_infer(tcx.types.usize, None, span),
|
||||
hir::ArrayLen::Infer(inf) => self.ct_infer(tcx.types.usize, None, inf.span),
|
||||
hir::ArrayLen::Body(constant) => {
|
||||
ty::Const::from_anon_const(tcx, constant.def_id)
|
||||
}
|
||||
|
|
|
@ -146,8 +146,8 @@ impl<'v> Visitor<'v> for HirPlaceholderCollector {
|
|||
}
|
||||
}
|
||||
fn visit_array_length(&mut self, length: &'v hir::ArrayLen) {
|
||||
if let &hir::ArrayLen::Infer(_, span) = length {
|
||||
self.0.push(span);
|
||||
if let hir::ArrayLen::Infer(inf) = length {
|
||||
self.0.push(inf.span);
|
||||
}
|
||||
intravisit::walk_array_len(self, length)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue