Auto merge of #108682 - est31:simplify_dirs, r=davidtwco
Simplify message paths This makes it easier to open the messages file. Right now I have to first click on the `locales` dir to open it, and then on the `en-US.ftl` file. `Cargo.toml` and `build.rs` files are also in the top level, and I think there should not be more than one file, so a directory isn't really needed. The [chosen strategy for pontoon adoption](https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/pontoon.20and.20next.20steps) is out of tree. Even if this descision is changed in the future, the `messages.ftl` approach is also compatible with non-english translations living in-tree, as long as the non-english translations don't live in the `compiler/rustc_foo/` directories but in different ones. That would also be helpful for grepability purposes. The commit was the result of automated changes: ``` for p in compiler/rustc_*; do mv $p/locales/en-US.ftl $p/messages.ftl; rmdir $p/locales; done for p in compiler/rustc_*; do sed -i "s#\.\./locales/en-US.ftl#../messages.ftl#" $p/src/lib.rs; done ``` r? `@davidtwco`
This commit is contained in:
commit
501ad021b9
68 changed files with 34 additions and 34 deletions
|
@ -92,7 +92,7 @@ mod lifetime_collector;
|
||||||
mod pat;
|
mod pat;
|
||||||
mod path;
|
mod path;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
struct LoweringContext<'a, 'hir> {
|
struct LoweringContext<'a, 'hir> {
|
||||||
tcx: TyCtxt<'hir>,
|
tcx: TyCtxt<'hir>,
|
||||||
|
|
|
@ -21,4 +21,4 @@ pub mod feature_gate;
|
||||||
pub mod node_count;
|
pub mod node_count;
|
||||||
pub mod show_span;
|
pub mod show_span;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
|
@ -26,4 +26,4 @@ pub use rustc_ast::attr::*;
|
||||||
|
|
||||||
pub(crate) use rustc_ast::HashStableContext;
|
pub(crate) use rustc_ast::HashStableContext;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
|
@ -100,7 +100,7 @@ use places_conflict::{places_conflict, PlaceConflictBias};
|
||||||
use region_infer::RegionInferenceContext;
|
use region_infer::RegionInferenceContext;
|
||||||
use renumber::RegionCtxt;
|
use renumber::RegionCtxt;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
// FIXME(eddyb) perhaps move this somewhere more centrally.
|
// FIXME(eddyb) perhaps move this somewhere more centrally.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
|
@ -56,7 +56,7 @@ pub mod proc_macro_harness;
|
||||||
pub mod standard_library_imports;
|
pub mod standard_library_imports;
|
||||||
pub mod test_harness;
|
pub mod test_harness;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
pub fn register_builtin_macros(resolver: &mut dyn ResolverExpand) {
|
pub fn register_builtin_macros(resolver: &mut dyn ResolverExpand) {
|
||||||
let mut register = |name, kind| resolver.register_builtin_macro(name, kind);
|
let mut register = |name, kind| resolver.register_builtin_macro(name, kind);
|
||||||
|
|
|
@ -87,7 +87,7 @@ use rustc_span::Symbol;
|
||||||
use rustc_span::fatal_error::FatalError;
|
use rustc_span::fatal_error::FatalError;
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
pub struct PrintOnPanic<F: Fn() -> String>(pub F);
|
pub struct PrintOnPanic<F: Fn() -> String>(pub F);
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ mod type_of;
|
||||||
mod va_arg;
|
mod va_arg;
|
||||||
mod value;
|
mod value;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct LlvmCodegenBackend(());
|
pub struct LlvmCodegenBackend(());
|
||||||
|
|
|
@ -56,7 +56,7 @@ pub mod mono_item;
|
||||||
pub mod target_features;
|
pub mod target_features;
|
||||||
pub mod traits;
|
pub mod traits;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
pub struct ModuleCodegen<M> {
|
pub struct ModuleCodegen<M> {
|
||||||
/// The name of the module. When the crate may be saved between
|
/// The name of the module. When the crate may be saved between
|
||||||
|
|
|
@ -39,7 +39,7 @@ use rustc_macros::fluent_messages;
|
||||||
use rustc_middle::ty;
|
use rustc_middle::ty;
|
||||||
use rustc_middle::ty::query::Providers;
|
use rustc_middle::ty::query::Providers;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
pub fn provide(providers: &mut Providers) {
|
pub fn provide(providers: &mut Providers) {
|
||||||
const_eval::provide(providers);
|
const_eval::provide(providers);
|
||||||
|
|
|
@ -64,7 +64,7 @@ use crate::session_diagnostics::{
|
||||||
RLinkWrongFileType, RlinkNotAFile, RlinkUnableToRead,
|
RLinkWrongFileType, RlinkNotAFile, RlinkUnableToRead,
|
||||||
};
|
};
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
pub static DEFAULT_LOCALE_RESOURCES: &[&str] = &[
|
pub static DEFAULT_LOCALE_RESOURCES: &[&str] = &[
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
|
|
|
@ -34,7 +34,7 @@ use intl_memoizer::IntlLangMemoizer;
|
||||||
pub use fluent_bundle::{self, types::FluentType, FluentArgs, FluentError, FluentValue};
|
pub use fluent_bundle::{self, types::FluentType, FluentArgs, FluentError, FluentValue};
|
||||||
pub use unic_langid::{langid, LanguageIdentifier};
|
pub use unic_langid::{langid, LanguageIdentifier};
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
pub type FluentBundle = fluent_bundle::bundle::FluentBundle<FluentResource, IntlLangMemoizer>;
|
pub type FluentBundle = fluent_bundle::bundle::FluentBundle<FluentResource, IntlLangMemoizer>;
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ pub use snippet::Style;
|
||||||
pub type PErr<'a> = DiagnosticBuilder<'a, ErrorGuaranteed>;
|
pub type PErr<'a> = DiagnosticBuilder<'a, ErrorGuaranteed>;
|
||||||
pub type PResult<'a, T> = Result<T, PErr<'a>>;
|
pub type PResult<'a, T> = Result<T, PErr<'a>>;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
// `PResult` is used a lot. Make sure it doesn't unintentionally get bigger.
|
// `PResult` is used a lot. Make sure it doesn't unintentionally get bigger.
|
||||||
// (See also the comment on `DiagnosticBuilderInner`'s `diagnostic` field.)
|
// (See also the comment on `DiagnosticBuilderInner`'s `diagnostic` field.)
|
||||||
|
|
|
@ -64,4 +64,4 @@ mod mut_visit {
|
||||||
mod tests;
|
mod tests;
|
||||||
}
|
}
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
|
@ -120,7 +120,7 @@ use std::ops::Not;
|
||||||
use astconv::AstConv;
|
use astconv::AstConv;
|
||||||
use bounds::Bounds;
|
use bounds::Bounds;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
fn require_c_abi_if_c_variadic(tcx: TyCtxt<'_>, decl: &hir::FnDecl<'_>, abi: Abi, span: Span) {
|
fn require_c_abi_if_c_variadic(tcx: TyCtxt<'_>, decl: &hir::FnDecl<'_>, abi: Abi, span: Span) {
|
||||||
const CONVENTIONS_UNSTABLE: &str = "`C`, `cdecl`, `win64`, `sysv64` or `efiapi`";
|
const CONVENTIONS_UNSTABLE: &str = "`C`, `cdecl`, `win64`, `sysv64` or `efiapi`";
|
||||||
|
|
|
@ -75,7 +75,7 @@ use rustc_session::Session;
|
||||||
use rustc_span::def_id::{DefId, LocalDefId};
|
use rustc_span::def_id::{DefId, LocalDefId};
|
||||||
use rustc_span::{sym, Span};
|
use rustc_span::{sym, Span};
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! type_error_struct {
|
macro_rules! type_error_struct {
|
||||||
|
|
|
@ -35,4 +35,4 @@ pub use persist::{build_dep_graph, load_dep_graph, DepGraphFuture};
|
||||||
use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
|
use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
|
||||||
use rustc_macros::fluent_messages;
|
use rustc_macros::fluent_messages;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
|
@ -41,4 +41,4 @@ mod errors;
|
||||||
pub mod infer;
|
pub mod infer;
|
||||||
pub mod traits;
|
pub mod traits;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
|
@ -31,4 +31,4 @@ pub use queries::Queries;
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
|
@ -126,7 +126,7 @@ pub use rustc_session::lint::Level::{self, *};
|
||||||
pub use rustc_session::lint::{BufferedEarlyLint, FutureIncompatibleInfo, Lint, LintId};
|
pub use rustc_session::lint::{BufferedEarlyLint, FutureIncompatibleInfo, Lint, LintId};
|
||||||
pub use rustc_session::lint::{LintArray, LintPass};
|
pub use rustc_session::lint::{LintArray, LintPass};
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
pub fn provide(providers: &mut Providers) {
|
pub fn provide(providers: &mut Providers) {
|
||||||
levels::provide(providers);
|
levels::provide(providers);
|
||||||
|
|
|
@ -47,4 +47,4 @@ pub use fs::{emit_wrapper_file, METADATA_FILENAME};
|
||||||
pub use native_libs::find_native_static_library;
|
pub use native_libs::find_native_static_library;
|
||||||
pub use rmeta::{encode_metadata, EncodedMetadata, METADATA_HEADER};
|
pub use rmeta::{encode_metadata, EncodedMetadata, METADATA_HEADER};
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
|
@ -109,4 +109,4 @@ pub mod util {
|
||||||
// Allows macros to refer to this crate as `::rustc_middle`
|
// Allows macros to refer to this crate as `::rustc_middle`
|
||||||
extern crate self as rustc_middle;
|
extern crate self as rustc_middle;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
|
@ -28,7 +28,7 @@ use rustc_middle::ty::query::Providers;
|
||||||
use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
|
use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
|
||||||
use rustc_macros::fluent_messages;
|
use rustc_macros::fluent_messages;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
pub fn provide(providers: &mut Providers) {
|
pub fn provide(providers: &mut Providers) {
|
||||||
providers.check_match = thir::pattern::check_match;
|
providers.check_match = thir::pattern::check_match;
|
||||||
|
|
|
@ -46,7 +46,7 @@ pub mod storage;
|
||||||
pub mod un_derefer;
|
pub mod un_derefer;
|
||||||
pub mod value_analysis;
|
pub mod value_analysis;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
pub(crate) mod indexes {
|
pub(crate) mod indexes {
|
||||||
pub(crate) use super::move_paths::MovePathIndex;
|
pub(crate) use super::move_paths::MovePathIndex;
|
||||||
|
|
|
@ -23,7 +23,7 @@ mod partitioning;
|
||||||
mod polymorphize;
|
mod polymorphize;
|
||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
fn custom_coerce_unsize_info<'tcx>(
|
fn custom_coerce_unsize_info<'tcx>(
|
||||||
tcx: TyCtxtAt<'tcx>,
|
tcx: TyCtxtAt<'tcx>,
|
||||||
|
|
|
@ -36,7 +36,7 @@ pub mod validate_attr;
|
||||||
|
|
||||||
mod errors;
|
mod errors;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
// A bunch of utility functions of the form `parse_<thing>_from_<source>`
|
// A bunch of utility functions of the form `parse_<thing>_from_<source>`
|
||||||
// where <thing> includes crate, expr, item, stmt, tts, and one that
|
// where <thing> includes crate, expr, item, stmt, tts, and one that
|
||||||
|
|
|
@ -42,7 +42,7 @@ pub mod stability;
|
||||||
mod upvars;
|
mod upvars;
|
||||||
mod weak_lang_items;
|
mod weak_lang_items;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
pub fn provide(providers: &mut Providers) {
|
pub fn provide(providers: &mut Providers) {
|
||||||
check_attr::provide(providers);
|
check_attr::provide(providers);
|
||||||
|
|
|
@ -18,7 +18,7 @@ use rustc_macros::fluent_messages;
|
||||||
mod errors;
|
mod errors;
|
||||||
pub mod load;
|
pub mod load;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
/// Structure used to register plugins.
|
/// Structure used to register plugins.
|
||||||
///
|
///
|
||||||
|
|
|
@ -46,7 +46,7 @@ use errors::{
|
||||||
UnnamedItemIsPrivate,
|
UnnamedItemIsPrivate,
|
||||||
};
|
};
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// Generic infrastructure used to implement specific visitors below.
|
/// Generic infrastructure used to implement specific visitors below.
|
||||||
|
|
|
@ -30,4 +30,4 @@ pub use error::LayoutOfDepth;
|
||||||
pub use error::QueryOverflow;
|
pub use error::QueryOverflow;
|
||||||
pub use values::Value;
|
pub use values::Value;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
|
@ -81,7 +81,7 @@ mod late;
|
||||||
mod macros;
|
mod macros;
|
||||||
pub mod rustdoc;
|
pub mod rustdoc;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
enum Weak {
|
enum Weak {
|
||||||
Yes,
|
Yes,
|
||||||
|
|
|
@ -42,7 +42,7 @@ pub mod output;
|
||||||
|
|
||||||
pub use getopts;
|
pub use getopts;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
/// Requirements for a `StableHashingContext` to be used in this crate.
|
/// Requirements for a `StableHashingContext` to be used in this crate.
|
||||||
/// This is a hack to allow using the `HashStable_Generic` derive macro
|
/// This is a hack to allow using the `HashStable_Generic` derive macro
|
||||||
|
|
|
@ -119,7 +119,7 @@ pub mod errors;
|
||||||
pub mod test;
|
pub mod test;
|
||||||
pub mod typeid;
|
pub mod typeid;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
/// This function computes the symbol name for the given `instance` and the
|
/// This function computes the symbol name for the given `instance` and the
|
||||||
/// given instantiating crate. That is, if you know that instance X is
|
/// given instantiating crate. That is, if you know that instance X is
|
||||||
|
|
|
@ -44,4 +44,4 @@ pub mod infer;
|
||||||
pub mod solve;
|
pub mod solve;
|
||||||
pub mod traits;
|
pub mod traits;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
|
@ -33,7 +33,7 @@ pub mod representability;
|
||||||
mod structural_match;
|
mod structural_match;
|
||||||
mod ty;
|
mod ty;
|
||||||
|
|
||||||
fluent_messages! { "../locales/en-US.ftl" }
|
fluent_messages! { "../messages.ftl" }
|
||||||
|
|
||||||
pub fn provide(providers: &mut Providers) {
|
pub fn provide(providers: &mut Providers) {
|
||||||
abi::provide(providers);
|
abi::provide(providers);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue