@@ -31,70 +31,70 @@ pub trait Printer<'tcx>: Sized {
31
31
fn tcx < ' a > ( & ' a self ) -> TyCtxt < ' tcx > ;
32
32
33
33
fn print_def_path (
34
- self ,
34
+ & mut self ,
35
35
def_id : DefId ,
36
36
args : & ' tcx [ GenericArg < ' tcx > ] ,
37
- ) -> Result < Self , PrintError > {
37
+ ) -> Result < ( ) , PrintError > {
38
38
self . default_print_def_path ( def_id, args)
39
39
}
40
40
41
41
fn print_impl_path (
42
- self ,
42
+ & mut self ,
43
43
impl_def_id : DefId ,
44
44
args : & ' tcx [ GenericArg < ' tcx > ] ,
45
45
self_ty : Ty < ' tcx > ,
46
46
trait_ref : Option < ty:: TraitRef < ' tcx > > ,
47
- ) -> Result < Self , PrintError > {
48
- self . default_print_impl_path ( impl_def_id, args, self_ty, trait_ref)
47
+ ) -> Result < ( ) , PrintError > {
48
+ & mut self . default_print_impl_path ( impl_def_id, args, self_ty, trait_ref)
49
49
}
50
50
51
- fn print_region ( self , region : ty:: Region < ' tcx > ) -> Result < Self , PrintError > ;
51
+ fn print_region ( & mut self , region : ty:: Region < ' tcx > ) -> Result < ( ) , PrintError > ;
52
52
53
- fn print_type ( self , ty : Ty < ' tcx > ) -> Result < Self , PrintError > ;
53
+ fn print_type ( & mut self , ty : Ty < ' tcx > ) -> Result < ( ) , PrintError > ;
54
54
55
55
fn print_dyn_existential (
56
- self ,
56
+ & mut self ,
57
57
predicates : & ' tcx ty:: List < ty:: PolyExistentialPredicate < ' tcx > > ,
58
- ) -> Result < Self , PrintError > ;
58
+ ) -> Result < ( ) , PrintError > ;
59
59
60
- fn print_const ( self , ct : ty:: Const < ' tcx > ) -> Result < Self , PrintError > ;
60
+ fn print_const ( & mut self , ct : ty:: Const < ' tcx > ) -> Result < ( ) , PrintError > ;
61
61
62
- fn path_crate ( self , cnum : CrateNum ) -> Result < Self , PrintError > ;
62
+ fn path_crate ( & mut self , cnum : CrateNum ) -> Result < ( ) , PrintError > ;
63
63
64
64
fn path_qualified (
65
- self ,
65
+ & mut self ,
66
66
self_ty : Ty < ' tcx > ,
67
67
trait_ref : Option < ty:: TraitRef < ' tcx > > ,
68
- ) -> Result < Self , PrintError > ;
68
+ ) -> Result < ( ) , PrintError > ;
69
69
70
70
fn path_append_impl (
71
- self ,
72
- print_prefix : impl FnOnce ( Self ) -> Result < Self , PrintError > ,
71
+ & mut self ,
72
+ print_prefix : impl FnOnce ( Self ) -> Result < ( ) , PrintError > ,
73
73
disambiguated_data : & DisambiguatedDefPathData ,
74
74
self_ty : Ty < ' tcx > ,
75
75
trait_ref : Option < ty:: TraitRef < ' tcx > > ,
76
- ) -> Result < Self , PrintError > ;
76
+ ) -> Result < ( ) , PrintError > ;
77
77
78
78
fn path_append (
79
- self ,
80
- print_prefix : impl FnOnce ( Self ) -> Result < Self , PrintError > ,
79
+ & mut self ,
80
+ print_prefix : impl FnOnce ( Self ) -> Result < ( ) , PrintError > ,
81
81
disambiguated_data : & DisambiguatedDefPathData ,
82
- ) -> Result < Self , PrintError > ;
82
+ ) -> Result < ( ) , PrintError > ;
83
83
84
84
fn path_generic_args (
85
- self ,
86
- print_prefix : impl FnOnce ( Self ) -> Result < Self , PrintError > ,
85
+ & mut self ,
86
+ print_prefix : impl FnOnce ( Self ) -> Result < ( ) , PrintError > ,
87
87
args : & [ GenericArg < ' tcx > ] ,
88
- ) -> Result < Self , PrintError > ;
88
+ ) -> Result < ( ) , PrintError > ;
89
89
90
90
// Defaults (should not be overridden):
91
91
92
92
#[ instrument( skip( self ) , level = "debug" ) ]
93
93
fn default_print_def_path (
94
- self ,
94
+ & mut self ,
95
95
def_id : DefId ,
96
96
args : & ' tcx [ GenericArg < ' tcx > ] ,
97
- ) -> Result < Self , PrintError > {
97
+ ) -> Result < ( ) , PrintError > {
98
98
let key = self . tcx ( ) . def_key ( def_id) ;
99
99
debug ! ( ?key) ;
100
100
@@ -180,12 +180,12 @@ pub trait Printer<'tcx>: Sized {
180
180
}
181
181
182
182
fn default_print_impl_path (
183
- self ,
183
+ & mut self ,
184
184
impl_def_id : DefId ,
185
185
_args : & ' tcx [ GenericArg < ' tcx > ] ,
186
186
self_ty : Ty < ' tcx > ,
187
187
impl_trait_ref : Option < ty:: TraitRef < ' tcx > > ,
188
- ) -> Result < Self , PrintError > {
188
+ ) -> Result < ( ) , PrintError > {
189
189
debug ! (
190
190
"default_print_impl_path: impl_def_id={:?}, self_ty={}, impl_trait_ref={:?}" ,
191
191
impl_def_id, self_ty, impl_trait_ref
0 commit comments