-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPDATE - merge and avoid translations for symbol mangling test output
- Loading branch information
1 parent
1ce5198
commit c846ba6
Showing
3 changed files
with
35 additions
and
39 deletions.
There are no files selected for viewing
8 changes: 1 addition & 7 deletions
8
compiler/rustc_error_messages/locales/en-US/symbol_mangling.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1 @@ | ||
symbol_mangling_invalid_symbol_name = symbol-name({$mangled_formatted}) | ||
symbol_mangling_invalid_trait_item = demangling({$demangling_formatted}) | ||
symbol_mangling_alt_invalid_trait_item = demangling-alt({$alt_demangling_formatted}) | ||
symbol_mangling_invalid_def_path = def-path({$def_path}) | ||
symbol_mangling_test_output = {$kind}({$content}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,34 @@ | ||
//! Errors emitted by symbol_mangling. | ||
use rustc_errors::{DiagnosticArgValue, IntoDiagnosticArg}; | ||
use rustc_macros::SessionDiagnostic; | ||
use rustc_span::Span; | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(symbol_mangling::invalid_symbol_name)] | ||
pub struct InvalidSymbolName { | ||
#[diag(symbol_mangling::test_output)] | ||
pub struct TestOutput { | ||
#[primary_span] | ||
pub span: Span, | ||
pub mangled_formatted: String, | ||
pub kind: Kind, | ||
pub content: String, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(symbol_mangling::invalid_trait_item)] | ||
pub struct InvalidTraitItem { | ||
#[primary_span] | ||
pub span: Span, | ||
pub demangling_formatted: String, | ||
pub enum Kind { | ||
SymbolName, | ||
Demangling, | ||
DemanglingAlt, | ||
DefPath, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(symbol_mangling::alt_invalid_trait_item)] | ||
pub struct AltInvalidTraitItem { | ||
#[primary_span] | ||
pub span: Span, | ||
pub alt_demangling_formatted: String, | ||
} | ||
|
||
#[derive(SessionDiagnostic)] | ||
#[diag(symbol_mangling::invalid_def_path)] | ||
pub struct InvalidDefPath { | ||
#[primary_span] | ||
pub span: Span, | ||
pub def_path: String, | ||
impl IntoDiagnosticArg for Kind { | ||
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { | ||
let kind = match self { | ||
Kind::SymbolName => "symbol-name", | ||
Kind::Demangling => "demangling", | ||
Kind::DemanglingAlt => "demangling-alt", | ||
Kind::DefPath => "def-path", | ||
} | ||
.into(); | ||
DiagnosticArgValue::Str(kind) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters