mir: &Mir<'tcx>,
region_bound_pairs: &[(ty::Region<'tcx>, GenericKind<'tcx>)],
implicit_region_bound: Option<ty::Region<'tcx>>,
- extra: &mut FnMut(&mut TypeChecker<'_, 'gcx, 'tcx>),
+ extra: &mut dyn FnMut(&mut TypeChecker<'_, 'gcx, 'tcx>),
) -> MirTypeckRegionConstraints<'tcx> {
let mut checker = TypeChecker::new(
infcx,
self.cx.infcx.tcx
}
- fn sanitize_type(&mut self, parent: &fmt::Debug, ty: Ty<'tcx>) -> Ty<'tcx> {
+ fn sanitize_type(&mut self, parent: &dyn fmt::Debug, ty: Ty<'tcx>) -> Ty<'tcx> {
if ty.has_escaping_regions() || ty.references_error() {
span_mirbug_and_err!(self, parent, "bad type {:?}", ty)
} else {
fn field_ty(
&mut self,
- parent: &fmt::Debug,
+ parent: &dyn fmt::Debug,
base_ty: PlaceTy<'tcx>,
field: Field,
location: Location,
fn assert_iscleanup(
&mut self,
mir: &Mir<'tcx>,
- ctxt: &fmt::Debug,
+ ctxt: &dyn fmt::Debug,
bb: BasicBlock,
iscleanuppad: bool,
) {
/// or `typeck` and `bar` both appear in the name.
pub fn dump_mir<'a, 'gcx, 'tcx, F>(
tcx: TyCtxt<'a, 'gcx, 'tcx>,
- pass_num: Option<&Display>,
+ pass_num: Option<&dyn Display>,
pass_name: &str,
- disambiguator: &Display,
+ disambiguator: &dyn Display,
source: MirSource,
mir: &Mir<'tcx>,
extra_data: F,
) where
- F: FnMut(PassWhere, &mut Write) -> io::Result<()>,
+ F: FnMut(PassWhere, &mut dyn Write) -> io::Result<()>,
{
if !dump_enabled(tcx, pass_name, source) {
return;
fn dump_matched_mir_node<'a, 'gcx, 'tcx, F>(
tcx: TyCtxt<'a, 'gcx, 'tcx>,
- pass_num: Option<&Display>,
+ pass_num: Option<&dyn Display>,
pass_name: &str,
node_path: &str,
- disambiguator: &Display,
+ disambiguator: &dyn Display,
source: MirSource,
mir: &Mir<'tcx>,
mut extra_data: F,
) where
- F: FnMut(PassWhere, &mut Write) -> io::Result<()>,
+ F: FnMut(PassWhere, &mut dyn Write) -> io::Result<()>,
{
let _: io::Result<()> = do catch {
let mut file = create_dump_file(tcx, "mir", pass_num, pass_name, disambiguator, source)?;
fn dump_path(
tcx: TyCtxt<'_, '_, '_>,
extension: &str,
- pass_num: Option<&Display>,
+ pass_num: Option<&dyn Display>,
pass_name: &str,
- disambiguator: &Display,
+ disambiguator: &dyn Display,
source: MirSource,
) -> PathBuf {
let promotion_id = match source.promoted {
pub(crate) fn create_dump_file(
tcx: TyCtxt<'_, '_, '_>,
extension: &str,
- pass_num: Option<&Display>,
+ pass_num: Option<&dyn Display>,
pass_name: &str,
- disambiguator: &Display,
+ disambiguator: &dyn Display,
source: MirSource,
) -> io::Result<fs::File> {
let file_path = dump_path(tcx, extension, pass_num, pass_name, disambiguator, source);
pub fn write_mir_pretty<'a, 'gcx, 'tcx>(
tcx: TyCtxt<'a, 'gcx, 'tcx>,
single: Option<DefId>,
- w: &mut Write,
+ w: &mut dyn Write,
) -> io::Result<()> {
writeln!(
w,
src: MirSource,
mir: &Mir<'tcx>,
extra_data: &mut F,
- w: &mut Write,
+ w: &mut dyn Write,
) -> io::Result<()>
where
- F: FnMut(PassWhere, &mut Write) -> io::Result<()>,
+ F: FnMut(PassWhere, &mut dyn Write) -> io::Result<()>,
{
write_mir_intro(tcx, src, mir, w)?;
for block in mir.basic_blocks().indices() {
block: BasicBlock,
mir: &Mir<'tcx>,
extra_data: &mut F,
- w: &mut Write,
+ w: &mut dyn Write,
) -> io::Result<()>
where
- F: FnMut(PassWhere, &mut Write) -> io::Result<()>,
+ F: FnMut(PassWhere, &mut dyn Write) -> io::Result<()>,
{
let data = &mir[block];
/// a statement.
fn write_extra<'cx, 'gcx, 'tcx, F>(
tcx: TyCtxt<'cx, 'gcx, 'tcx>,
- write: &mut Write,
+ write: &mut dyn Write,
mut visit_op: F,
) -> io::Result<()>
where
tcx: TyCtxt,
mir: &Mir,
scope_tree: &FxHashMap<VisibilityScope, Vec<VisibilityScope>>,
- w: &mut Write,
+ w: &mut dyn Write,
parent: VisibilityScope,
depth: usize,
) -> io::Result<()> {
tcx: TyCtxt<'a, 'gcx, 'tcx>,
src: MirSource,
mir: &Mir,
- w: &mut Write,
+ w: &mut dyn Write,
) -> io::Result<()> {
write_mir_sig(tcx, src, mir, w)?;
writeln!(w, "{{")?;
Ok(())
}
-fn write_mir_sig(tcx: TyCtxt, src: MirSource, mir: &Mir, w: &mut Write) -> io::Result<()> {
+fn write_mir_sig(tcx: TyCtxt, src: MirSource, mir: &Mir, w: &mut dyn Write) -> io::Result<()> {
let id = tcx.hir.as_local_node_id(src.def_id).unwrap();
let body_owner_kind = tcx.hir.body_owner_kind(id);
match (body_owner_kind, src.promoted) {
Ok(())
}
-fn write_temp_decls(mir: &Mir, w: &mut Write) -> io::Result<()> {
+fn write_temp_decls(mir: &Mir, w: &mut dyn Write) -> io::Result<()> {
// Compiler-introduced temporary types.
for temp in mir.temps_iter() {
writeln!(