Skip to content

Commit 8d8d702

Browse files
committed
change proc_macro::tracked::path to take an AsRef<Path> instead of an AsRef<str>
1 parent 72076c6 commit 8d8d702

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

library/proc_macro/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,6 +1604,7 @@ pub mod tracked {
16041604

16051605
use std::env::{self, VarError};
16061606
use std::ffi::OsStr;
1607+
use std::path::Path;
16071608

16081609
/// Retrieve an environment variable and add it to build dependency info.
16091610
/// The build system executing the compiler will know that the variable was accessed during
@@ -1623,8 +1624,8 @@ pub mod tracked {
16231624
///
16241625
/// Commonly used for tracking asset preprocessing.
16251626
#[unstable(feature = "proc_macro_tracked_path", issue = "99515")]
1626-
pub fn path<P: AsRef<str>>(path: P) {
1627-
let path: &str = path.as_ref();
1627+
pub fn path<P: AsRef<Path>>(path: P) {
1628+
let path: &str = path.as_ref().to_str().unwrap();
16281629
crate::bridge::client::FreeFunctions::track_path(path);
16291630
}
16301631
}

0 commit comments

Comments
 (0)