Skip to content

Commit dae5c9c

Browse files
committed
AbsolutePathBuffer -> AbsolutePathPrinter
1 parent 2d8618e commit dae5c9c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clippy_lints/src/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use crate::utils::paths;
2525
use crate::utils::{
2626
clip, comparisons, differing_macro_contexts, higher, in_constant, in_macro, int_bits, last_path_segment,
2727
match_def_path, match_path, multispan_sugg, same_tys, sext, snippet, snippet_opt, snippet_with_applicability,
28-
span_help_and_lint, span_lint, span_lint_and_sugg, span_lint_and_then, unsext, AbsolutePathBuffer,
28+
span_help_and_lint, span_lint, span_lint_and_sugg, span_lint_and_then, unsext, AbsolutePathPrinter,
2929
};
3030

3131
/// Handles all the linting of funky types
@@ -1138,7 +1138,7 @@ impl LintPass for CastPass {
11381138
// one of the platform specific `libc::<platform>::c_void` of libc.
11391139
fn is_c_void<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, ty: Ty<'_>) -> bool {
11401140
if let ty::Adt(adt, _) = ty.sty {
1141-
let names = AbsolutePathBuffer { tcx }.print_def_path(adt.did, &[]).unwrap();
1141+
let names = AbsolutePathPrinter { tcx }.print_def_path(adt.did, &[]).unwrap();
11421142

11431143
if names.is_empty() {
11441144
return false;

clippy_lints/src/utils/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ pub fn in_macro(span: Span) -> bool {
9898
/// Used to store the absolute path to a type.
9999
///
100100
/// See `match_def_path` for usage.
101-
pub struct AbsolutePathBuffer<'a, 'tcx> {
101+
pub struct AbsolutePathPrinter<'a, 'tcx> {
102102
pub tcx: TyCtxt<'a, 'tcx, 'tcx>,
103103
}
104104

105105
use rustc::ty::print::Printer;
106106

107-
impl<'tcx> Printer<'tcx, 'tcx> for AbsolutePathBuffer<'_, 'tcx> {
107+
impl<'tcx> Printer<'tcx, 'tcx> for AbsolutePathPrinter<'_, 'tcx> {
108108
type Error = !;
109109

110110
type Path = Vec<String>;
@@ -201,7 +201,7 @@ impl<'tcx> Printer<'tcx, 'tcx> for AbsolutePathBuffer<'_, 'tcx> {
201201
///
202202
/// See also the `paths` module.
203203
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();
205205

206206
names.len() == path.len() && names.into_iter().zip(path.iter()).all(|(a, &b)| *a == *b)
207207
}
@@ -216,7 +216,7 @@ pub fn match_def_path<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId, path
216216
/// };
217217
/// ```
218218
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()
220220
}
221221

222222
/// Checks if type is struct, enum or union type with the given def path.

0 commit comments

Comments
 (0)