1 //! Errors emitted by codegen_ssa
3 use crate::back::command::Command;
5 fluent, DiagnosticArgValue, DiagnosticBuilder, ErrorGuaranteed, Handler, IntoDiagnostic,
8 use rustc_macros::Diagnostic;
9 use rustc_middle::ty::Ty;
10 use rustc_span::{Span, Symbol};
11 use rustc_type_ir::FloatTy;
14 use std::path::{Path, PathBuf};
15 use std::process::ExitStatus;
18 #[diag(codegen_ssa_lib_def_write_failure)]
19 pub struct LibDefWriteFailure {
24 #[diag(codegen_ssa_version_script_write_failure)]
25 pub struct VersionScriptWriteFailure {
30 #[diag(codegen_ssa_symbol_file_write_failure)]
31 pub struct SymbolFileWriteFailure {
36 #[diag(codegen_ssa_ld64_unimplemented_modifier)]
37 pub struct Ld64UnimplementedModifier;
40 #[diag(codegen_ssa_linker_unsupported_modifier)]
41 pub struct LinkerUnsupportedModifier;
44 #[diag(codegen_ssa_L4Bender_exporting_symbols_unimplemented)]
45 pub struct L4BenderExportingSymbolsUnimplemented;
48 #[diag(codegen_ssa_no_natvis_directory)]
49 pub struct NoNatvisDirectory {
54 #[diag(codegen_ssa_copy_path_buf)]
55 pub struct CopyPathBuf {
56 pub source_file: PathBuf,
57 pub output_path: PathBuf,
61 // Reports Paths using `Debug` implementation rather than Path's `Display` implementation.
63 #[diag(codegen_ssa_copy_path)]
64 pub struct CopyPath<'a> {
65 from: DebugArgPath<'a>,
70 impl<'a> CopyPath<'a> {
71 pub fn new(from: &'a Path, to: &'a Path, error: Error) -> CopyPath<'a> {
72 CopyPath { from: DebugArgPath(from), to: DebugArgPath(to), error }
76 struct DebugArgPath<'a>(pub &'a Path);
78 impl IntoDiagnosticArg for DebugArgPath<'_> {
79 fn into_diagnostic_arg(self) -> rustc_errors::DiagnosticArgValue<'static> {
80 DiagnosticArgValue::Str(Cow::Owned(format!("{:?}", self.0)))
85 #[diag(codegen_ssa_ignoring_emit_path)]
86 pub struct IgnoringEmitPath {
87 pub extension: String,
91 #[diag(codegen_ssa_ignoring_output)]
92 pub struct IgnoringOutput {
93 pub extension: String,
97 #[diag(codegen_ssa_create_temp_dir)]
98 pub struct CreateTempDir {
102 #[derive(Diagnostic)]
103 #[diag(codegen_ssa_incompatible_linking_modifiers)]
104 pub struct IncompatibleLinkingModifiers;
106 #[derive(Diagnostic)]
107 #[diag(codegen_ssa_add_native_library)]
108 pub struct AddNativeLibrary {
109 pub library_path: PathBuf,
113 #[derive(Diagnostic)]
114 #[diag(codegen_ssa_multiple_external_func_decl)]
115 pub struct MultipleExternalFuncDecl<'a> {
118 pub function: Symbol,
119 pub library_name: &'a str,
122 #[derive(Diagnostic)]
123 pub enum LinkRlibError {
124 #[diag(codegen_ssa_rlib_missing_format)]
127 #[diag(codegen_ssa_rlib_only_rmeta_found)]
128 OnlyRmetaFound { crate_name: Symbol },
130 #[diag(codegen_ssa_rlib_not_found)]
131 NotFound { crate_name: Symbol },
133 #[diag(codegen_ssa_rlib_incompatible_dependency_formats)]
134 IncompatibleDependencyFormats { ty1: String, ty2: String, list1: String, list2: String },
137 pub struct ThorinErrorWrapper(pub thorin::Error);
139 impl IntoDiagnostic<'_> for ThorinErrorWrapper {
140 fn into_diagnostic(self, handler: &Handler) -> DiagnosticBuilder<'_, ErrorGuaranteed> {
143 thorin::Error::ReadInput(_) => {
144 diag = handler.struct_err(fluent::codegen_ssa_thorin_read_input_failure);
147 thorin::Error::ParseFileKind(_) => {
148 diag = handler.struct_err(fluent::codegen_ssa_thorin_parse_input_file_kind);
151 thorin::Error::ParseObjectFile(_) => {
152 diag = handler.struct_err(fluent::codegen_ssa_thorin_parse_input_object_file);
155 thorin::Error::ParseArchiveFile(_) => {
156 diag = handler.struct_err(fluent::codegen_ssa_thorin_parse_input_archive_file);
159 thorin::Error::ParseArchiveMember(_) => {
160 diag = handler.struct_err(fluent::codegen_ssa_thorin_parse_archive_member);
163 thorin::Error::InvalidInputKind => {
164 diag = handler.struct_err(fluent::codegen_ssa_thorin_invalid_input_kind);
167 thorin::Error::DecompressData(_) => {
168 diag = handler.struct_err(fluent::codegen_ssa_thorin_decompress_data);
171 thorin::Error::NamelessSection(_, offset) => {
172 diag = handler.struct_err(fluent::codegen_ssa_thorin_section_without_name);
173 diag.set_arg("offset", format!("0x{:08x}", offset));
176 thorin::Error::RelocationWithInvalidSymbol(section, offset) => {
178 handler.struct_err(fluent::codegen_ssa_thorin_relocation_with_invalid_symbol);
179 diag.set_arg("section", section);
180 diag.set_arg("offset", format!("0x{:08x}", offset));
183 thorin::Error::MultipleRelocations(section, offset) => {
184 diag = handler.struct_err(fluent::codegen_ssa_thorin_multiple_relocations);
185 diag.set_arg("section", section);
186 diag.set_arg("offset", format!("0x{:08x}", offset));
189 thorin::Error::UnsupportedRelocation(section, offset) => {
190 diag = handler.struct_err(fluent::codegen_ssa_thorin_unsupported_relocation);
191 diag.set_arg("section", section);
192 diag.set_arg("offset", format!("0x{:08x}", offset));
195 thorin::Error::MissingDwoName(id) => {
196 diag = handler.struct_err(fluent::codegen_ssa_thorin_missing_dwo_name);
197 diag.set_arg("id", format!("0x{:08x}", id));
200 thorin::Error::NoCompilationUnits => {
201 diag = handler.struct_err(fluent::codegen_ssa_thorin_no_compilation_units);
204 thorin::Error::NoDie => {
205 diag = handler.struct_err(fluent::codegen_ssa_thorin_no_die);
208 thorin::Error::TopLevelDieNotUnit => {
209 diag = handler.struct_err(fluent::codegen_ssa_thorin_top_level_die_not_unit);
212 thorin::Error::MissingRequiredSection(section) => {
213 diag = handler.struct_err(fluent::codegen_ssa_thorin_missing_required_section);
214 diag.set_arg("section", section);
217 thorin::Error::ParseUnitAbbreviations(_) => {
218 diag = handler.struct_err(fluent::codegen_ssa_thorin_parse_unit_abbreviations);
221 thorin::Error::ParseUnitAttribute(_) => {
222 diag = handler.struct_err(fluent::codegen_ssa_thorin_parse_unit_attribute);
225 thorin::Error::ParseUnitHeader(_) => {
226 diag = handler.struct_err(fluent::codegen_ssa_thorin_parse_unit_header);
229 thorin::Error::ParseUnit(_) => {
230 diag = handler.struct_err(fluent::codegen_ssa_thorin_parse_unit);
233 thorin::Error::IncompatibleIndexVersion(section, format, actual) => {
234 diag = handler.struct_err(fluent::codegen_ssa_thorin_incompatible_index_version);
235 diag.set_arg("section", section);
236 diag.set_arg("actual", actual);
237 diag.set_arg("format", format);
240 thorin::Error::OffsetAtIndex(_, index) => {
241 diag = handler.struct_err(fluent::codegen_ssa_thorin_offset_at_index);
242 diag.set_arg("index", index);
245 thorin::Error::StrAtOffset(_, offset) => {
246 diag = handler.struct_err(fluent::codegen_ssa_thorin_str_at_offset);
247 diag.set_arg("offset", format!("0x{:08x}", offset));
250 thorin::Error::ParseIndex(_, section) => {
251 diag = handler.struct_err(fluent::codegen_ssa_thorin_parse_index);
252 diag.set_arg("section", section);
255 thorin::Error::UnitNotInIndex(unit) => {
256 diag = handler.struct_err(fluent::codegen_ssa_thorin_unit_not_in_index);
257 diag.set_arg("unit", format!("0x{:08x}", unit));
260 thorin::Error::RowNotInIndex(_, row) => {
261 diag = handler.struct_err(fluent::codegen_ssa_thorin_row_not_in_index);
262 diag.set_arg("row", row);
265 thorin::Error::SectionNotInRow => {
266 diag = handler.struct_err(fluent::codegen_ssa_thorin_section_not_in_row);
269 thorin::Error::EmptyUnit(unit) => {
270 diag = handler.struct_err(fluent::codegen_ssa_thorin_empty_unit);
271 diag.set_arg("unit", format!("0x{:08x}", unit));
274 thorin::Error::MultipleDebugInfoSection => {
275 diag = handler.struct_err(fluent::codegen_ssa_thorin_multiple_debug_info_section);
278 thorin::Error::MultipleDebugTypesSection => {
279 diag = handler.struct_err(fluent::codegen_ssa_thorin_multiple_debug_types_section);
282 thorin::Error::NotSplitUnit => {
283 diag = handler.struct_err(fluent::codegen_ssa_thorin_not_split_unit);
286 thorin::Error::DuplicateUnit(unit) => {
287 diag = handler.struct_err(fluent::codegen_ssa_thorin_duplicate_unit);
288 diag.set_arg("unit", format!("0x{:08x}", unit));
291 thorin::Error::MissingReferencedUnit(unit) => {
292 diag = handler.struct_err(fluent::codegen_ssa_thorin_missing_referenced_unit);
293 diag.set_arg("unit", format!("0x{:08x}", unit));
296 thorin::Error::NoOutputObjectCreated => {
297 diag = handler.struct_err(fluent::codegen_ssa_thorin_not_output_object_created);
300 thorin::Error::MixedInputEncodings => {
301 diag = handler.struct_err(fluent::codegen_ssa_thorin_mixed_input_encodings);
304 thorin::Error::Io(e) => {
305 diag = handler.struct_err(fluent::codegen_ssa_thorin_io);
306 diag.set_arg("error", format!("{e}"));
309 thorin::Error::ObjectRead(e) => {
310 diag = handler.struct_err(fluent::codegen_ssa_thorin_object_read);
311 diag.set_arg("error", format!("{e}"));
314 thorin::Error::ObjectWrite(e) => {
315 diag = handler.struct_err(fluent::codegen_ssa_thorin_object_write);
316 diag.set_arg("error", format!("{e}"));
319 thorin::Error::GimliRead(e) => {
320 diag = handler.struct_err(fluent::codegen_ssa_thorin_gimli_read);
321 diag.set_arg("error", format!("{e}"));
324 thorin::Error::GimliWrite(e) => {
325 diag = handler.struct_err(fluent::codegen_ssa_thorin_gimli_write);
326 diag.set_arg("error", format!("{e}"));
329 _ => unimplemented!("Untranslated thorin error"),
334 pub struct LinkingFailed<'a> {
335 pub linker_path: &'a PathBuf,
336 pub exit_status: ExitStatus,
337 pub command: &'a Command,
338 pub escaped_output: &'a str,
341 impl IntoDiagnostic<'_> for LinkingFailed<'_> {
342 fn into_diagnostic(self, handler: &Handler) -> DiagnosticBuilder<'_, ErrorGuaranteed> {
343 let mut diag = handler.struct_err(fluent::codegen_ssa_linking_failed);
344 diag.set_arg("linker_path", format!("{}", self.linker_path.display()));
345 diag.set_arg("exit_status", format!("{}", self.exit_status));
347 diag.note(format!("{:?}", self.command)).note(self.escaped_output);
349 // Trying to match an error from OS linkers
350 // which by now we have no way to translate.
351 if self.escaped_output.contains("undefined reference to") {
352 diag.note(fluent::codegen_ssa_extern_funcs_not_found)
353 .note(fluent::codegen_ssa_specify_libraries_to_link)
354 .note(fluent::codegen_ssa_use_cargo_directive);
360 #[derive(Diagnostic)]
361 #[diag(codegen_ssa_link_exe_unexpected_error)]
362 pub struct LinkExeUnexpectedError;
364 #[derive(Diagnostic)]
365 #[diag(codegen_ssa_repair_vs_build_tools)]
366 pub struct RepairVSBuildTools;
368 #[derive(Diagnostic)]
369 #[diag(codegen_ssa_missing_cpp_build_tool_component)]
370 pub struct MissingCppBuildToolComponent;
372 #[derive(Diagnostic)]
373 #[diag(codegen_ssa_select_cpp_build_tool_workload)]
374 pub struct SelectCppBuildToolWorkload;
376 #[derive(Diagnostic)]
377 #[diag(codegen_ssa_visual_studio_not_installed)]
378 pub struct VisualStudioNotInstalled;
380 #[derive(Diagnostic)]
381 #[diag(codegen_ssa_linker_not_found)]
383 pub struct LinkerNotFound {
384 pub linker_path: PathBuf,
388 #[derive(Diagnostic)]
389 #[diag(codegen_ssa_unable_to_exe_linker)]
391 #[note(command_note)]
392 pub struct UnableToExeLinker {
393 pub linker_path: PathBuf,
395 pub command_formatted: String,
398 #[derive(Diagnostic)]
399 #[diag(codegen_ssa_msvc_missing_linker)]
400 pub struct MsvcMissingLinker;
402 #[derive(Diagnostic)]
403 #[diag(codegen_ssa_check_installed_visual_studio)]
404 pub struct CheckInstalledVisualStudio;
406 #[derive(Diagnostic)]
407 #[diag(codegen_ssa_unsufficient_vs_code_product)]
408 pub struct UnsufficientVSCodeProduct;
410 #[derive(Diagnostic)]
411 #[diag(codegen_ssa_processing_dymutil_failed)]
413 pub struct ProcessingDymutilFailed {
414 pub status: ExitStatus,
418 #[derive(Diagnostic)]
419 #[diag(codegen_ssa_unable_to_run_dsymutil)]
421 pub struct UnableToRunDsymutil {
425 #[derive(Diagnostic)]
426 #[diag(codegen_ssa_stripping_debu_info_failed)]
428 pub struct StrippingDebugInfoFailed<'a> {
430 pub status: ExitStatus,
434 #[derive(Diagnostic)]
435 #[diag(codegen_ssa_unable_to_run)]
436 pub struct UnableToRun<'a> {
441 #[derive(Diagnostic)]
442 #[diag(codegen_ssa_linker_file_stem)]
443 pub struct LinkerFileStem;
445 #[derive(Diagnostic)]
446 #[diag(codegen_ssa_static_library_native_artifacts)]
447 pub struct StaticLibraryNativeArtifacts;
449 #[derive(Diagnostic)]
450 #[diag(codegen_ssa_link_script_unavailable)]
451 pub struct LinkScriptUnavailable;
453 #[derive(Diagnostic)]
454 #[diag(codegen_ssa_link_script_write_failure)]
455 pub struct LinkScriptWriteFailure {
460 #[derive(Diagnostic)]
461 #[diag(codegen_ssa_failed_to_write)]
462 pub struct FailedToWrite {
467 #[derive(Diagnostic)]
468 #[diag(codegen_ssa_unable_to_write_debugger_visualizer)]
469 pub struct UnableToWriteDebuggerVisualizer {
474 #[derive(Diagnostic)]
475 #[diag(codegen_ssa_rlib_archive_build_failure)]
476 pub struct RlibArchiveBuildFailure {
480 #[derive(Diagnostic)]
481 #[diag(codegen_ssa_option_gcc_only)]
482 pub struct OptionGccOnly;
484 #[derive(Diagnostic)]
485 pub enum ExtractBundledLibsError<'a> {
486 #[diag(codegen_ssa_extract_bundled_libs_open_file)]
487 OpenFile { rlib: &'a Path, error: Box<dyn std::error::Error> },
489 #[diag(codegen_ssa_extract_bundled_libs_mmap_file)]
490 MmapFile { rlib: &'a Path, error: Box<dyn std::error::Error> },
492 #[diag(codegen_ssa_extract_bundled_libs_parse_archive)]
493 ParseArchive { rlib: &'a Path, error: Box<dyn std::error::Error> },
495 #[diag(codegen_ssa_extract_bundled_libs_read_entry)]
496 ReadEntry { rlib: &'a Path, error: Box<dyn std::error::Error> },
498 #[diag(codegen_ssa_extract_bundled_libs_archive_member)]
499 ArchiveMember { rlib: &'a Path, error: Box<dyn std::error::Error> },
501 #[diag(codegen_ssa_extract_bundled_libs_convert_name)]
502 ConvertName { rlib: &'a Path, error: Box<dyn std::error::Error> },
504 #[diag(codegen_ssa_extract_bundled_libs_write_file)]
505 WriteFile { rlib: &'a Path, error: Box<dyn std::error::Error> },
507 #[diag(codegen_ssa_extract_bundled_libs_write_file)]
508 ExtractSection { rlib: &'a Path, error: Box<dyn std::error::Error> },
511 #[derive(Diagnostic)]
512 #[diag(codegen_ssa_unsupported_arch)]
513 pub struct UnsupportedArch<'a> {
518 #[derive(Diagnostic)]
519 pub enum AppleSdkRootError<'a> {
520 #[diag(codegen_ssa_apple_sdk_error_sdk_path)]
521 SdkPath { sdk_name: &'a str, error: Error },
524 #[derive(Diagnostic)]
525 #[diag(codegen_ssa_read_file)]
526 pub struct ReadFileError {
527 pub message: std::io::Error,
530 #[derive(Diagnostic)]
531 #[diag(codegen_ssa_unsupported_link_self_contained)]
532 pub struct UnsupportedLinkSelfContained;
534 #[derive(Diagnostic)]
535 #[diag(codegen_ssa_archive_build_failure)]
536 // Public for rustc_codegen_llvm::back::archive
537 pub struct ArchiveBuildFailure {
538 pub error: std::io::Error,
541 #[derive(Diagnostic)]
542 #[diag(codegen_ssa_unknown_archive_kind)]
543 // Public for rustc_codegen_llvm::back::archive
544 pub struct UnknownArchiveKind<'a> {
548 #[derive(Diagnostic)]
549 #[diag(codegen_ssa_expected_used_symbol)]
550 pub struct ExpectedUsedSymbol {
555 #[derive(Diagnostic)]
556 #[diag(codegen_ssa_multiple_main_functions)]
558 pub struct MultipleMainFunctions {
563 #[derive(Diagnostic)]
564 #[diag(codegen_ssa_metadata_object_file_write)]
565 pub struct MetadataObjectFileWrite {
569 #[derive(Diagnostic)]
570 #[diag(codegen_ssa_invalid_windows_subsystem)]
571 pub struct InvalidWindowsSubsystem {
572 pub subsystem: Symbol,
575 #[derive(Diagnostic)]
576 #[diag(codegen_ssa_erroneous_constant)]
577 pub struct ErroneousConstant {
582 #[derive(Diagnostic)]
583 #[diag(codegen_ssa_polymorphic_constant_too_generic)]
584 pub struct PolymorphicConstantTooGeneric {
589 #[derive(Diagnostic)]
590 #[diag(codegen_ssa_shuffle_indices_evaluation)]
591 pub struct ShuffleIndicesEvaluation {
596 #[derive(Diagnostic)]
597 #[diag(codegen_ssa_missing_memory_ordering)]
598 pub struct MissingMemoryOrdering;
600 #[derive(Diagnostic)]
601 #[diag(codegen_ssa_unknown_atomic_ordering)]
602 pub struct UnknownAtomicOrdering;
604 #[derive(Diagnostic)]
605 #[diag(codegen_ssa_atomic_compare_exchange)]
606 pub struct AtomicCompareExchange;
608 #[derive(Diagnostic)]
609 #[diag(codegen_ssa_unknown_atomic_operation)]
610 pub struct UnknownAtomicOperation;
612 #[derive(Diagnostic)]
613 pub enum InvalidMonomorphization<'tcx> {
614 #[diag(codegen_ssa_invalid_monomorphization_basic_integer_type, code = "E0511")]
622 #[diag(codegen_ssa_invalid_monomorphization_basic_float_type, code = "E0511")]
630 #[diag(codegen_ssa_invalid_monomorphization_float_to_int_unchecked, code = "E0511")]
631 FloatToIntUnchecked {
637 #[diag(codegen_ssa_invalid_monomorphization_floating_point_vector, code = "E0511")]
638 FloatingPointVector {
646 #[diag(codegen_ssa_invalid_monomorphization_floating_point_type, code = "E0511")]
654 #[diag(codegen_ssa_invalid_monomorphization_unrecognized_intrinsic, code = "E0511")]
655 UnrecognizedIntrinsic {
661 #[diag(codegen_ssa_invalid_monomorphization_simd_argument, code = "E0511")]
669 #[diag(codegen_ssa_invalid_monomorphization_simd_input, code = "E0511")]
677 #[diag(codegen_ssa_invalid_monomorphization_simd_first, code = "E0511")]
685 #[diag(codegen_ssa_invalid_monomorphization_simd_second, code = "E0511")]
693 #[diag(codegen_ssa_invalid_monomorphization_simd_third, code = "E0511")]
701 #[diag(codegen_ssa_invalid_monomorphization_simd_return, code = "E0511")]
709 #[diag(codegen_ssa_invalid_monomorphization_invalid_bitmask, code = "E0511")]
715 expected_int_bits: u64,
719 #[diag(codegen_ssa_invalid_monomorphization_return_length_input_type, code = "E0511")]
720 ReturnLengthInputType {
730 #[diag(codegen_ssa_invalid_monomorphization_second_argument_length, code = "E0511")]
731 SecondArgumentLength {
741 #[diag(codegen_ssa_invalid_monomorphization_third_argument_length, code = "E0511")]
742 ThirdArgumentLength {
752 #[diag(codegen_ssa_invalid_monomorphization_return_integer_type, code = "E0511")]
761 #[diag(codegen_ssa_invalid_monomorphization_simd_shuffle, code = "E0511")]
769 #[diag(codegen_ssa_invalid_monomorphization_return_length, code = "E0511")]
779 #[diag(codegen_ssa_invalid_monomorphization_return_element, code = "E0511")]
790 #[diag(codegen_ssa_invalid_monomorphization_shuffle_index_not_constant, code = "E0511")]
791 ShuffleIndexNotConstant {
798 #[diag(codegen_ssa_invalid_monomorphization_shuffle_index_out_of_bounds, code = "E0511")]
799 ShuffleIndexOutOfBounds {
807 #[diag(codegen_ssa_invalid_monomorphization_inserted_type, code = "E0511")]
817 #[diag(codegen_ssa_invalid_monomorphization_return_type, code = "E0511")]
827 #[diag(codegen_ssa_invalid_monomorphization_expected_return_type, code = "E0511")]
836 #[diag(codegen_ssa_invalid_monomorphization_mismatched_lengths, code = "E0511")]
845 #[diag(codegen_ssa_invalid_monomorphization_mask_type, code = "E0511")]
853 #[diag(codegen_ssa_invalid_monomorphization_vector_argument, code = "E0511")]
862 #[diag(codegen_ssa_invalid_monomorphization_cannot_return, code = "E0511")]
868 expected_int_bits: u64,
872 #[diag(codegen_ssa_invalid_monomorphization_expected_element_type, code = "E0511")]
873 ExpectedElementType {
877 expected_element: Ty<'tcx>,
878 second_arg: Ty<'tcx>,
881 mutability: ExpectedPointerMutability,
884 #[diag(codegen_ssa_invalid_monomorphization_third_arg_element_type, code = "E0511")]
885 ThirdArgElementType {
889 expected_element: Ty<'tcx>,
893 #[diag(codegen_ssa_invalid_monomorphization_unsupported_symbol_of_size, code = "E0511")]
894 UnsupportedSymbolOfSize {
905 #[diag(codegen_ssa_invalid_monomorphization_unsupported_symbol, code = "E0511")]
916 #[diag(codegen_ssa_invalid_monomorphization_cast_fat_pointer, code = "E0511")]
924 #[diag(codegen_ssa_invalid_monomorphization_expected_pointer, code = "E0511")]
932 #[diag(codegen_ssa_invalid_monomorphization_expected_usize, code = "E0511")]
940 #[diag(codegen_ssa_invalid_monomorphization_unsupported_cast, code = "E0511")]
951 #[diag(codegen_ssa_invalid_monomorphization_unsupported_operation, code = "E0511")]
952 UnsupportedOperation {
960 #[diag(codegen_ssa_invalid_monomorphization_expected_vector_element_type, code = "E0511")]
961 ExpectedVectorElementType {
965 expected_element: Ty<'tcx>,
966 vector_type: Ty<'tcx>,
970 pub enum ExpectedPointerMutability {
975 impl IntoDiagnosticArg for ExpectedPointerMutability {
976 fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
978 ExpectedPointerMutability::Mut => DiagnosticArgValue::Str(Cow::Borrowed("*mut")),
979 ExpectedPointerMutability::Not => DiagnosticArgValue::Str(Cow::Borrowed("*_")),