Skip to content

Commit 732ad59

Browse files
authored
Rollup merge of #129988 - arnaudgolfouse:modify-locale_resources, r=davidtwco
Use `Vec` in `rustc_interface::Config::locale_resources` This allows a third-party tool to injects its own resources, when receiving the config via `rustc_driver::Callbacks::config`.
2 parents fe3428d + 13d56dc commit 732ad59

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

compiler/rustc_driver_impl/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ fn run_compiler(
320320
output_dir: odir,
321321
ice_file,
322322
file_loader,
323-
locale_resources: DEFAULT_LOCALE_RESOURCES,
323+
locale_resources: DEFAULT_LOCALE_RESOURCES.to_vec(),
324324
lint_caps: Default::default(),
325325
psess_created: None,
326326
hash_untracked_state: None,

compiler/rustc_interface/src/interface.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ pub struct Config {
311311
pub output_file: Option<OutFileName>,
312312
pub ice_file: Option<PathBuf>,
313313
pub file_loader: Option<Box<dyn FileLoader + Send + Sync>>,
314-
pub locale_resources: &'static [&'static str],
314+
/// The list of fluent resources, used for lints declared with
315+
/// [`Diagnostic`](rustc_errors::Diagnostic) and [`LintDiagnostic`](rustc_errors::LintDiagnostic).
316+
pub locale_resources: Vec<&'static str>,
315317

316318
pub lint_caps: FxHashMap<lint::LintId, lint::Level>,
317319

src/librustdoc/core.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ pub(crate) fn create_config(
262262
output_file: None,
263263
output_dir: None,
264264
file_loader: None,
265-
locale_resources: rustc_driver::DEFAULT_LOCALE_RESOURCES,
265+
locale_resources: rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(),
266266
lint_caps,
267267
psess_created: None,
268268
hash_untracked_state: None,

src/librustdoc/doctest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ pub(crate) fn run(
143143
output_file: None,
144144
output_dir: None,
145145
file_loader: None,
146-
locale_resources: rustc_driver::DEFAULT_LOCALE_RESOURCES,
146+
locale_resources: rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(),
147147
lint_caps,
148148
psess_created: None,
149149
hash_untracked_state: None,

tests/ui-fulldeps/run-compiler-twice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ fn compile(code: String, output: PathBuf, sysroot: PathBuf, linker: Option<&Path
6565
output_dir: None,
6666
ice_file: None,
6767
file_loader: None,
68-
locale_resources: &[],
68+
locale_resources: Vec::new(),
6969
lint_caps: Default::default(),
7070
psess_created: None,
7171
hash_untracked_state: None,

0 commit comments

Comments
 (0)