change proc_macro::tracked::path to take an AsRef<Path> instead of an AsRef<str>

This commit is contained in:
Skgland 2025-11-26 21:43:44 +01:00 committed by Bennet Bleßmann
parent 72076c6b54
commit 8d8d7021c6
No known key found for this signature in database
GPG key ID: 3BE1A1A3CBC3CF99

View file

@ -1604,6 +1604,7 @@ pub mod tracked {
use std::env::{self, VarError};
use std::ffi::OsStr;
use std::path::Path;
/// Retrieve an environment variable and add it to build dependency info.
/// The build system executing the compiler will know that the variable was accessed during
@ -1623,8 +1624,8 @@ pub mod tracked {
///
/// Commonly used for tracking asset preprocessing.
#[unstable(feature = "proc_macro_tracked_path", issue = "99515")]
pub fn path<P: AsRef<str>>(path: P) {
let path: &str = path.as_ref();
pub fn path<P: AsRef<Path>>(path: P) {
let path: &str = path.as_ref().to_str().unwrap();
crate::bridge::client::FreeFunctions::track_path(path);
}
}