Skip to content

Commit 93af682

Browse files
committed
Restore warning about local_path() and into_local_path() methods
1 parent 2ee4f9e commit 93af682

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_span/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ impl RealFileName {
374374
/// if this information exists.
375375
///
376376
/// May not exists if the filename was imported from another crate.
377+
///
378+
/// Avoid embedding this in build artifacts; prefer `path()` or `embeddable_name()`.
377379
#[inline]
378380
pub fn local_path(&self) -> Option<&Path> {
379381
self.local.as_ref().map(|lp| lp.name.as_ref())
@@ -383,6 +385,8 @@ impl RealFileName {
383385
/// if this information exists.
384386
///
385387
/// May not exists if the filename was imported from another crate.
388+
///
389+
/// Avoid embedding this in build artifacts; prefer `path()` or `embeddable_name()`.
386390
#[inline]
387391
pub fn into_local_path(self) -> Option<PathBuf> {
388392
self.local.map(|lp| lp.name)

0 commit comments

Comments
 (0)