Skip to content

Commit 82fbecd

Browse files
committed
Revert "Rollup merge of rust-lang#95512 - davidtwco:diagnostic-translation, r=oli-obk"
This reverts commit d473024, reversing changes made to 73eab35.
1 parent 2d5a21f commit 82fbecd

File tree

101 files changed

+1071
-2910
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1071
-2910
lines changed

Cargo.lock

-142
Original file line numberDiff line numberDiff line change
@@ -1235,40 +1235,6 @@ dependencies = [
12351235
"miniz_oxide",
12361236
]
12371237

1238-
[[package]]
1239-
name = "fluent-bundle"
1240-
version = "0.15.2"
1241-
source = "registry+https://github.com/rust-lang/crates.io-index"
1242-
checksum = "e242c601dec9711505f6d5bbff5bedd4b61b2469f2e8bb8e57ee7c9747a87ffd"
1243-
dependencies = [
1244-
"fluent-langneg",
1245-
"fluent-syntax",
1246-
"intl-memoizer",
1247-
"intl_pluralrules",
1248-
"rustc-hash",
1249-
"self_cell",
1250-
"smallvec",
1251-
"unic-langid",
1252-
]
1253-
1254-
[[package]]
1255-
name = "fluent-langneg"
1256-
version = "0.13.0"
1257-
source = "registry+https://github.com/rust-lang/crates.io-index"
1258-
checksum = "2c4ad0989667548f06ccd0e306ed56b61bd4d35458d54df5ec7587c0e8ed5e94"
1259-
dependencies = [
1260-
"unic-langid",
1261-
]
1262-
1263-
[[package]]
1264-
name = "fluent-syntax"
1265-
version = "0.11.0"
1266-
source = "registry+https://github.com/rust-lang/crates.io-index"
1267-
checksum = "c0abed97648395c902868fee9026de96483933faa54ea3b40d652f7dfe61ca78"
1268-
dependencies = [
1269-
"thiserror",
1270-
]
1271-
12721238
[[package]]
12731239
name = "fnv"
12741240
version = "1.0.7"
@@ -1813,26 +1779,6 @@ dependencies = [
18131779
"cfg-if 1.0.0",
18141780
]
18151781

1816-
[[package]]
1817-
name = "intl-memoizer"
1818-
version = "0.5.1"
1819-
source = "registry+https://github.com/rust-lang/crates.io-index"
1820-
checksum = "c310433e4a310918d6ed9243542a6b83ec1183df95dff8f23f87bb88a264a66f"
1821-
dependencies = [
1822-
"type-map",
1823-
"unic-langid",
1824-
]
1825-
1826-
[[package]]
1827-
name = "intl_pluralrules"
1828-
version = "7.0.1"
1829-
source = "registry+https://github.com/rust-lang/crates.io-index"
1830-
checksum = "b18f988384267d7066cc2be425e6faf352900652c046b6971d2e228d3b1c5ecf"
1831-
dependencies = [
1832-
"tinystr",
1833-
"unic-langid",
1834-
]
1835-
18361782
[[package]]
18371783
name = "itertools"
18381784
version = "0.10.1"
@@ -2863,12 +2809,6 @@ dependencies = [
28632809
"version_check",
28642810
]
28652811

2866-
[[package]]
2867-
name = "proc-macro-hack"
2868-
version = "0.5.19"
2869-
source = "registry+https://github.com/rust-lang/crates.io-index"
2870-
checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
2871-
28722812
[[package]]
28732813
name = "proc-macro2"
28742814
version = "1.0.30"
@@ -3702,29 +3642,13 @@ dependencies = [
37023642
name = "rustc_error_codes"
37033643
version = "0.0.0"
37043644

3705-
[[package]]
3706-
name = "rustc_error_messages"
3707-
version = "0.0.0"
3708-
dependencies = [
3709-
"fluent-bundle",
3710-
"fluent-syntax",
3711-
"intl-memoizer",
3712-
"rustc_data_structures",
3713-
"rustc_macros",
3714-
"rustc_serialize",
3715-
"rustc_span",
3716-
"tracing",
3717-
"unic-langid",
3718-
]
3719-
37203645
[[package]]
37213646
name = "rustc_errors"
37223647
version = "0.0.0"
37233648
dependencies = [
37243649
"annotate-snippets",
37253650
"atty",
37263651
"rustc_data_structures",
3727-
"rustc_error_messages",
37283652
"rustc_lint_defs",
37293653
"rustc_macros",
37303654
"rustc_serialize",
@@ -3781,7 +3705,6 @@ dependencies = [
37813705
"odht",
37823706
"rustc_ast",
37833707
"rustc_data_structures",
3784-
"rustc_error_messages",
37853708
"rustc_feature",
37863709
"rustc_index",
37873710
"rustc_macros",
@@ -3938,7 +3861,6 @@ version = "0.0.0"
39383861
dependencies = [
39393862
"rustc_ast",
39403863
"rustc_data_structures",
3941-
"rustc_error_messages",
39423864
"rustc_hir",
39433865
"rustc_macros",
39443866
"rustc_serialize",
@@ -4648,12 +4570,6 @@ dependencies = [
46484570
"libc",
46494571
]
46504572

4651-
[[package]]
4652-
name = "self_cell"
4653-
version = "0.10.2"
4654-
source = "registry+https://github.com/rust-lang/crates.io-index"
4655-
checksum = "1ef965a420fe14fdac7dd018862966a4c14094f900e1650bbc71ddd7d580c8af"
4656-
46574573
[[package]]
46584574
name = "semver"
46594575
version = "1.0.3"
@@ -5185,12 +5101,6 @@ dependencies = [
51855101
"winapi",
51865102
]
51875103

5188-
[[package]]
5189-
name = "tinystr"
5190-
version = "0.3.4"
5191-
source = "registry+https://github.com/rust-lang/crates.io-index"
5192-
checksum = "29738eedb4388d9ea620eeab9384884fc3f06f586a2eddb56bedc5885126c7c1"
5193-
51945104
[[package]]
51955105
name = "tinyvec"
51965106
version = "0.3.4"
@@ -5349,15 +5259,6 @@ dependencies = [
53495259
"tracing-subscriber",
53505260
]
53515261

5352-
[[package]]
5353-
name = "type-map"
5354-
version = "0.4.0"
5355-
source = "registry+https://github.com/rust-lang/crates.io-index"
5356-
checksum = "b6d3364c5e96cb2ad1603037ab253ddd34d7fb72a58bdddf4b7350760fc69a46"
5357-
dependencies = [
5358-
"rustc-hash",
5359-
]
5360-
53615262
[[package]]
53625263
name = "typenum"
53635264
version = "1.12.0"
@@ -5412,49 +5313,6 @@ dependencies = [
54125313
"unic-ucd-version",
54135314
]
54145315

5415-
[[package]]
5416-
name = "unic-langid"
5417-
version = "0.9.0"
5418-
source = "registry+https://github.com/rust-lang/crates.io-index"
5419-
checksum = "73328fcd730a030bdb19ddf23e192187a6b01cd98be6d3140622a89129459ce5"
5420-
dependencies = [
5421-
"unic-langid-impl",
5422-
"unic-langid-macros",
5423-
]
5424-
5425-
[[package]]
5426-
name = "unic-langid-impl"
5427-
version = "0.9.0"
5428-
source = "registry+https://github.com/rust-lang/crates.io-index"
5429-
checksum = "1a4a8eeaf0494862c1404c95ec2f4c33a2acff5076f64314b465e3ddae1b934d"
5430-
dependencies = [
5431-
"tinystr",
5432-
]
5433-
5434-
[[package]]
5435-
name = "unic-langid-macros"
5436-
version = "0.9.0"
5437-
source = "registry+https://github.com/rust-lang/crates.io-index"
5438-
checksum = "18f980d6d87e8805f2836d64b4138cc95aa7986fa63b1f51f67d5fbff64dd6e5"
5439-
dependencies = [
5440-
"proc-macro-hack",
5441-
"tinystr",
5442-
"unic-langid-impl",
5443-
"unic-langid-macros-impl",
5444-
]
5445-
5446-
[[package]]
5447-
name = "unic-langid-macros-impl"
5448-
version = "0.9.0"
5449-
source = "registry+https://github.com/rust-lang/crates.io-index"
5450-
checksum = "29396ffd97e27574c3e01368b1a64267d3064969e4848e2e130ff668be9daa9f"
5451-
dependencies = [
5452-
"proc-macro-hack",
5453-
"quote",
5454-
"syn",
5455-
"unic-langid-impl",
5456-
]
5457-
54585316
[[package]]
54595317
name = "unic-ucd-version"
54605318
version = "0.9.0"

compiler/rustc_borrowck/src/borrowck_errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use rustc_errors::{struct_span_err, DiagnosticBuilder, DiagnosticId, ErrorGuaranteed, MultiSpan};
1+
use rustc_errors::{struct_span_err, DiagnosticBuilder, DiagnosticId, ErrorGuaranteed};
22
use rustc_middle::ty::{self, Ty, TyCtxt};
3-
use rustc_span::Span;
3+
use rustc_span::{MultiSpan, Span};
44

55
impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
66
crate fn cannot_move_when_borrowed(

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use either::Either;
22
use rustc_const_eval::util::CallKind;
33
use rustc_data_structures::fx::FxHashSet;
4-
use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, ErrorGuaranteed, MultiSpan};
4+
use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, ErrorGuaranteed};
55
use rustc_hir as hir;
66
use rustc_hir::def_id::DefId;
77
use rustc_hir::{AsyncGeneratorKind, GeneratorKind};
@@ -15,7 +15,7 @@ use rustc_middle::mir::{
1515
use rustc_middle::ty::{self, subst::Subst, suggest_constraining_type_params, PredicateKind, Ty};
1616
use rustc_mir_dataflow::move_paths::{InitKind, MoveOutIndex, MovePathIndex};
1717
use rustc_span::symbol::sym;
18-
use rustc_span::{BytePos, Span};
18+
use rustc_span::{BytePos, MultiSpan, Span};
1919
use rustc_trait_selection::infer::InferCtxtExt;
2020
use rustc_trait_selection::traits::TraitEngineExt as _;
2121

compiler/rustc_borrowck/src/diagnostics/region_name.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl RegionName {
109109
*span,
110110
format!("lifetime `{}` represents this closure's body", self),
111111
);
112-
diag.note(note);
112+
diag.note(&note);
113113
}
114114
RegionNameSource::AnonRegionFromArgument(RegionNameHighlight::CannotMatchHirTy(
115115
span,

compiler/rustc_builtin_macros/src/format.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ use rustc_ast::tokenstream::TokenStream;
77
use rustc_ast::visit::{self, Visitor};
88
use rustc_ast::{token, BlockCheckMode, UnsafeSource};
99
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
10-
use rustc_errors::{pluralize, Applicability, MultiSpan, PResult};
10+
use rustc_errors::{pluralize, Applicability, PResult};
1111
use rustc_expand::base::{self, *};
1212
use rustc_parse_format as parse;
1313
use rustc_span::symbol::{sym, Ident, Symbol};
14-
use rustc_span::{InnerSpan, Span};
14+
use rustc_span::{InnerSpan, MultiSpan, Span};
1515
use smallvec::SmallVec;
1616

1717
use std::borrow::Cow;
@@ -446,9 +446,7 @@ impl<'a, 'b> Context<'a, 'b> {
446446
.iter()
447447
.filter(|fmt| fmt.precision_span.is_some())
448448
.count();
449-
e.span_label(
450-
span,
451-
&format!(
449+
e.span_label(span, &format!(
452450
"this precision flag adds an extra required argument at position {}, \
453451
which is why there {} expected",
454452
pos,
@@ -457,8 +455,7 @@ impl<'a, 'b> Context<'a, 'b> {
457455
} else {
458456
format!("are {} arguments", count)
459457
},
460-
),
461-
);
458+
));
462459
if let Some(arg) = self.args.get(pos) {
463460
e.span_label(
464461
arg.span,

compiler/rustc_codegen_ssa/src/back/write.rs

+5-15
Original file line numberDiff line numberDiff line change
@@ -1707,33 +1707,23 @@ impl SharedEmitter {
17071707

17081708
impl Emitter for SharedEmitter {
17091709
fn emit_diagnostic(&mut self, diag: &rustc_errors::Diagnostic) {
1710-
let fluent_args = self.to_fluent_args(diag.args());
17111710
drop(self.sender.send(SharedEmitterMessage::Diagnostic(Diagnostic {
1712-
msg: self.translate_messages(&diag.message, &fluent_args).to_string(),
1711+
msg: diag.message(),
17131712
code: diag.code.clone(),
17141713
lvl: diag.level(),
17151714
})));
17161715
for child in &diag.children {
17171716
drop(self.sender.send(SharedEmitterMessage::Diagnostic(Diagnostic {
1718-
msg: self.translate_messages(&child.message, &fluent_args).to_string(),
1717+
msg: child.message(),
17191718
code: None,
17201719
lvl: child.level,
17211720
})));
17221721
}
17231722
drop(self.sender.send(SharedEmitterMessage::AbortIfErrors));
17241723
}
1725-
17261724
fn source_map(&self) -> Option<&Lrc<SourceMap>> {
17271725
None
17281726
}
1729-
1730-
fn fluent_bundle(&self) -> Option<&Lrc<rustc_errors::FluentBundle>> {
1731-
None
1732-
}
1733-
1734-
fn fallback_fluent_bundle(&self) -> &Lrc<rustc_errors::FluentBundle> {
1735-
panic!("shared emitter attempted to translate a diagnostic");
1736-
}
17371727
}
17381728

17391729
impl SharedEmitterMain {
@@ -1764,9 +1754,9 @@ impl SharedEmitterMain {
17641754
let msg = msg.strip_prefix("error: ").unwrap_or(&msg);
17651755

17661756
let mut err = match level {
1767-
Level::Error { lint: false } => sess.struct_err(msg).forget_guarantee(),
1768-
Level::Warning => sess.struct_warn(msg),
1769-
Level::Note => sess.struct_note_without_error(msg),
1757+
Level::Error { lint: false } => sess.struct_err(&msg).forget_guarantee(),
1758+
Level::Warning => sess.struct_warn(&msg),
1759+
Level::Note => sess.struct_note_without_error(&msg),
17701760
_ => bug!("Invalid inline asm diagnostic level"),
17711761
};
17721762

compiler/rustc_driver/src/lib.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1172,13 +1172,9 @@ static DEFAULT_HOOK: SyncLazy<Box<dyn Fn(&panic::PanicInfo<'_>) + Sync + Send +
11721172
/// When `install_ice_hook` is called, this function will be called as the panic
11731173
/// hook.
11741174
pub fn report_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
1175-
let fallback_bundle =
1176-
rustc_errors::fallback_fluent_bundle(false).expect("failed to load fallback fluent bundle");
11771175
let emitter = Box::new(rustc_errors::emitter::EmitterWriter::stderr(
11781176
rustc_errors::ColorConfig::Auto,
11791177
None,
1180-
None,
1181-
fallback_bundle,
11821178
false,
11831179
false,
11841180
None,
@@ -1213,7 +1209,7 @@ pub fn report_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
12131209
}
12141210

12151211
for note in &xs {
1216-
handler.note_without_error(note.as_ref());
1212+
handler.note_without_error(note);
12171213
}
12181214

12191215
// If backtraces are enabled, also print the query stack

compiler/rustc_error_messages/Cargo.toml

-18
This file was deleted.

0 commit comments

Comments
 (0)