about summary refs log tree commit diff
path: root/compiler/rustc_fluent_macro
diff options
context:
space:
mode:
authorusamoi <usamoi@outlook.com>2024-10-19 22:30:41 +0800
committerusamoi <usamoi@outlook.com>2024-10-19 22:32:38 +0800
commitfa478239b19ccf1a455985fec7577d7091a7620c (patch)
tree8c489c7afd320f604d86c05fc3159ad8c9a36125 /compiler/rustc_fluent_macro
parentc926476d013fbb2ca43bd5259d0a7228009a9cb2 (diff)
downloadrust-fa478239b19ccf1a455985fec7577d7091a7620c.tar.gz
rust-fa478239b19ccf1a455985fec7577d7091a7620c.zip
use tracked_path in rustc_fluent_macro
Diffstat (limited to 'compiler/rustc_fluent_macro')
-rw-r--r--compiler/rustc_fluent_macro/src/fluent.rs4
-rw-r--r--compiler/rustc_fluent_macro/src/lib.rs1
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_fluent_macro/src/fluent.rs b/compiler/rustc_fluent_macro/src/fluent.rs
index ead72e2a0e1..d4604c27e6d 100644
--- a/compiler/rustc_fluent_macro/src/fluent.rs
+++ b/compiler/rustc_fluent_macro/src/fluent.rs
@@ -8,6 +8,7 @@ use fluent_syntax::ast::{
     Attribute, Entry, Expression, Identifier, InlineExpression, Message, Pattern, PatternElement,
 };
 use fluent_syntax::parser::ParserError;
+use proc_macro::tracked_path::path;
 use proc_macro::{Diagnostic, Level, Span};
 use proc_macro2::TokenStream;
 use quote::quote;
@@ -99,8 +100,7 @@ pub(crate) fn fluent_messages(input: proc_macro::TokenStream) -> proc_macro::Tok
 
     let crate_name = Ident::new(&crate_name, resource_str.span());
 
-    // As this macro also outputs an `include_str!` for this file, the macro will always be
-    // re-executed when the file changes.
+    path(absolute_ftl_path.to_str().unwrap());
     let resource_contents = match read_to_string(absolute_ftl_path) {
         Ok(resource_contents) => resource_contents,
         Err(e) => {
diff --git a/compiler/rustc_fluent_macro/src/lib.rs b/compiler/rustc_fluent_macro/src/lib.rs
index 6e5add24bcc..3ad51fa1e64 100644
--- a/compiler/rustc_fluent_macro/src/lib.rs
+++ b/compiler/rustc_fluent_macro/src/lib.rs
@@ -6,6 +6,7 @@
 #![feature(proc_macro_diagnostic)]
 #![feature(proc_macro_span)]
 #![feature(rustdoc_internals)]
+#![feature(track_path)]
 #![warn(unreachable_pub)]
 // tidy-alphabetical-end