TypeVisitor: use ControlFlow in rustc_{mir,privacy,traits,typeck}
This commit is contained in:
@@ -19,6 +19,7 @@ use rustc_middle::mir::visit::Visitor;
|
||||
use rustc_middle::mir::*;
|
||||
use rustc_middle::ty::{self, TyCtxt, TypeFoldable, TypeVisitor};
|
||||
use rustc_target::abi::Size;
|
||||
use std::ops::ControlFlow;
|
||||
|
||||
const INDENT: &str = " ";
|
||||
/// Alignment for lining up comments following MIR statements
|
||||
@@ -639,7 +640,7 @@ pub fn write_allocations<'tcx>(
|
||||
}
|
||||
struct CollectAllocIds(BTreeSet<AllocId>);
|
||||
impl<'tcx> TypeVisitor<'tcx> for CollectAllocIds {
|
||||
fn visit_const(&mut self, c: &'tcx ty::Const<'tcx>) -> bool {
|
||||
fn visit_const(&mut self, c: &'tcx ty::Const<'tcx>) -> ControlFlow<(), ()> {
|
||||
if let ty::ConstKind::Value(val) = c.val {
|
||||
self.0.extend(alloc_ids_from_const(val));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user