Skip to content

Commit 09ea9f0

Browse files
committed
Add diagnostic translation lints to crates that don't emit them
1 parent bb99e6f commit 09ea9f0

File tree

25 files changed

+52
-0
lines changed

25 files changed

+52
-0
lines changed

compiler/rustc_apfloat/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
3434
#![no_std]
3535
#![forbid(unsafe_code)]
36+
#![deny(rustc::untranslatable_diagnostic)]
37+
#![deny(rustc::diagnostic_outside_of_impl)]
3638

3739
#[macro_use]
3840
extern crate alloc;

compiler/rustc_arena/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#![feature(rustc_attrs)]
2020
#![cfg_attr(test, feature(test))]
2121
#![feature(strict_provenance)]
22+
#![deny(rustc::untranslatable_diagnostic)]
23+
#![deny(rustc::diagnostic_outside_of_impl)]
2224

2325
use smallvec::SmallVec;
2426

compiler/rustc_ast/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#![feature(slice_internals)]
2020
#![feature(stmt_expr_attributes)]
2121
#![recursion_limit = "256"]
22+
#![deny(rustc::untranslatable_diagnostic)]
23+
#![deny(rustc::diagnostic_outside_of_impl)]
2224

2325
#[macro_use]
2426
extern crate rustc_macros;

compiler/rustc_ast_pretty/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![deny(rustc::untranslatable_diagnostic)]
2+
#![deny(rustc::diagnostic_outside_of_impl)]
13
#![feature(associated_type_bounds)]
24
#![feature(box_patterns)]
35
#![feature(with_negative_coherence)]

compiler/rustc_data_structures/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#![feature(vec_into_raw_parts)]
2929
#![allow(rustc::default_hash_types)]
3030
#![allow(rustc::potential_query_instability)]
31+
#![deny(rustc::untranslatable_diagnostic)]
32+
#![deny(rustc::diagnostic_outside_of_impl)]
3133

3234
#[macro_use]
3335
extern crate tracing;

compiler/rustc_error_codes/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#![deny(rustdoc::invalid_codeblock_attributes)]
2+
#![deny(rustc::untranslatable_diagnostic)]
3+
#![deny(rustc::diagnostic_outside_of_impl)]
24
//! This library is used to gather all error codes into one place,
35
//! the goal being to make their maintenance easier.
46

compiler/rustc_error_messages/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#![feature(once_cell)]
22
#![feature(rustc_attrs)]
33
#![feature(type_alias_impl_trait)]
4+
#![deny(rustc::untranslatable_diagnostic)]
5+
#![deny(rustc::diagnostic_outside_of_impl)]
46

57
use fluent_bundle::FluentResource;
68
use fluent_syntax::parser::ParserError;

compiler/rustc_feature/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
//! symbol to the `accepted` or `removed` modules respectively.
1313
1414
#![feature(once_cell)]
15+
#![deny(rustc::untranslatable_diagnostic)]
16+
#![deny(rustc::diagnostic_outside_of_impl)]
1517

1618
mod accepted;
1719
mod active;

compiler/rustc_fs_util/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#![deny(rustc::untranslatable_diagnostic)]
2+
#![deny(rustc::diagnostic_outside_of_impl)]
3+
14
use std::ffi::CString;
25
use std::fs;
36
use std::io;

compiler/rustc_graphviz/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@
273273
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
274274
test(attr(allow(unused_variables), deny(warnings)))
275275
)]
276+
#![deny(rustc::untranslatable_diagnostic)]
277+
#![deny(rustc::diagnostic_outside_of_impl)]
276278

277279
use LabelText::*;
278280

compiler/rustc_hir/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#![feature(never_type)]
1212
#![feature(rustc_attrs)]
1313
#![recursion_limit = "256"]
14+
#![deny(rustc::untranslatable_diagnostic)]
15+
#![deny(rustc::diagnostic_outside_of_impl)]
1416

1517
#[macro_use]
1618
extern crate rustc_macros;

compiler/rustc_hir_pretty/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#![recursion_limit = "256"]
2+
#![deny(rustc::untranslatable_diagnostic)]
3+
#![deny(rustc::diagnostic_outside_of_impl)]
24

35
use rustc_ast as ast;
46
use rustc_ast::util::parser::{self, AssocOp, Fixity};

compiler/rustc_index/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![deny(rustc::untranslatable_diagnostic)]
2+
#![deny(rustc::diagnostic_outside_of_impl)]
13
#![feature(allow_internal_unstable)]
24
#![feature(bench_black_box)]
35
#![feature(extend_one)]

compiler/rustc_lexer/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
//! lexeme types.
1919
//!
2020
//! [`rustc_parse::lexer`]: ../rustc_parse/lexer/index.html
21+
#![deny(rustc::untranslatable_diagnostic)]
22+
#![deny(rustc::diagnostic_outside_of_impl)]
2123
// We want to be able to build this crate with a stable compiler, so no
2224
// `#![feature]` attributes should be added.
2325

compiler/rustc_lint_defs/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#![feature(min_specialization)]
2+
#![deny(rustc::untranslatable_diagnostic)]
3+
#![deny(rustc::diagnostic_outside_of_impl)]
24

35
#[macro_use]
46
extern crate rustc_macros;

compiler/rustc_llvm/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![deny(rustc::untranslatable_diagnostic)]
2+
#![deny(rustc::diagnostic_outside_of_impl)]
13
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
24

35
// NOTE: This crate only exists to allow linking on mingw targets.

compiler/rustc_log/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
//! debugging, you can make changes inside those crates and quickly run main.rs
3939
//! to read the debug logs.
4040
41+
#![deny(rustc::untranslatable_diagnostic)]
42+
#![deny(rustc::diagnostic_outside_of_impl)]
43+
4144
use std::env::{self, VarError};
4245
use std::fmt::{self, Display};
4346
use std::io;

compiler/rustc_macros/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#![feature(proc_macro_diagnostic)]
55
#![feature(proc_macro_span)]
66
#![allow(rustc::default_hash_types)]
7+
#![deny(rustc::untranslatable_diagnostic)]
8+
#![deny(rustc::diagnostic_outside_of_impl)]
79
#![recursion_limit = "128"]
810

911
use synstructure::decl_derive;

compiler/rustc_parse_format/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
html_playground_url = "https://play.rust-lang.org/",
1010
test(attr(deny(warnings)))
1111
)]
12+
#![deny(rustc::untranslatable_diagnostic)]
13+
#![deny(rustc::diagnostic_outside_of_impl)]
1214
// We want to be able to build this crate with a stable compiler, so no
1315
// `#![feature]` attributes should be added.
1416

compiler/rustc_query_impl/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#![feature(rustc_attrs)]
88
#![recursion_limit = "256"]
99
#![allow(rustc::potential_query_instability)]
10+
#![deny(rustc::untranslatable_diagnostic)]
11+
#![deny(rustc::diagnostic_outside_of_impl)]
1012

1113
#[macro_use]
1214
extern crate rustc_macros;

compiler/rustc_serialize/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Core encoding and decoding interfaces.
1818
#![feature(new_uninit)]
1919
#![cfg_attr(test, feature(test))]
2020
#![allow(rustc::internal)]
21+
#![deny(rustc::untranslatable_diagnostic)]
22+
#![deny(rustc::diagnostic_outside_of_impl)]
2123

2224
pub use self::serialize::{Decodable, Decoder, Encodable, Encoder};
2325

compiler/rustc_smir/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
test(attr(allow(unused_variables), deny(warnings)))
1212
)]
1313
#![cfg_attr(not(feature = "default"), feature(rustc_private))]
14+
#![deny(rustc::untranslatable_diagnostic)]
15+
#![deny(rustc::diagnostic_outside_of_impl)]
1416

1517
pub mod mir;
1618

compiler/rustc_span/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#![feature(negative_impls)]
2121
#![feature(min_specialization)]
2222
#![feature(rustc_attrs)]
23+
#![deny(rustc::untranslatable_diagnostic)]
24+
#![deny(rustc::diagnostic_outside_of_impl)]
2325

2426
#[macro_use]
2527
extern crate rustc_macros;

compiler/rustc_target/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#![feature(never_type)]
1717
#![feature(rustc_attrs)]
1818
#![feature(step_trait)]
19+
#![deny(rustc::untranslatable_diagnostic)]
20+
#![deny(rustc::diagnostic_outside_of_impl)]
1921

2022
use std::iter::FromIterator;
2123
use std::path::{Path, PathBuf};

compiler/rustc_traits/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//! New recursive solver modeled on Chalk's recursive solver. Most of
22
//! the guts are broken up into modules; see the comments in those modules.
33
4+
#![deny(rustc::untranslatable_diagnostic)]
5+
#![deny(rustc::diagnostic_outside_of_impl)]
46
#![feature(let_else)]
57
#![recursion_limit = "256"]
68

0 commit comments

Comments
 (0)