1
Fork 0

Make ty::print::Printer take &mut self instead of self

This simplifies the code by removing all the `self` assignments and
makes the flow of data clearer - always into the printer.
Especially in v0 mangling, which already used  `&mut self` in some
places, it gets a lot more uniform.
This commit is contained in:
Nilstrieb 2023-10-17 19:46:14 +02:00
parent 45a45c6e60
commit 5acf26b97e
17 changed files with 615 additions and 592 deletions

View file

@ -470,7 +470,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
}
}
ty.print(printer).unwrap().into_buffer()
ty.print(&mut printer).unwrap();
printer.into_buffer()
}
/// Returns the name of the provided `Ty` (that must be a reference)'s region with a
@ -492,7 +493,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
bug!("ty for annotation of borrow region is not a reference");
};
region.print(printer).unwrap().into_buffer()
region.print(&mut printer).unwrap();
printer.into_buffer()
}
}