Skip to content

Commit 799629f

Browse files
authored
Unrolled build for rust-lang#131932
Rollup merge of rust-lang#131932 - usamoi:tracked-path, r=Nadrieril use tracked_path in rustc_fluent_macro According to comments in rust-lang#99515 (comment), the trick used in `rustc_fluent_macro` may be broken by caching decl macros. So use `proc_macro::tracked_path::path` to ensure it works.
2 parents da93539 + fa47823 commit 799629f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

compiler/rustc_fluent_macro/src/fluent.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use fluent_syntax::ast::{
88
Attribute, Entry, Expression, Identifier, InlineExpression, Message, Pattern, PatternElement,
99
};
1010
use fluent_syntax::parser::ParserError;
11+
use proc_macro::tracked_path::path;
1112
use proc_macro::{Diagnostic, Level, Span};
1213
use proc_macro2::TokenStream;
1314
use quote::quote;
@@ -99,8 +100,7 @@ pub(crate) fn fluent_messages(input: proc_macro::TokenStream) -> proc_macro::Tok
99100

100101
let crate_name = Ident::new(&crate_name, resource_str.span());
101102

102-
// As this macro also outputs an `include_str!` for this file, the macro will always be
103-
// re-executed when the file changes.
103+
path(absolute_ftl_path.to_str().unwrap());
104104
let resource_contents = match read_to_string(absolute_ftl_path) {
105105
Ok(resource_contents) => resource_contents,
106106
Err(e) => {

compiler/rustc_fluent_macro/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#![feature(proc_macro_diagnostic)]
77
#![feature(proc_macro_span)]
88
#![feature(rustdoc_internals)]
9+
#![feature(track_path)]
910
#![warn(unreachable_pub)]
1011
// tidy-alphabetical-end
1112

0 commit comments

Comments
 (0)