Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Noratrieb committed Oct 17, 2023
1 parent 6fc6a6d commit 76f829d
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions compiler/rustc_middle/src/ty/print/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,70 +31,70 @@ pub trait Printer<'tcx>: Sized {
fn tcx<'a>(&'a self) -> TyCtxt<'tcx>;

fn print_def_path(
self,
&mut self,
def_id: DefId,
args: &'tcx [GenericArg<'tcx>],
) -> Result<Self, PrintError> {
) -> Result<(), PrintError> {
self.default_print_def_path(def_id, args)
}

fn print_impl_path(
self,
&mut self,
impl_def_id: DefId,
args: &'tcx [GenericArg<'tcx>],
self_ty: Ty<'tcx>,
trait_ref: Option<ty::TraitRef<'tcx>>,
) -> Result<Self, PrintError> {
self.default_print_impl_path(impl_def_id, args, self_ty, trait_ref)
) -> Result<(), PrintError> {
&mut self.default_print_impl_path(impl_def_id, args, self_ty, trait_ref)
}

fn print_region(self, region: ty::Region<'tcx>) -> Result<Self, PrintError>;
fn print_region(&mut self, region: ty::Region<'tcx>) -> Result<(), PrintError>;

fn print_type(self, ty: Ty<'tcx>) -> Result<Self, PrintError>;
fn print_type(&mut self, ty: Ty<'tcx>) -> Result<(), PrintError>;

fn print_dyn_existential(
self,
&mut self,
predicates: &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>>,
) -> Result<Self, PrintError>;
) -> Result<(), PrintError>;

fn print_const(self, ct: ty::Const<'tcx>) -> Result<Self, PrintError>;
fn print_const(&mut self, ct: ty::Const<'tcx>) -> Result<(), PrintError>;

fn path_crate(self, cnum: CrateNum) -> Result<Self, PrintError>;
fn path_crate(&mut self, cnum: CrateNum) -> Result<(), PrintError>;

fn path_qualified(
self,
&mut self,
self_ty: Ty<'tcx>,
trait_ref: Option<ty::TraitRef<'tcx>>,
) -> Result<Self, PrintError>;
) -> Result<(), PrintError>;

fn path_append_impl(
self,
print_prefix: impl FnOnce(Self) -> Result<Self, PrintError>,
&mut self,
print_prefix: impl FnOnce(Self) -> Result<(), PrintError>,
disambiguated_data: &DisambiguatedDefPathData,
self_ty: Ty<'tcx>,
trait_ref: Option<ty::TraitRef<'tcx>>,
) -> Result<Self, PrintError>;
) -> Result<(), PrintError>;

fn path_append(
self,
print_prefix: impl FnOnce(Self) -> Result<Self, PrintError>,
&mut self,
print_prefix: impl FnOnce(Self) -> Result<(), PrintError>,
disambiguated_data: &DisambiguatedDefPathData,
) -> Result<Self, PrintError>;
) -> Result<(), PrintError>;

fn path_generic_args(
self,
print_prefix: impl FnOnce(Self) -> Result<Self, PrintError>,
&mut self,
print_prefix: impl FnOnce(Self) -> Result<(), PrintError>,
args: &[GenericArg<'tcx>],
) -> Result<Self, PrintError>;
) -> Result<(), PrintError>;

// Defaults (should not be overridden):

#[instrument(skip(self), level = "debug")]
fn default_print_def_path(
self,
&mut self,
def_id: DefId,
args: &'tcx [GenericArg<'tcx>],
) -> Result<Self, PrintError> {
) -> Result<(), PrintError> {
let key = self.tcx().def_key(def_id);
debug!(?key);

Expand Down Expand Up @@ -180,12 +180,12 @@ pub trait Printer<'tcx>: Sized {
}

fn default_print_impl_path(
self,
&mut self,
impl_def_id: DefId,
_args: &'tcx [GenericArg<'tcx>],
self_ty: Ty<'tcx>,
impl_trait_ref: Option<ty::TraitRef<'tcx>>,
) -> Result<Self, PrintError> {
) -> Result<(), PrintError> {
debug!(
"default_print_impl_path: impl_def_id={:?}, self_ty={}, impl_trait_ref={:?}",
impl_def_id, self_ty, impl_trait_ref
Expand Down

0 comments on commit 76f829d

Please sign in to comment.