diff options
| author | bors <bors@rust-lang.org> | 2021-07-02 20:00:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-07-02 20:00:51 +0000 |
| commit | 798baebde1fe77e5a660490ec64e727a5d79970d (patch) | |
| tree | 271df8bcac32ffd8ffd2d52d4a56f0094cecdcbf /library/proc_macro/src | |
| parent | 2545459bff0aae43288e2e17bff0d332c49a6353 (diff) | |
| parent | 1b136323dcd219241bf8b8949f50992a83b28954 (diff) | |
| download | rust-798baebde1fe77e5a660490ec64e727a5d79970d.tar.gz rust-798baebde1fe77e5a660490ec64e727a5d79970d.zip | |
Auto merge of #86817 - JohnTitor:rollup-rcysc95, r=JohnTitor
Rollup of 7 pull requests Successful merges: - #84029 (add `track_path::path` fn for usage in `proc_macro`s) - #85001 (Merge `sys_common::bytestring` back into `os_str_bytes`) - #86308 (Docs: clarify that certain intrinsics are not unsafe) - #86796 (Add a regression test for issue-70703) - #86803 (Remove & from Command::args calls in documentation) - #86807 (Fix double import in wasm thread ) - #86813 (Add a help message to `unused_doc_comments` lint) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/proc_macro/src')
| -rw-r--r-- | library/proc_macro/src/bridge/mod.rs | 1 | ||||
| -rw-r--r-- | library/proc_macro/src/lib.rs | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/library/proc_macro/src/bridge/mod.rs b/library/proc_macro/src/bridge/mod.rs index a2953b68564..b968d44fe48 100644 --- a/library/proc_macro/src/bridge/mod.rs +++ b/library/proc_macro/src/bridge/mod.rs @@ -55,6 +55,7 @@ macro_rules! with_api { FreeFunctions { fn drop($self: $S::FreeFunctions); fn track_env_var(var: &str, value: Option<&str>); + fn track_path(path: &str); }, TokenStream { fn drop($self: $S::TokenStream); diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs index 9b155db6d7b..53fd58a29d8 100644 --- a/library/proc_macro/src/lib.rs +++ b/library/proc_macro/src/lib.rs @@ -1234,3 +1234,17 @@ pub mod tracked_env { value } } + +/// Tracked access to additional files. +#[unstable(feature = "track_path", issue = "73921")] +pub mod tracked_path { + + /// Track a file explicitly. + /// + /// Commonly used for tracking asset preprocessing. + #[unstable(feature = "track_path", issue = "73921")] + pub fn path<P: AsRef<str>>(path: P) { + let path: &str = path.as_ref(); + crate::bridge::client::FreeFunctions::track_path(path); + } +} |
