Rollup merge of #120428 - petrochenkov:somehir2, r=compiler-errors
hir: Two preparatory changes for #120206 cc https://github.com/rust-lang/rust/pull/120206 r? ```@compiler-errors```
This commit is contained in:
commit
eaa100204e
12 changed files with 33 additions and 39 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