Skip to content

Commit 3537451

Browse files
committed
Add a warning to LateContext::get_def_path
1 parent 8da6239 commit 3537451

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_lint/src/context.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,12 @@ impl<'tcx> LateContext<'tcx> {
709709
}
710710

711711
/// Gets the absolute path of `def_id` as a vector of `Symbol`.
712+
/// Note that this is kinda expensive because it has to
713+
/// travel the tree and pretty-print. Use sparingly (or find a
714+
/// way to only get the segments you're interested in, e.g. via
715+
/// [`TyCtxt::crate_name`]).
716+
///
717+
/// FIXME: It would be great if this could be optimized.
712718
///
713719
/// # Examples
714720
///

0 commit comments

Comments
 (0)