]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_parse/src/errors.rs
Don't unnecessarily stringify paths in diagnostics
[rust.git] / compiler / rustc_parse / src / errors.rs
index f10b178049b8dbe42d0e5fec32c7be0b0eba6479..3d364a956d3ec4667981a5e62c7c11deb21eff05 100644 (file)
@@ -1,3 +1,4 @@
+use rustc_ast::Path;
 use rustc_errors::{fluent, AddToDiagnostic, Applicability, EmissionGuarantee, IntoDiagnostic};
 use rustc_macros::{Diagnostic, Subdiagnostic};
 use rustc_session::errors::ExprParenthesesNeeded;
@@ -536,7 +537,7 @@ pub(crate) struct ComparisonInterpretedAsGeneric {
     #[primary_span]
     #[label(parser::label_comparison)]
     pub comparison: Span,
-    pub typename: String,
+    pub r#type: Path,
     #[label(parser::label_args)]
     pub args: Span,
     #[subdiagnostic]
@@ -549,7 +550,7 @@ pub(crate) struct ShiftInterpretedAsGeneric {
     #[primary_span]
     #[label(parser::label_comparison)]
     pub shift: Span,
-    pub typename: String,
+    pub r#type: Path,
     #[label(parser::label_args)]
     pub args: Span,
     #[subdiagnostic]
@@ -597,7 +598,7 @@ pub(crate) struct LeadingPlusNotSupported {
 pub(crate) struct ParenthesesWithStructFields {
     #[primary_span]
     pub span: Span,
-    pub name: String,
+    pub r#type: Path,
     #[subdiagnostic]
     pub braces_for_struct: BracesForStructLiteral,
     #[subdiagnostic]