@@ -98,13 +98,13 @@ pub fn in_macro(span: Span) -> bool {
98
98
/// Used to store the absolute path to a type.
99
99
///
100
100
/// See `match_def_path` for usage.
101
- pub struct AbsolutePathBuffer < ' a , ' tcx > {
101
+ pub struct AbsolutePathPrinter < ' a , ' tcx > {
102
102
pub tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
103
103
}
104
104
105
105
use rustc:: ty:: print:: Printer ;
106
106
107
- impl < ' tcx > Printer < ' tcx , ' tcx > for AbsolutePathBuffer < ' _ , ' tcx > {
107
+ impl < ' tcx > Printer < ' tcx , ' tcx > for AbsolutePathPrinter < ' _ , ' tcx > {
108
108
type Error = !;
109
109
110
110
type Path = Vec < String > ;
@@ -201,7 +201,7 @@ impl<'tcx> Printer<'tcx, 'tcx> for AbsolutePathBuffer<'_, 'tcx> {
201
201
///
202
202
/// See also the `paths` module.
203
203
pub fn match_def_path < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , def_id : DefId , path : & [ & str ] ) -> bool {
204
- let names = AbsolutePathBuffer { tcx } . print_def_path ( def_id, & [ ] ) . unwrap ( ) ;
204
+ let names = AbsolutePathPrinter { tcx } . print_def_path ( def_id, & [ ] ) . unwrap ( ) ;
205
205
206
206
names. len ( ) == path. len ( ) && names. into_iter ( ) . zip ( path. iter ( ) ) . all ( |( a, & b) | * a == * b)
207
207
}
@@ -216,7 +216,7 @@ pub fn match_def_path<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId, path
216
216
/// };
217
217
/// ```
218
218
pub fn get_def_path < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , def_id : DefId ) -> Vec < String > {
219
- AbsolutePathBuffer { tcx } . print_def_path ( def_id, & [ ] ) . unwrap ( )
219
+ AbsolutePathPrinter { tcx } . print_def_path ( def_id, & [ ] ) . unwrap ( )
220
220
}
221
221
222
222
/// Checks if type is struct, enum or union type with the given def path.
0 commit comments