rustc_interface/
errors.rs

1use std::io;
2use std::path::Path;
3
4use rustc_macros::Diagnostic;
5use rustc_span::{Span, Symbol};
6
7#[derive(Diagnostic)]
8#[diag(interface_crate_name_does_not_match)]
9pub(crate) struct CrateNameDoesNotMatch {
10    #[primary_span]
11    pub(crate) span: Span,
12    pub(crate) crate_name: Symbol,
13    pub(crate) attr_crate_name: Symbol,
14}
15
16#[derive(Diagnostic)]
17#[diag(interface_crate_name_invalid)]
18pub(crate) struct CrateNameInvalid<'a> {
19    pub(crate) crate_name: &'a str,
20}
21
22#[derive(Diagnostic)]
23#[diag(interface_ferris_identifier)]
24pub struct FerrisIdentifier {
25    #[primary_span]
26    pub spans: Vec<Span>,
27    #[suggestion(code = "{ferris_fix}", applicability = "maybe-incorrect")]
28    pub first_span: Span,
29    pub ferris_fix: &'static str,
30}
31
32#[derive(Diagnostic)]
33#[diag(interface_emoji_identifier)]
34pub struct EmojiIdentifier {
35    #[primary_span]
36    pub spans: Vec<Span>,
37    pub ident: Symbol,
38}
39
40#[derive(Diagnostic)]
41#[diag(interface_mixed_bin_crate)]
42pub struct MixedBinCrate;
43
44#[derive(Diagnostic)]
45#[diag(interface_mixed_proc_macro_crate)]
46pub struct MixedProcMacroCrate;
47
48#[derive(Diagnostic)]
49#[diag(interface_error_writing_dependencies)]
50pub struct ErrorWritingDependencies<'a> {
51    pub path: &'a Path,
52    pub error: io::Error,
53}
54
55#[derive(Diagnostic)]
56#[diag(interface_input_file_would_be_overwritten)]
57pub struct InputFileWouldBeOverWritten<'a> {
58    pub path: &'a Path,
59}
60
61#[derive(Diagnostic)]
62#[diag(interface_generated_file_conflicts_with_directory)]
63pub struct GeneratedFileConflictsWithDirectory<'a> {
64    pub input_path: &'a Path,
65    pub dir_path: &'a Path,
66}
67
68#[derive(Diagnostic)]
69#[diag(interface_temps_dir_error)]
70pub struct TempsDirError;
71
72#[derive(Diagnostic)]
73#[diag(interface_out_dir_error)]
74pub struct OutDirError;
75
76#[derive(Diagnostic)]
77#[diag(interface_failed_writing_file)]
78pub struct FailedWritingFile<'a> {
79    pub path: &'a Path,
80    pub error: io::Error,
81}
82
83#[derive(Diagnostic)]
84#[diag(interface_proc_macro_crate_panic_abort)]
85pub struct ProcMacroCratePanicAbort;
86
87#[derive(Diagnostic)]
88#[diag(interface_multiple_output_types_adaption)]
89pub struct MultipleOutputTypesAdaption;
90
91#[derive(Diagnostic)]
92#[diag(interface_ignoring_extra_filename)]
93pub struct IgnoringExtraFilename;
94
95#[derive(Diagnostic)]
96#[diag(interface_ignoring_out_dir)]
97pub struct IgnoringOutDir;
98
99#[derive(Diagnostic)]
100#[diag(interface_multiple_output_types_to_stdout)]
101pub struct MultipleOutputTypesToStdout;
102
103#[derive(Diagnostic)]
104#[diag(interface_abi_required_feature)]
105#[note]
106#[note(interface_abi_required_feature_issue)]
107pub(crate) struct AbiRequiredTargetFeature<'a> {
108    pub feature: &'a str,
109    pub enabled: &'a str,
110}
111
112#[derive(Diagnostic)]
113#[diag(interface_limit_invalid)]
114pub(crate) struct LimitInvalid<'a> {
115    #[primary_span]
116    pub span: Span,
117    #[label]
118    pub value_span: Span,
119    pub error_str: &'a str,
120}
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy