1use std::io::Error;
2use std::path::{Path, PathBuf};
3
4use rustc_errors::codes::*;
5use rustc_errors::{Diag, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level, inline_fluent};
6use rustc_macros::{Diagnostic, Subdiagnostic};
7use rustc_span::{Span, Symbol, sym};
8use rustc_target::spec::{PanicStrategy, TargetTuple};
9
10use crate::locator::CrateFlavor;
11
12#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for RlibRequired
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RlibRequired { crate_name: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("crate `{$crate_name}` required to be available in rlib format, but was not found in this form")));
;
diag.arg("crate_name", __binding_0);
diag
}
}
}
}
};Diagnostic)]
13#[diag(
14 "crate `{$crate_name}` required to be available in rlib format, but was not found in this form"
15)]
16pub struct RlibRequired {
17 pub crate_name: Symbol,
18}
19
20#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
LibRequired<'a> where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LibRequired { crate_name: __binding_0, kind: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("crate `{$crate_name}` required to be available in {$kind} format, but was not found in this form")));
;
diag.arg("crate_name", __binding_0);
diag.arg("kind", __binding_1);
diag
}
}
}
}
};Diagnostic)]
21#[diag(
22 "crate `{$crate_name}` required to be available in {$kind} format, but was not found in this form"
23)]
24pub struct LibRequired<'a> {
25 pub crate_name: Symbol,
26 pub kind: &'a str,
27}
28
29#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
RustcLibRequired<'a> where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RustcLibRequired {
crate_name: __binding_0, kind: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("crate `{$crate_name}` required to be available in {$kind} format, but was not found in this form")));
diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("try adding `extern crate rustc_driver;` at the top level of this crate")));
;
diag.arg("crate_name", __binding_0);
diag.arg("kind", __binding_1);
diag
}
}
}
}
};Diagnostic)]
30#[diag(
31 "crate `{$crate_name}` required to be available in {$kind} format, but was not found in this form"
32)]
33#[help("try adding `extern crate rustc_driver;` at the top level of this crate")]
34pub struct RustcLibRequired<'a> {
35 pub crate_name: Symbol,
36 pub kind: &'a str,
37}
38
39#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CrateDepMultiple where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CrateDepMultiple {
crate_name: __binding_0,
non_static_deps: __binding_1,
rustc_driver_help: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot satisfy dependencies so `{$crate_name}` only shows up once")));
diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("having upstream crates all available in one format will likely make this go away")));
;
diag.arg("crate_name", __binding_0);
for __binding_1 in __binding_1 {
diag.subdiagnostic(__binding_1);
}
if let Some(__binding_2) = __binding_2 {
diag.subdiagnostic(__binding_2);
}
diag
}
}
}
}
};Diagnostic)]
40#[diag("cannot satisfy dependencies so `{$crate_name}` only shows up once")]
41#[help("having upstream crates all available in one format will likely make this go away")]
42pub struct CrateDepMultiple {
43 pub crate_name: Symbol,
44 #[subdiagnostic]
45 pub non_static_deps: Vec<NonStaticCrateDep>,
46 #[subdiagnostic]
47 pub rustc_driver_help: Option<RustcDriverHelp>,
48}
49
50#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for NonStaticCrateDep {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
NonStaticCrateDep { crate_name_: __binding_0 } => {
diag.store_args();
diag.arg("crate_name_", __binding_0);
let __message =
diag.eagerly_translate(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$crate_name}` was unavailable as a static crate, preventing fully static linking")));
diag.note(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
51#[note("`{$crate_name}` was unavailable as a static crate, preventing fully static linking")]
52pub struct NonStaticCrateDep {
53 pub crate_name_: Symbol,
55}
56
57#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for RustcDriverHelp {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
RustcDriverHelp => {
diag.store_args();
let __message =
diag.eagerly_translate(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`feature(rustc_private)` is needed to link to the compiler's `rustc_driver` library")));
diag.help(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
58#[help("`feature(rustc_private)` is needed to link to the compiler's `rustc_driver` library")]
59pub struct RustcDriverHelp;
60
61#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TwoPanicRuntimes where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TwoPanicRuntimes {
prev_name: __binding_0, cur_name: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot link together two panic runtimes: {$prev_name} and {$cur_name}")));
;
diag.arg("prev_name", __binding_0);
diag.arg("cur_name", __binding_1);
diag
}
}
}
}
};Diagnostic)]
62#[diag("cannot link together two panic runtimes: {$prev_name} and {$cur_name}")]
63pub struct TwoPanicRuntimes {
64 pub prev_name: Symbol,
65 pub cur_name: Symbol,
66}
67
68#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
BadPanicStrategy where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
BadPanicStrategy {
runtime: __binding_0, strategy: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the linked panic runtime `{$runtime}` is not compiled with this crate's panic strategy `{$strategy}`")));
;
diag.arg("runtime", __binding_0);
diag.arg("strategy", __binding_1);
diag
}
}
}
}
};Diagnostic)]
69#[diag(
70 "the linked panic runtime `{$runtime}` is not compiled with this crate's panic strategy `{$strategy}`"
71)]
72pub struct BadPanicStrategy {
73 pub runtime: Symbol,
74 pub strategy: PanicStrategy,
75}
76
77#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RequiredPanicStrategy where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RequiredPanicStrategy {
crate_name: __binding_0,
found_strategy: __binding_1,
desired_strategy: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the crate `{$crate_name}` requires panic strategy `{$found_strategy}` which is incompatible with this crate's strategy of `{$desired_strategy}`")));
;
diag.arg("crate_name", __binding_0);
diag.arg("found_strategy", __binding_1);
diag.arg("desired_strategy", __binding_2);
diag
}
}
}
}
};Diagnostic)]
78#[diag(
79 "the crate `{$crate_name}` requires panic strategy `{$found_strategy}` which is incompatible with this crate's strategy of `{$desired_strategy}`"
80)]
81pub struct RequiredPanicStrategy {
82 pub crate_name: Symbol,
83 pub found_strategy: PanicStrategy,
84 pub desired_strategy: PanicStrategy,
85}
86
87#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IncompatibleWithImmediateAbort where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IncompatibleWithImmediateAbort { crate_name: __binding_0 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the crate `{$crate_name}` was compiled with a panic strategy which is incompatible with `immediate-abort`")));
;
diag.arg("crate_name", __binding_0);
diag
}
}
}
}
};Diagnostic)]
88#[diag(
89 "the crate `{$crate_name}` was compiled with a panic strategy which is incompatible with `immediate-abort`"
90)]
91pub struct IncompatibleWithImmediateAbort {
92 pub crate_name: Symbol,
93}
94
95#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IncompatibleWithImmediateAbortCore where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IncompatibleWithImmediateAbortCore => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the crate `core` was compiled with a panic strategy which is incompatible with `immediate-abort`")));
;
diag
}
}
}
}
};Diagnostic)]
96#[diag(
97 "the crate `core` was compiled with a panic strategy which is incompatible with `immediate-abort`"
98)]
99pub struct IncompatibleWithImmediateAbortCore;
100
101#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IncompatiblePanicInDropStrategy where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IncompatiblePanicInDropStrategy {
crate_name: __binding_0,
found_strategy: __binding_1,
desired_strategy: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the crate `{$crate_name}` is compiled with the panic-in-drop strategy `{$found_strategy}` which is incompatible with this crate's strategy of `{$desired_strategy}`")));
;
diag.arg("crate_name", __binding_0);
diag.arg("found_strategy", __binding_1);
diag.arg("desired_strategy", __binding_2);
diag
}
}
}
}
};Diagnostic)]
102#[diag(
103 "the crate `{$crate_name}` is compiled with the panic-in-drop strategy `{$found_strategy}` which is incompatible with this crate's strategy of `{$desired_strategy}`"
104)]
105pub struct IncompatiblePanicInDropStrategy {
106 pub crate_name: Symbol,
107 pub found_strategy: PanicStrategy,
108 pub desired_strategy: PanicStrategy,
109}
110
111#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
LinkOrdinalRawDylib where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LinkOrdinalRawDylib { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`#[link_ordinal]` is only supported if link kind is `raw-dylib`")));
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
112#[diag("`#[link_ordinal]` is only supported if link kind is `raw-dylib`")]
113pub struct LinkOrdinalRawDylib {
114 #[primary_span]
115 pub span: Span,
116}
117
118#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
LibFrameworkApple where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LibFrameworkApple => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("library kind `framework` is only supported on Apple targets")));
;
diag
}
}
}
}
};Diagnostic)]
119#[diag("library kind `framework` is only supported on Apple targets")]
120pub struct LibFrameworkApple;
121
122#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
EmptyRenamingTarget<'a> where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
EmptyRenamingTarget { lib_name: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("an empty renaming target was specified for library `{$lib_name}`")));
;
diag.arg("lib_name", __binding_0);
diag
}
}
}
}
};Diagnostic)]
123#[diag("an empty renaming target was specified for library `{$lib_name}`")]
124pub struct EmptyRenamingTarget<'a> {
125 pub lib_name: &'a str,
126}
127
128#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
RenamingNoLink<'a> where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RenamingNoLink { lib_name: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("renaming of the library `{$lib_name}` was specified, however this crate contains no `#[link(...)]` attributes referencing this library")));
;
diag.arg("lib_name", __binding_0);
diag
}
}
}
}
};Diagnostic)]
129#[diag(
130 "renaming of the library `{$lib_name}` was specified, however this crate contains no `#[link(...)]` attributes referencing this library"
131)]
132pub struct RenamingNoLink<'a> {
133 pub lib_name: &'a str,
134}
135
136#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
MultipleRenamings<'a> where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MultipleRenamings { lib_name: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("multiple renamings were specified for library `{$lib_name}`")));
;
diag.arg("lib_name", __binding_0);
diag
}
}
}
}
};Diagnostic)]
137#[diag("multiple renamings were specified for library `{$lib_name}`")]
138pub struct MultipleRenamings<'a> {
139 pub lib_name: &'a str,
140}
141
142#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NoLinkModOverride where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NoLinkModOverride { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("overriding linking modifiers from command line is not supported")));
;
if let Some(__binding_0) = __binding_0 {
diag.span(__binding_0);
}
diag
}
}
}
}
};Diagnostic)]
143#[diag("overriding linking modifiers from command line is not supported")]
144pub struct NoLinkModOverride {
145 #[primary_span]
146 pub span: Option<Span>,
147}
148
149#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RawDylibUnsupportedAbi where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RawDylibUnsupportedAbi { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("ABI not supported by `#[link(kind = \"raw-dylib\")]` on this architecture")));
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
150#[diag("ABI not supported by `#[link(kind = \"raw-dylib\")]` on this architecture")]
151pub struct RawDylibUnsupportedAbi {
152 #[primary_span]
153 pub span: Span,
154}
155
156#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FailCreateFileEncoder where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FailCreateFileEncoder { err: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("failed to create file encoder: {$err}")));
;
diag.arg("err", __binding_0);
diag
}
}
}
}
};Diagnostic)]
157#[diag("failed to create file encoder: {$err}")]
158pub struct FailCreateFileEncoder {
159 pub err: Error,
160}
161
162#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
FailWriteFile<'a> where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FailWriteFile { path: __binding_0, err: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("failed to write to `{$path}`: {$err}")));
;
diag.arg("path", __binding_0);
diag.arg("err", __binding_1);
diag
}
}
}
}
};Diagnostic)]
163#[diag("failed to write to `{$path}`: {$err}")]
164pub struct FailWriteFile<'a> {
165 pub path: &'a Path,
166 pub err: Error,
167}
168
169#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CrateNotPanicRuntime where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CrateNotPanicRuntime { crate_name: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the crate `{$crate_name}` is not a panic runtime")));
;
diag.arg("crate_name", __binding_0);
diag
}
}
}
}
};Diagnostic)]
170#[diag("the crate `{$crate_name}` is not a panic runtime")]
171pub struct CrateNotPanicRuntime {
172 pub crate_name: Symbol,
173}
174
175#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CrateNotCompilerBuiltins where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CrateNotCompilerBuiltins { crate_name: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the crate `{$crate_name}` resolved as `compiler_builtins` but is not `#![compiler_builtins]`")));
;
diag.arg("crate_name", __binding_0);
diag
}
}
}
}
};Diagnostic)]
176#[diag(
177 "the crate `{$crate_name}` resolved as `compiler_builtins` but is not `#![compiler_builtins]`"
178)]
179pub struct CrateNotCompilerBuiltins {
180 pub crate_name: Symbol,
181}
182
183#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NoPanicStrategy where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NoPanicStrategy {
crate_name: __binding_0, strategy: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the crate `{$crate_name}` does not have the panic strategy `{$strategy}`")));
;
diag.arg("crate_name", __binding_0);
diag.arg("strategy", __binding_1);
diag
}
}
}
}
};Diagnostic)]
184#[diag("the crate `{$crate_name}` does not have the panic strategy `{$strategy}`")]
185pub struct NoPanicStrategy {
186 pub crate_name: Symbol,
187 pub strategy: PanicStrategy,
188}
189
190#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NotProfilerRuntime where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NotProfilerRuntime { crate_name: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the crate `{$crate_name}` is not a profiler runtime")));
;
diag.arg("crate_name", __binding_0);
diag
}
}
}
}
};Diagnostic)]
191#[diag("the crate `{$crate_name}` is not a profiler runtime")]
192pub struct NotProfilerRuntime {
193 pub crate_name: Symbol,
194}
195
196#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NoMultipleGlobalAlloc where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NoMultipleGlobalAlloc {
span2: __binding_0, span1: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot define multiple global allocators")));
;
diag.span(__binding_0);
diag.span_label(__binding_0,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot define a new global allocator")));
diag.span_label(__binding_1,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("previous global allocator defined here")));
diag
}
}
}
}
};Diagnostic)]
197#[diag("cannot define multiple global allocators")]
198pub struct NoMultipleGlobalAlloc {
199 #[primary_span]
200 #[label("cannot define a new global allocator")]
201 pub span2: Span,
202 #[label("previous global allocator defined here")]
203 pub span1: Span,
204}
205
206#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NoMultipleAllocErrorHandler where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NoMultipleAllocErrorHandler {
span2: __binding_0, span1: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot define multiple allocation error handlers")));
;
diag.span(__binding_0);
diag.span_label(__binding_0,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot define a new allocation error handler")));
diag.span_label(__binding_1,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("previous allocation error handler defined here")));
diag
}
}
}
}
};Diagnostic)]
207#[diag("cannot define multiple allocation error handlers")]
208pub struct NoMultipleAllocErrorHandler {
209 #[primary_span]
210 #[label("cannot define a new allocation error handler")]
211 pub span2: Span,
212 #[label("previous allocation error handler defined here")]
213 pub span1: Span,
214}
215
216#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ConflictingGlobalAlloc where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ConflictingGlobalAlloc {
crate_name: __binding_0, other_crate_name: __binding_1 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the `#[global_allocator]` in {$other_crate_name} conflicts with global allocator in: {$crate_name}")));
;
diag.arg("crate_name", __binding_0);
diag.arg("other_crate_name", __binding_1);
diag
}
}
}
}
};Diagnostic)]
217#[diag(
218 "the `#[global_allocator]` in {$other_crate_name} conflicts with global allocator in: {$crate_name}"
219)]
220pub struct ConflictingGlobalAlloc {
221 pub crate_name: Symbol,
222 pub other_crate_name: Symbol,
223}
224
225#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ConflictingAllocErrorHandler where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ConflictingAllocErrorHandler {
crate_name: __binding_0, other_crate_name: __binding_1 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the `#[alloc_error_handler]` in {$other_crate_name} conflicts with allocation error handler in: {$crate_name}")));
;
diag.arg("crate_name", __binding_0);
diag.arg("other_crate_name", __binding_1);
diag
}
}
}
}
};Diagnostic)]
226#[diag(
227 "the `#[alloc_error_handler]` in {$other_crate_name} conflicts with allocation error handler in: {$crate_name}"
228)]
229pub struct ConflictingAllocErrorHandler {
230 pub crate_name: Symbol,
231 pub other_crate_name: Symbol,
232}
233
234#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
GlobalAllocRequired where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
GlobalAllocRequired => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("no global memory allocator found but one is required; link to std or add `#[global_allocator]` to a static item that implements the GlobalAlloc trait")));
;
diag
}
}
}
}
};Diagnostic)]
235#[diag(
236 "no global memory allocator found but one is required; link to std or add `#[global_allocator]` to a static item that implements the GlobalAlloc trait"
237)]
238pub struct GlobalAllocRequired;
239
240#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
NoTransitiveNeedsDep<'a> where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NoTransitiveNeedsDep {
crate_name: __binding_0,
needs_crate_name: __binding_1,
deps_crate_name: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the crate `{$crate_name}` cannot depend on a crate that needs {$needs_crate_name}, but it depends on `{$deps_crate_name}`")));
;
diag.arg("crate_name", __binding_0);
diag.arg("needs_crate_name", __binding_1);
diag.arg("deps_crate_name", __binding_2);
diag
}
}
}
}
};Diagnostic)]
241#[diag(
242 "the crate `{$crate_name}` cannot depend on a crate that needs {$needs_crate_name}, but it depends on `{$deps_crate_name}`"
243)]
244pub struct NoTransitiveNeedsDep<'a> {
245 pub crate_name: Symbol,
246 pub needs_crate_name: &'a str,
247 pub deps_crate_name: Symbol,
248}
249
250#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FailedWriteError where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FailedWriteError { filename: __binding_0, err: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("failed to write {$filename}: {$err}")));
;
diag.arg("filename", __binding_0);
diag.arg("err", __binding_1);
diag
}
}
}
}
};Diagnostic)]
251#[diag("failed to write {$filename}: {$err}")]
252pub struct FailedWriteError {
253 pub filename: PathBuf,
254 pub err: Error,
255}
256
257#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FailedCopyToStdout where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FailedCopyToStdout { filename: __binding_0, err: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("failed to copy {$filename} to stdout: {$err}")));
;
diag.arg("filename", __binding_0);
diag.arg("err", __binding_1);
diag
}
}
}
}
};Diagnostic)]
258#[diag("failed to copy {$filename} to stdout: {$err}")]
259pub struct FailedCopyToStdout {
260 pub filename: PathBuf,
261 pub err: Error,
262}
263
264#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
BinaryOutputToTty where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
BinaryOutputToTty => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("option `-o` or `--emit` is used to write binary output type `metadata` to stdout, but stdout is a tty")));
;
diag
}
}
}
}
};Diagnostic)]
265#[diag(
266 "option `-o` or `--emit` is used to write binary output type `metadata` to stdout, but stdout is a tty"
267)]
268pub struct BinaryOutputToTty;
269
270#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
MissingNativeLibrary<'a> where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingNativeLibrary {
libname: __binding_0, suggest_name: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("could not find native static library `{$libname}`, perhaps an -L flag is missing?")));
;
diag.arg("libname", __binding_0);
if let Some(__binding_1) = __binding_1 {
diag.subdiagnostic(__binding_1);
}
diag
}
}
}
}
};Diagnostic)]
271#[diag("could not find native static library `{$libname}`, perhaps an -L flag is missing?")]
272pub struct MissingNativeLibrary<'a> {
273 libname: &'a str,
274 #[subdiagnostic]
275 suggest_name: Option<SuggestLibraryName<'a>>,
276}
277
278impl<'a> MissingNativeLibrary<'a> {
279 pub fn new(libname: &'a str, verbatim: bool) -> Self {
280 let suggested_name = if !verbatim {
283 if let Some(libname) = libname.strip_circumfix("lib", ".a") {
284 Some(libname)
286 } else if let Some(libname) = libname.strip_suffix(".lib") {
287 Some(libname)
289 } else {
290 None
291 }
292 } else {
293 None
294 };
295
296 Self {
297 libname,
298 suggest_name: suggested_name
299 .map(|suggested_name| SuggestLibraryName { suggested_name }),
300 }
301 }
302}
303
304#[derive(const _: () =
{
impl<'a> rustc_errors::Subdiagnostic for SuggestLibraryName<'a> {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
SuggestLibraryName { suggested_name: __binding_0 } => {
diag.store_args();
diag.arg("suggested_name", __binding_0);
let __message =
diag.eagerly_translate(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("only provide the library name `{$suggested_name}`, not the full filename")));
diag.help(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
305#[help("only provide the library name `{$suggested_name}`, not the full filename")]
306pub struct SuggestLibraryName<'a> {
307 suggested_name: &'a str,
308}
309
310#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FailedCreateTempdir where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FailedCreateTempdir { err: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("couldn't create a temp dir: {$err}")));
;
diag.arg("err", __binding_0);
diag
}
}
}
}
};Diagnostic)]
311#[diag("couldn't create a temp dir: {$err}")]
312pub struct FailedCreateTempdir {
313 pub err: Error,
314}
315
316#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
FailedCreateFile<'a> where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FailedCreateFile { filename: __binding_0, err: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("failed to create the file {$filename}: {$err}")));
;
diag.arg("filename", __binding_0);
diag.arg("err", __binding_1);
diag
}
}
}
}
};Diagnostic)]
317#[diag("failed to create the file {$filename}: {$err}")]
318pub struct FailedCreateFile<'a> {
319 pub filename: &'a Path,
320 pub err: Error,
321}
322
323#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FailedCreateEncodedMetadata where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FailedCreateEncodedMetadata { err: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("failed to create encoded metadata from file: {$err}")));
;
diag.arg("err", __binding_0);
diag
}
}
}
}
};Diagnostic)]
324#[diag("failed to create encoded metadata from file: {$err}")]
325pub struct FailedCreateEncodedMetadata {
326 pub err: Error,
327}
328
329#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for NonAsciiName
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NonAsciiName { span: __binding_0, crate_name: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot load a crate with a non-ascii name `{$crate_name}`")));
;
diag.arg("crate_name", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
330#[diag("cannot load a crate with a non-ascii name `{$crate_name}`")]
331pub struct NonAsciiName {
332 #[primary_span]
333 pub span: Span,
334 pub crate_name: Symbol,
335}
336
337#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
ExternLocationNotExist<'a> where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExternLocationNotExist {
span: __binding_0,
crate_name: __binding_1,
location: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("extern location for {$crate_name} does not exist: {$location}")));
;
diag.arg("crate_name", __binding_1);
diag.arg("location", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
338#[diag("extern location for {$crate_name} does not exist: {$location}")]
339pub struct ExternLocationNotExist<'a> {
340 #[primary_span]
341 pub span: Span,
342 pub crate_name: Symbol,
343 pub location: &'a Path,
344}
345
346#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
ExternLocationNotFile<'a> where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExternLocationNotFile {
span: __binding_0,
crate_name: __binding_1,
location: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("extern location for {$crate_name} is not a file: {$location}")));
;
diag.arg("crate_name", __binding_1);
diag.arg("location", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
347#[diag("extern location for {$crate_name} is not a file: {$location}")]
348pub struct ExternLocationNotFile<'a> {
349 #[primary_span]
350 pub span: Span,
351 pub crate_name: Symbol,
352 pub location: &'a Path,
353}
354
355pub(crate) struct MultipleCandidates {
356 pub span: Span,
357 pub flavor: CrateFlavor,
358 pub crate_name: Symbol,
359 pub candidates: Vec<PathBuf>,
360}
361
362impl<G: EmissionGuarantee> Diagnostic<'_, G> for MultipleCandidates {
363 fn into_diag(self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> {
364 let mut diag = Diag::new(
365 dcx,
366 level,
367 rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("multiple candidates for `{$flavor}` dependency `{$crate_name}` found"))inline_fluent!("multiple candidates for `{$flavor}` dependency `{$crate_name}` found"),
368 );
369 diag.arg("crate_name", self.crate_name);
370 diag.arg("flavor", self.flavor);
371 diag.code(E0464);
372 diag.span(self.span);
373 for (i, candidate) in self.candidates.iter().enumerate() {
374 diag.note(::alloc::__export::must_use({
::alloc::fmt::format(format_args!("candidate #{0}: {1}", i + 1,
candidate.display()))
})format!("candidate #{}: {}", i + 1, candidate.display()));
375 }
376 diag
377 }
378}
379
380#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FullMetadataNotFound where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FullMetadataNotFound {
span: __binding_0,
flavor: __binding_1,
crate_name: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("only metadata stub found for `{$flavor}` dependency `{$crate_name}` please provide path to the corresponding .rmeta file with full metadata")));
;
diag.arg("flavor", __binding_1);
diag.arg("crate_name", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
381#[diag(
382 "only metadata stub found for `{$flavor}` dependency `{$crate_name}` please provide path to the corresponding .rmeta file with full metadata"
383)]
384pub(crate) struct FullMetadataNotFound {
385 #[primary_span]
386 pub span: Span,
387 pub flavor: CrateFlavor,
388 pub crate_name: Symbol,
389}
390
391#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
SymbolConflictsCurrent where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
SymbolConflictsCurrent {
span: __binding_0, crate_name: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the current crate is indistinguishable from one of its dependencies: it has the same crate-name `{$crate_name}` and was compiled with the same `-C metadata` arguments, so this will result in symbol conflicts between the two")));
diag.code(E0519);
;
diag.arg("crate_name", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
392#[diag("the current crate is indistinguishable from one of its dependencies: it has the same crate-name `{$crate_name}` and was compiled with the same `-C metadata` arguments, so this will result in symbol conflicts between the two", code = E0519)]
393pub struct SymbolConflictsCurrent {
394 #[primary_span]
395 pub span: Span,
396 pub crate_name: Symbol,
397}
398
399#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
StableCrateIdCollision where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
StableCrateIdCollision {
span: __binding_0,
crate_name0: __binding_1,
crate_name1: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("found crates (`{$crate_name0}` and `{$crate_name1}`) with colliding StableCrateId values")));
;
diag.arg("crate_name0", __binding_1);
diag.arg("crate_name1", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
400#[diag("found crates (`{$crate_name0}` and `{$crate_name1}`) with colliding StableCrateId values")]
401pub struct StableCrateIdCollision {
402 #[primary_span]
403 pub span: Span,
404 pub crate_name0: Symbol,
405 pub crate_name1: Symbol,
406}
407
408#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for DlError where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DlError {
span: __binding_0, path: __binding_1, err: __binding_2 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("{$path}{$err}")));
;
diag.arg("path", __binding_1);
diag.arg("err", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
409#[diag("{$path}{$err}")]
410pub struct DlError {
411 #[primary_span]
412 pub span: Span,
413 pub path: String,
414 pub err: String,
415}
416
417#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NewerCrateVersion where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NewerCrateVersion {
span: __binding_0,
crate_name: __binding_1,
add_info: __binding_2,
found_crates: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("found possibly newer version of crate `{$crate_name}`{$add_info}")));
diag.code(E0460);
diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("perhaps that crate needs to be recompiled?")));
diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the following crate versions were found:{$found_crates}")));
;
diag.arg("crate_name", __binding_1);
diag.arg("add_info", __binding_2);
diag.arg("found_crates", __binding_3);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
418#[diag("found possibly newer version of crate `{$crate_name}`{$add_info}", code = E0460)]
419#[note("perhaps that crate needs to be recompiled?")]
420#[note("the following crate versions were found:{$found_crates}")]
421pub struct NewerCrateVersion {
422 #[primary_span]
423 pub span: Span,
424 pub crate_name: Symbol,
425 pub add_info: String,
426 pub found_crates: String,
427}
428
429#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
NoCrateWithTriple<'a> where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NoCrateWithTriple {
span: __binding_0,
crate_name: __binding_1,
locator_triple: __binding_2,
add_info: __binding_3,
found_crates: __binding_4 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("couldn't find crate `{$crate_name}` with expected target triple {$locator_triple}{$add_info}")));
diag.code(E0461);
diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the following crate versions were found:{$found_crates}")));
;
diag.arg("crate_name", __binding_1);
diag.arg("locator_triple", __binding_2);
diag.arg("add_info", __binding_3);
diag.arg("found_crates", __binding_4);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
430#[diag("couldn't find crate `{$crate_name}` with expected target triple {$locator_triple}{$add_info}", code = E0461)]
431#[note("the following crate versions were found:{$found_crates}")]
432pub struct NoCrateWithTriple<'a> {
433 #[primary_span]
434 pub span: Span,
435 pub crate_name: Symbol,
436 pub locator_triple: &'a str,
437 pub add_info: String,
438 pub found_crates: String,
439}
440
441#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for FoundStaticlib
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FoundStaticlib {
span: __binding_0,
crate_name: __binding_1,
add_info: __binding_2,
found_crates: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("found staticlib `{$crate_name}` instead of rlib or dylib{$add_info}")));
diag.code(E0462);
diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the following crate versions were found:{$found_crates}")));
diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("please recompile that crate using --crate-type lib")));
;
diag.arg("crate_name", __binding_1);
diag.arg("add_info", __binding_2);
diag.arg("found_crates", __binding_3);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
442#[diag("found staticlib `{$crate_name}` instead of rlib or dylib{$add_info}", code = E0462)]
443#[note("the following crate versions were found:{$found_crates}")]
444#[help("please recompile that crate using --crate-type lib")]
445pub struct FoundStaticlib {
446 #[primary_span]
447 pub span: Span,
448 pub crate_name: Symbol,
449 pub add_info: String,
450 pub found_crates: String,
451}
452
453#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IncompatibleRustc where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IncompatibleRustc {
span: __binding_0,
crate_name: __binding_1,
add_info: __binding_2,
found_crates: __binding_3,
rustc_version: __binding_4 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("found crate `{$crate_name}` compiled by an incompatible version of rustc{$add_info}")));
diag.code(E0514);
diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the following crate versions were found:{$found_crates}")));
diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("please recompile that crate using this compiler ({$rustc_version}) (consider running `cargo clean` first)")));
;
diag.arg("crate_name", __binding_1);
diag.arg("add_info", __binding_2);
diag.arg("found_crates", __binding_3);
diag.arg("rustc_version", __binding_4);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
454#[diag("found crate `{$crate_name}` compiled by an incompatible version of rustc{$add_info}", code = E0514)]
455#[note("the following crate versions were found:{$found_crates}")]
456#[help(
457 "please recompile that crate using this compiler ({$rustc_version}) (consider running `cargo clean` first)"
458)]
459pub struct IncompatibleRustc {
460 #[primary_span]
461 pub span: Span,
462 pub crate_name: Symbol,
463 pub add_info: String,
464 pub found_crates: String,
465 pub rustc_version: String,
466}
467
468pub struct InvalidMetadataFiles {
469 pub span: Span,
470 pub crate_name: Symbol,
471 pub add_info: String,
472 pub crate_rejections: Vec<String>,
473}
474
475impl<G: EmissionGuarantee> Diagnostic<'_, G> for InvalidMetadataFiles {
476 #[track_caller]
477 fn into_diag(self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> {
478 let mut diag = Diag::new(
479 dcx,
480 level,
481 rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("found invalid metadata files for crate `{$crate_name}`{$add_info}"))inline_fluent!("found invalid metadata files for crate `{$crate_name}`{$add_info}"),
482 );
483 diag.arg("crate_name", self.crate_name);
484 diag.arg("add_info", self.add_info);
485 diag.code(E0786);
486 diag.span(self.span);
487 for crate_rejection in self.crate_rejections {
488 diag.note(crate_rejection);
489 }
490 diag
491 }
492}
493
494pub struct CannotFindCrate {
495 pub span: Span,
496 pub crate_name: Symbol,
497 pub add_info: String,
498 pub missing_core: bool,
499 pub current_crate: String,
500 pub is_nightly_build: bool,
501 pub profiler_runtime: Symbol,
502 pub locator_triple: TargetTuple,
503 pub is_ui_testing: bool,
504 pub is_tier_3: bool,
505}
506
507impl<G: EmissionGuarantee> Diagnostic<'_, G> for CannotFindCrate {
508 #[track_caller]
509 fn into_diag(self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> {
510 let mut diag = Diag::new(
511 dcx,
512 level,
513 rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("can't find crate for `{$crate_name}`{$add_info}"))inline_fluent!("can't find crate for `{$crate_name}`{$add_info}"),
514 );
515 diag.arg("crate_name", self.crate_name);
516 diag.arg("current_crate", self.current_crate);
517 diag.arg("add_info", self.add_info);
518 diag.arg("locator_triple", self.locator_triple.tuple());
519 diag.code(E0463);
520 diag.span(self.span);
521 if self.crate_name == sym::std || self.crate_name == sym::core {
522 if self.missing_core {
523 diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the `{$locator_triple}` target may not be installed"))inline_fluent!("the `{$locator_triple}` target may not be installed"));
524 } else {
525 diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the `{$locator_triple}` target may not support the standard library"))inline_fluent!(
526 "the `{$locator_triple}` target may not support the standard library"
527 ));
528 }
529
530 let has_precompiled_std = !self.is_tier_3;
531
532 if self.missing_core {
533 if "nightly"env!("CFG_RELEASE_CHANNEL") == "dev" && !self.is_ui_testing {
534 diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("consider adding the standard library to the sysroot with `x build library --target {$locator_triple}`"))inline_fluent!("consider adding the standard library to the sysroot with `x build library --target {$locator_triple}`"));
536 } else if has_precompiled_std {
537 diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("consider downloading the target with `rustup target add {$locator_triple}`"))inline_fluent!(
541 "consider downloading the target with `rustup target add {$locator_triple}`"
542 ));
543 }
544 }
545
546 if !self.missing_core && self.span.is_dummy() {
551 diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`std` is required by `{$current_crate}` because it does not declare `#![no_std]`"))inline_fluent!("`std` is required by `{$current_crate}` because it does not declare `#![no_std]`"));
552 }
553 if self.is_nightly_build || !has_precompiled_std {
556 diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("consider building the standard library from source with `cargo build -Zbuild-std`"))inline_fluent!("consider building the standard library from source with `cargo build -Zbuild-std`"));
557 }
558 } else if self.crate_name == self.profiler_runtime {
559 diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the compiler may have been built without the profiler runtime"))inline_fluent!(
560 "the compiler may have been built without the profiler runtime"
561 ));
562 } else if self.crate_name.as_str().starts_with("rustc_") {
563 diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`"))inline_fluent!("maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`"));
564 }
565 diag.span_label(self.span, rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("can't find crate"))inline_fluent!("can't find crate"));
566 diag
567 }
568}
569
570#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
CrateLocationUnknownType<'a> where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CrateLocationUnknownType {
span: __binding_0,
path: __binding_1,
crate_name: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("extern location for {$crate_name} is of an unknown type: {$path}")));
;
diag.arg("path", __binding_1);
diag.arg("crate_name", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
571#[diag("extern location for {$crate_name} is of an unknown type: {$path}")]
572pub struct CrateLocationUnknownType<'a> {
573 #[primary_span]
574 pub span: Span,
575 pub path: &'a Path,
576 pub crate_name: Symbol,
577}
578
579#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
LibFilenameForm<'a> where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LibFilenameForm {
span: __binding_0,
dll_prefix: __binding_1,
dll_suffix: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("file name should be lib*.rlib or {$dll_prefix}*{$dll_suffix}")));
;
diag.arg("dll_prefix", __binding_1);
diag.arg("dll_suffix", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
580#[diag("file name should be lib*.rlib or {$dll_prefix}*{$dll_suffix}")]
581pub struct LibFilenameForm<'a> {
582 #[primary_span]
583 pub span: Span,
584 pub dll_prefix: &'a str,
585 pub dll_suffix: &'a str,
586}
587
588#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for WasmCAbi where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
WasmCAbi { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("older versions of the `wasm-bindgen` crate are incompatible with current versions of Rust; please update to `wasm-bindgen` v0.2.88")));
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
589#[diag(
590 "older versions of the `wasm-bindgen` crate are incompatible with current versions of Rust; please update to `wasm-bindgen` v0.2.88"
591)]
592pub(crate) struct WasmCAbi {
593 #[primary_span]
594 pub span: Span,
595}
596
597#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IncompatibleTargetModifiers where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IncompatibleTargetModifiers {
span: __binding_0,
extern_crate: __binding_1,
local_crate: __binding_2,
flag_name: __binding_3,
flag_name_prefixed: __binding_4,
local_value: __binding_5,
extern_value: __binding_6 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("mixing `{$flag_name_prefixed}` will cause an ABI mismatch in crate `{$local_crate}`")));
diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the `{$flag_name_prefixed}` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely")));
diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$flag_name_prefixed}={$local_value}` in this crate is incompatible with `{$flag_name_prefixed}={$extern_value}` in dependency `{$extern_crate}`")));
diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("set `{$flag_name_prefixed}={$extern_value}` in this crate or `{$flag_name_prefixed}={$local_value}` in `{$extern_crate}`")));
diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch={$flag_name}` to silence this error")));
;
diag.arg("extern_crate", __binding_1);
diag.arg("local_crate", __binding_2);
diag.arg("flag_name", __binding_3);
diag.arg("flag_name_prefixed", __binding_4);
diag.arg("local_value", __binding_5);
diag.arg("extern_value", __binding_6);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
598#[diag("mixing `{$flag_name_prefixed}` will cause an ABI mismatch in crate `{$local_crate}`")]
599#[help(
600 "the `{$flag_name_prefixed}` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely"
601)]
602#[note(
603 "`{$flag_name_prefixed}={$local_value}` in this crate is incompatible with `{$flag_name_prefixed}={$extern_value}` in dependency `{$extern_crate}`"
604)]
605#[help(
606 "set `{$flag_name_prefixed}={$extern_value}` in this crate or `{$flag_name_prefixed}={$local_value}` in `{$extern_crate}`"
607)]
608#[help(
609 "if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch={$flag_name}` to silence this error"
610)]
611pub struct IncompatibleTargetModifiers {
612 #[primary_span]
613 pub span: Span,
614 pub extern_crate: Symbol,
615 pub local_crate: Symbol,
616 pub flag_name: String,
617 pub flag_name_prefixed: String,
618 pub local_value: String,
619 pub extern_value: String,
620}
621
622#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IncompatibleTargetModifiersLMissed where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IncompatibleTargetModifiersLMissed {
span: __binding_0,
extern_crate: __binding_1,
local_crate: __binding_2,
flag_name: __binding_3,
flag_name_prefixed: __binding_4,
extern_value: __binding_5 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("mixing `{$flag_name_prefixed}` will cause an ABI mismatch in crate `{$local_crate}`")));
diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the `{$flag_name_prefixed}` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely")));
diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("unset `{$flag_name_prefixed}` in this crate is incompatible with `{$flag_name_prefixed}={$extern_value}` in dependency `{$extern_crate}`")));
diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("set `{$flag_name_prefixed}={$extern_value}` in this crate or unset `{$flag_name_prefixed}` in `{$extern_crate}`")));
diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch={$flag_name}` to silence this error")));
;
diag.arg("extern_crate", __binding_1);
diag.arg("local_crate", __binding_2);
diag.arg("flag_name", __binding_3);
diag.arg("flag_name_prefixed", __binding_4);
diag.arg("extern_value", __binding_5);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
623#[diag("mixing `{$flag_name_prefixed}` will cause an ABI mismatch in crate `{$local_crate}`")]
624#[help(
625 "the `{$flag_name_prefixed}` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely"
626)]
627#[note(
628 "unset `{$flag_name_prefixed}` in this crate is incompatible with `{$flag_name_prefixed}={$extern_value}` in dependency `{$extern_crate}`"
629)]
630#[help(
631 "set `{$flag_name_prefixed}={$extern_value}` in this crate or unset `{$flag_name_prefixed}` in `{$extern_crate}`"
632)]
633#[help(
634 "if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch={$flag_name}` to silence this error"
635)]
636pub struct IncompatibleTargetModifiersLMissed {
637 #[primary_span]
638 pub span: Span,
639 pub extern_crate: Symbol,
640 pub local_crate: Symbol,
641 pub flag_name: String,
642 pub flag_name_prefixed: String,
643 pub extern_value: String,
644}
645
646#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IncompatibleTargetModifiersRMissed where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IncompatibleTargetModifiersRMissed {
span: __binding_0,
extern_crate: __binding_1,
local_crate: __binding_2,
flag_name: __binding_3,
flag_name_prefixed: __binding_4,
local_value: __binding_5 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("mixing `{$flag_name_prefixed}` will cause an ABI mismatch in crate `{$local_crate}`")));
diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the `{$flag_name_prefixed}` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely")));
diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$flag_name_prefixed}={$local_value}` in this crate is incompatible with unset `{$flag_name_prefixed}` in dependency `{$extern_crate}`")));
diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("unset `{$flag_name_prefixed}` in this crate or set `{$flag_name_prefixed}={$local_value}` in `{$extern_crate}`")));
diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch={$flag_name}` to silence this error")));
;
diag.arg("extern_crate", __binding_1);
diag.arg("local_crate", __binding_2);
diag.arg("flag_name", __binding_3);
diag.arg("flag_name_prefixed", __binding_4);
diag.arg("local_value", __binding_5);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
647#[diag("mixing `{$flag_name_prefixed}` will cause an ABI mismatch in crate `{$local_crate}`")]
648#[help(
649 "the `{$flag_name_prefixed}` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely"
650)]
651#[note(
652 "`{$flag_name_prefixed}={$local_value}` in this crate is incompatible with unset `{$flag_name_prefixed}` in dependency `{$extern_crate}`"
653)]
654#[help(
655 "unset `{$flag_name_prefixed}` in this crate or set `{$flag_name_prefixed}={$local_value}` in `{$extern_crate}`"
656)]
657#[help(
658 "if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch={$flag_name}` to silence this error"
659)]
660pub struct IncompatibleTargetModifiersRMissed {
661 #[primary_span]
662 pub span: Span,
663 pub extern_crate: Symbol,
664 pub local_crate: Symbol,
665 pub flag_name: String,
666 pub flag_name_prefixed: String,
667 pub local_value: String,
668}
669
670#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnknownTargetModifierUnsafeAllowed where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnknownTargetModifierUnsafeAllowed {
span: __binding_0, flag_name: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("unknown target modifier `{$flag_name}`, requested by `-Cunsafe-allow-abi-mismatch={$flag_name}`")));
;
diag.arg("flag_name", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
671#[diag(
672 "unknown target modifier `{$flag_name}`, requested by `-Cunsafe-allow-abi-mismatch={$flag_name}`"
673)]
674pub struct UnknownTargetModifierUnsafeAllowed {
675 #[primary_span]
676 pub span: Span,
677 pub flag_name: String,
678}
679
680#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AsyncDropTypesInDependency where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsyncDropTypesInDependency {
span: __binding_0,
extern_crate: __binding_1,
local_crate: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("found async drop types in dependency `{$extern_crate}`, but async_drop feature is disabled for `{$local_crate}`")));
diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("if async drop type will be dropped in a crate without `feature(async_drop)`, sync Drop will be used")));
;
diag.arg("extern_crate", __binding_1);
diag.arg("local_crate", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
681#[diag(
682 "found async drop types in dependency `{$extern_crate}`, but async_drop feature is disabled for `{$local_crate}`"
683)]
684#[help(
685 "if async drop type will be dropped in a crate without `feature(async_drop)`, sync Drop will be used"
686)]
687pub struct AsyncDropTypesInDependency {
688 #[primary_span]
689 pub span: Span,
690 pub extern_crate: Symbol,
691 pub local_crate: Symbol,
692}
693
694#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RawDylibMalformed where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RawDylibMalformed { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("link name must be well-formed if link kind is `raw-dylib`")));
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
695#[diag("link name must be well-formed if link kind is `raw-dylib`")]
696pub struct RawDylibMalformed {
697 #[primary_span]
698 pub span: Span,
699}