use tracked_path in rustc_fluent_macro
This commit is contained in:
parent
c926476d01
commit
fa478239b1
@ -8,6 +8,7 @@
|
|||||||
Attribute, Entry, Expression, Identifier, InlineExpression, Message, Pattern, PatternElement,
|
Attribute, Entry, Expression, Identifier, InlineExpression, Message, Pattern, PatternElement,
|
||||||
};
|
};
|
||||||
use fluent_syntax::parser::ParserError;
|
use fluent_syntax::parser::ParserError;
|
||||||
|
use proc_macro::tracked_path::path;
|
||||||
use proc_macro::{Diagnostic, Level, Span};
|
use proc_macro::{Diagnostic, Level, Span};
|
||||||
use proc_macro2::TokenStream;
|
use proc_macro2::TokenStream;
|
||||||
use quote::quote;
|
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());
|
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
|
path(absolute_ftl_path.to_str().unwrap());
|
||||||
// re-executed when the file changes.
|
|
||||||
let resource_contents = match read_to_string(absolute_ftl_path) {
|
let resource_contents = match read_to_string(absolute_ftl_path) {
|
||||||
Ok(resource_contents) => resource_contents,
|
Ok(resource_contents) => resource_contents,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#![feature(proc_macro_diagnostic)]
|
#![feature(proc_macro_diagnostic)]
|
||||||
#![feature(proc_macro_span)]
|
#![feature(proc_macro_span)]
|
||||||
#![feature(rustdoc_internals)]
|
#![feature(rustdoc_internals)]
|
||||||
|
#![feature(track_path)]
|
||||||
#![warn(unreachable_pub)]
|
#![warn(unreachable_pub)]
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user