Skip to content

Commit 2b02964

Browse files
Convert to inline diagnostics in rustc_mir_dataflow
1 parent 55407b8 commit 2b02964

7 files changed

Lines changed: 10 additions & 46 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3803,7 +3803,6 @@ dependencies = [
38033803
"rustc_metadata",
38043804
"rustc_middle",
38053805
"rustc_mir_build",
3806-
"rustc_mir_dataflow",
38073806
"rustc_mir_transform",
38083807
"rustc_monomorphize",
38093808
"rustc_parse",
@@ -4340,7 +4339,6 @@ dependencies = [
43404339
"rustc_ast",
43414340
"rustc_data_structures",
43424341
"rustc_errors",
4343-
"rustc_fluent_macro",
43444342
"rustc_graphviz",
43454343
"rustc_index",
43464344
"rustc_macros",

compiler/rustc_driver_impl/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ rustc_macros = { path = "../rustc_macros" }
3535
rustc_metadata = { path = "../rustc_metadata" }
3636
rustc_middle = { path = "../rustc_middle" }
3737
rustc_mir_build = { path = "../rustc_mir_build" }
38-
rustc_mir_dataflow = { path = "../rustc_mir_dataflow" }
3938
rustc_mir_transform = { path = "../rustc_mir_transform" }
4039
rustc_monomorphize = { path = "../rustc_monomorphize" }
4140
rustc_parse = { path = "../rustc_parse" }

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ pub static DEFAULT_LOCALE_RESOURCES: &[&str] = &[
132132
rustc_metadata::DEFAULT_LOCALE_RESOURCE,
133133
rustc_middle::DEFAULT_LOCALE_RESOURCE,
134134
rustc_mir_build::DEFAULT_LOCALE_RESOURCE,
135-
rustc_mir_dataflow::DEFAULT_LOCALE_RESOURCE,
136135
rustc_mir_transform::DEFAULT_LOCALE_RESOURCE,
137136
rustc_monomorphize::DEFAULT_LOCALE_RESOURCE,
138137
rustc_parse::DEFAULT_LOCALE_RESOURCE,

compiler/rustc_mir_dataflow/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ rustc_abi = { path = "../rustc_abi" }
1111
rustc_ast = { path = "../rustc_ast" }
1212
rustc_data_structures = { path = "../rustc_data_structures" }
1313
rustc_errors = { path = "../rustc_errors" }
14-
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
1514
rustc_graphviz = { path = "../rustc_graphviz" }
1615
rustc_index = { path = "../rustc_index" }
1716
rustc_macros = { path = "../rustc_macros" }

compiler/rustc_mir_dataflow/messages.ftl

Lines changed: 0 additions & 29 deletions
This file was deleted.

compiler/rustc_mir_dataflow/src/errors.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,69 +2,69 @@ use rustc_macros::Diagnostic;
22
use rustc_span::{Span, Symbol};
33

44
#[derive(Diagnostic)]
5-
#[diag(mir_dataflow_path_must_end_in_filename)]
5+
#[diag("path must end in a filename")]
66
pub(crate) struct PathMustEndInFilename {
77
#[primary_span]
88
pub span: Span,
99
}
1010

1111
#[derive(Diagnostic)]
12-
#[diag(mir_dataflow_unknown_formatter)]
12+
#[diag("unknown formatter")]
1313
pub(crate) struct UnknownFormatter {
1414
#[primary_span]
1515
pub span: Span,
1616
}
1717

1818
#[derive(Diagnostic)]
19-
#[diag(mir_dataflow_duplicate_values_for)]
19+
#[diag("duplicate values for `{$name}`")]
2020
pub(crate) struct DuplicateValuesFor {
2121
#[primary_span]
2222
pub span: Span,
2323
pub name: Symbol,
2424
}
2525

2626
#[derive(Diagnostic)]
27-
#[diag(mir_dataflow_requires_an_argument)]
27+
#[diag("`{$name}` requires an argument")]
2828
pub(crate) struct RequiresAnArgument {
2929
#[primary_span]
3030
pub span: Span,
3131
pub name: Symbol,
3232
}
3333

3434
#[derive(Diagnostic)]
35-
#[diag(mir_dataflow_stop_after_dataflow_ended_compilation)]
35+
#[diag("stop_after_dataflow ended compilation")]
3636
pub(crate) struct StopAfterDataFlowEndedCompilation;
3737

3838
#[derive(Diagnostic)]
39-
#[diag(mir_dataflow_peek_must_be_place_or_ref_place)]
39+
#[diag("rustc_peek: argument expression must be either `place` or `&place`")]
4040
pub(crate) struct PeekMustBePlaceOrRefPlace {
4141
#[primary_span]
4242
pub span: Span,
4343
}
4444

4545
#[derive(Diagnostic)]
46-
#[diag(mir_dataflow_peek_must_be_not_temporary)]
46+
#[diag("dataflow::sanity_check cannot feed a non-temp to rustc_peek")]
4747
pub(crate) struct PeekMustBeNotTemporary {
4848
#[primary_span]
4949
pub span: Span,
5050
}
5151

5252
#[derive(Diagnostic)]
53-
#[diag(mir_dataflow_peek_bit_not_set)]
53+
#[diag("rustc_peek: bit not set")]
5454
pub(crate) struct PeekBitNotSet {
5555
#[primary_span]
5656
pub span: Span,
5757
}
5858

5959
#[derive(Diagnostic)]
60-
#[diag(mir_dataflow_peek_argument_not_a_local)]
60+
#[diag("rustc_peek: argument was not a local")]
6161
pub(crate) struct PeekArgumentNotALocal {
6262
#[primary_span]
6363
pub span: Span,
6464
}
6565

6666
#[derive(Diagnostic)]
67-
#[diag(mir_dataflow_peek_argument_untracked)]
67+
#[diag("rustc_peek: argument untracked")]
6868
pub(crate) struct PeekArgumentUntracked {
6969
#[primary_span]
7070
pub span: Span,

compiler/rustc_mir_dataflow/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ pub mod rustc_peek;
3434
mod un_derefer;
3535
pub mod value_analysis;
3636

37-
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
38-
3937
pub struct MoveDataTypingEnv<'tcx> {
4038
pub move_data: MoveData<'tcx>,
4139
pub typing_env: ty::TypingEnv<'tcx>,

0 commit comments

Comments
 (0)