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