2022-10-20 17:51:37 +02:00
|
|
|
//! Errors emitted by `rustc_hir_analysis`.
|
2022-09-28 10:21:33 +01:00
|
|
|
|
2022-10-13 10:13:02 +01:00
|
|
|
use crate::fluent_generated as fluent;
|
|
|
|
use rustc_errors::{
|
|
|
|
error_code, Applicability, DiagnosticBuilder, ErrorGuaranteed, Handler, IntoDiagnostic,
|
|
|
|
MultiSpan,
|
|
|
|
};
|
2022-10-20 17:51:37 +02:00
|
|
|
use rustc_macros::{Diagnostic, LintDiagnostic};
|
2022-04-07 22:46:53 +04:00
|
|
|
use rustc_middle::ty::Ty;
|
2022-09-05 17:26:57 -04:00
|
|
|
use rustc_span::{symbol::Ident, Span, Symbol};
|
2020-08-27 20:09:22 +10:00
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_unrecognized_atomic_operation, code = "E0092")]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub struct UnrecognizedAtomicOperation<'a> {
|
2022-03-31 08:50:45 +01:00
|
|
|
#[primary_span]
|
2022-03-31 10:24:46 +01:00
|
|
|
#[label]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub span: Span,
|
|
|
|
pub op: &'a str,
|
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_wrong_number_of_generic_arguments_to_intrinsic, code = "E0094")]
|
2021-07-01 13:52:44 +02:00
|
|
|
pub struct WrongNumberOfGenericArgumentsToIntrinsic<'a> {
|
2022-03-31 08:50:45 +01:00
|
|
|
#[primary_span]
|
2022-03-31 10:24:46 +01:00
|
|
|
#[label]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub span: Span,
|
|
|
|
pub found: usize,
|
|
|
|
pub expected: usize,
|
2021-06-08 20:38:43 +02:00
|
|
|
pub descr: &'a str,
|
2020-08-27 20:09:22 +10:00
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_unrecognized_intrinsic_function, code = "E0093")]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub struct UnrecognizedIntrinsicFunction {
|
2022-03-31 08:50:45 +01:00
|
|
|
#[primary_span]
|
2022-03-31 10:24:46 +01:00
|
|
|
#[label]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub span: Span,
|
|
|
|
pub name: Symbol,
|
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_lifetimes_or_bounds_mismatch_on_trait, code = "E0195")]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub struct LifetimesOrBoundsMismatchOnTrait {
|
2022-03-31 08:50:45 +01:00
|
|
|
#[primary_span]
|
2022-03-31 10:24:46 +01:00
|
|
|
#[label]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub span: Span,
|
2022-10-13 10:13:02 +01:00
|
|
|
#[label(hir_analysis_generics_label)]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub generics_span: Option<Span>,
|
2022-10-13 10:13:02 +01:00
|
|
|
#[label(hir_analysis_where_label)]
|
2022-11-28 00:03:57 -08:00
|
|
|
pub where_span: Option<Span>,
|
2022-10-13 10:13:02 +01:00
|
|
|
#[label(hir_analysis_bounds_label)]
|
2022-11-28 00:03:57 -08:00
|
|
|
pub bounds_span: Vec<Span>,
|
2020-08-27 20:09:22 +10:00
|
|
|
pub item_kind: &'static str,
|
|
|
|
pub ident: Ident,
|
|
|
|
}
|
|
|
|
|
2022-11-02 17:45:08 -07:00
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(hir_analysis_async_trait_impl_should_be_async)]
|
|
|
|
pub struct AsyncTraitImplShouldBeAsync {
|
|
|
|
#[primary_span]
|
|
|
|
// #[label]
|
|
|
|
pub span: Span,
|
2022-10-13 10:13:02 +01:00
|
|
|
#[label(hir_analysis_trait_item_label)]
|
2022-11-02 17:45:08 -07:00
|
|
|
pub trait_item_span: Option<Span>,
|
|
|
|
pub method_name: Symbol,
|
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_drop_impl_on_wrong_item, code = "E0120")]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub struct DropImplOnWrongItem {
|
2022-03-31 08:50:45 +01:00
|
|
|
#[primary_span]
|
2022-03-31 10:24:46 +01:00
|
|
|
#[label]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub span: Span,
|
|
|
|
}
|
2020-08-27 20:00:21 +10:00
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_field_already_declared, code = "E0124")]
|
2020-08-27 20:00:21 +10:00
|
|
|
pub struct FieldAlreadyDeclared {
|
|
|
|
pub field_name: Ident,
|
2022-03-31 08:50:45 +01:00
|
|
|
#[primary_span]
|
2022-03-31 10:24:46 +01:00
|
|
|
#[label]
|
2020-08-27 20:00:21 +10:00
|
|
|
pub span: Span,
|
2022-10-13 10:13:02 +01:00
|
|
|
#[label(hir_analysis_previous_decl_label)]
|
2020-08-27 20:00:21 +10:00
|
|
|
pub prev_span: Span,
|
|
|
|
}
|
2020-08-27 20:09:22 +10:00
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_copy_impl_on_type_with_dtor, code = "E0184")]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub struct CopyImplOnTypeWithDtor {
|
2022-03-31 08:50:45 +01:00
|
|
|
#[primary_span]
|
2022-03-31 10:24:46 +01:00
|
|
|
#[label]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub span: Span,
|
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_multiple_relaxed_default_bounds, code = "E0203")]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub struct MultipleRelaxedDefaultBounds {
|
2022-03-31 08:50:45 +01:00
|
|
|
#[primary_span]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub span: Span,
|
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_copy_impl_on_non_adt, code = "E0206")]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub struct CopyImplOnNonAdt {
|
2022-03-31 08:50:45 +01:00
|
|
|
#[primary_span]
|
2022-03-31 10:24:46 +01:00
|
|
|
#[label]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub span: Span,
|
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_trait_object_declared_with_no_traits, code = "E0224")]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub struct TraitObjectDeclaredWithNoTraits {
|
2022-03-31 08:50:45 +01:00
|
|
|
#[primary_span]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub span: Span,
|
2022-10-13 10:13:02 +01:00
|
|
|
#[label(hir_analysis_alias_span)]
|
2022-05-09 19:03:37 +02:00
|
|
|
pub trait_alias_span: Option<Span>,
|
2020-08-27 20:09:22 +10:00
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_ambiguous_lifetime_bound, code = "E0227")]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub struct AmbiguousLifetimeBound {
|
2022-03-31 08:50:45 +01:00
|
|
|
#[primary_span]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub span: Span,
|
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_assoc_type_binding_not_allowed, code = "E0229")]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub struct AssocTypeBindingNotAllowed {
|
2022-03-31 08:50:45 +01:00
|
|
|
#[primary_span]
|
2022-03-31 10:24:46 +01:00
|
|
|
#[label]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub span: Span,
|
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_typeof_reserved_keyword_used, code = "E0516")]
|
2022-04-07 22:46:53 +04:00
|
|
|
pub struct TypeofReservedKeywordUsed<'tcx> {
|
|
|
|
pub ty: Ty<'tcx>,
|
2022-03-31 08:50:45 +01:00
|
|
|
#[primary_span]
|
2022-03-31 10:24:46 +01:00
|
|
|
#[label]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub span: Span,
|
2022-10-22 15:48:55 +02:00
|
|
|
#[suggestion(style = "verbose", code = "{ty}")]
|
2022-04-07 22:46:53 +04:00
|
|
|
pub opt_sugg: Option<(Span, Applicability)>,
|
2020-08-27 20:09:22 +10:00
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_value_of_associated_struct_already_specified, code = "E0719")]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub struct ValueOfAssociatedStructAlreadySpecified {
|
2022-03-31 08:50:45 +01:00
|
|
|
#[primary_span]
|
2022-03-31 10:24:46 +01:00
|
|
|
#[label]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub span: Span,
|
2022-10-13 10:13:02 +01:00
|
|
|
#[label(hir_analysis_previous_bound_label)]
|
2020-08-27 20:09:22 +10:00
|
|
|
pub prev_span: Span,
|
|
|
|
pub item_name: Ident,
|
|
|
|
pub def_path: String,
|
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_unconstrained_opaque_type)]
|
2022-05-04 07:27:12 +01:00
|
|
|
#[note]
|
|
|
|
pub struct UnconstrainedOpaqueType {
|
|
|
|
#[primary_span]
|
|
|
|
pub span: Span,
|
|
|
|
pub name: Symbol,
|
2022-10-22 03:09:49 +00:00
|
|
|
pub what: &'static str,
|
2022-05-04 07:27:12 +01:00
|
|
|
}
|
2022-05-06 03:46:12 +01:00
|
|
|
|
2022-09-05 17:26:57 -04:00
|
|
|
pub struct MissingTypeParams {
|
2022-05-07 07:32:01 +01:00
|
|
|
pub span: Span,
|
|
|
|
pub def_span: Span,
|
2022-09-05 17:26:57 -04:00
|
|
|
pub span_snippet: Option<String>,
|
2022-07-25 22:40:00 +09:00
|
|
|
pub missing_type_params: Vec<Symbol>,
|
2022-05-07 07:32:01 +01:00
|
|
|
pub empty_generic_args: bool,
|
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
// Manual implementation of `IntoDiagnostic` to be able to call `span_to_snippet`.
|
2022-09-18 11:45:41 -04:00
|
|
|
impl<'a> IntoDiagnostic<'a> for MissingTypeParams {
|
2022-10-31 16:14:29 +01:00
|
|
|
#[track_caller]
|
2022-09-05 00:15:50 -04:00
|
|
|
fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
|
|
|
|
let mut err = handler.struct_span_err_with_code(
|
2022-05-07 07:32:01 +01:00
|
|
|
self.span,
|
2022-10-13 10:13:02 +01:00
|
|
|
fluent::hir_analysis_missing_type_params,
|
2022-05-07 07:32:01 +01:00
|
|
|
error_code!(E0393),
|
|
|
|
);
|
|
|
|
err.set_arg("parameterCount", self.missing_type_params.len());
|
|
|
|
err.set_arg(
|
|
|
|
"parameters",
|
|
|
|
self.missing_type_params
|
|
|
|
.iter()
|
|
|
|
.map(|n| format!("`{}`", n))
|
|
|
|
.collect::<Vec<_>>()
|
|
|
|
.join(", "),
|
|
|
|
);
|
|
|
|
|
2022-10-13 10:13:02 +01:00
|
|
|
err.span_label(self.def_span, fluent::hir_analysis_label);
|
2022-05-07 07:32:01 +01:00
|
|
|
|
|
|
|
let mut suggested = false;
|
2022-09-05 17:32:23 -04:00
|
|
|
// Don't suggest setting the type params if there are some already: the order is
|
|
|
|
// tricky to get right and the user will already know what the syntax is.
|
|
|
|
if let Some(snippet) = self.span_snippet && self.empty_generic_args {
|
2022-05-07 07:32:01 +01:00
|
|
|
if snippet.ends_with('>') {
|
|
|
|
// The user wrote `Trait<'a, T>` or similar. To provide an accurate suggestion
|
|
|
|
// we would have to preserve the right order. For now, as clearly the user is
|
|
|
|
// aware of the syntax, we do nothing.
|
|
|
|
} else {
|
|
|
|
// The user wrote `Iterator`, so we don't have a type we can suggest, but at
|
|
|
|
// least we can clue them to the correct syntax `Iterator<Type>`.
|
|
|
|
err.span_suggestion(
|
|
|
|
self.span,
|
2022-10-13 10:13:02 +01:00
|
|
|
fluent::hir_analysis_suggestion,
|
2022-07-25 22:40:00 +09:00
|
|
|
format!(
|
|
|
|
"{}<{}>",
|
|
|
|
snippet,
|
|
|
|
self.missing_type_params
|
|
|
|
.iter()
|
|
|
|
.map(|n| n.to_string())
|
|
|
|
.collect::<Vec<_>>()
|
|
|
|
.join(", ")
|
|
|
|
),
|
2022-05-07 07:32:01 +01:00
|
|
|
Applicability::HasPlaceholders,
|
|
|
|
);
|
|
|
|
suggested = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if !suggested {
|
2022-10-13 10:13:02 +01:00
|
|
|
err.span_label(self.span, fluent::hir_analysis_no_suggestion_label);
|
2022-05-07 07:32:01 +01:00
|
|
|
}
|
|
|
|
|
2022-10-13 10:13:02 +01:00
|
|
|
err.note(fluent::hir_analysis_note);
|
2022-05-07 07:32:01 +01:00
|
|
|
err
|
|
|
|
}
|
|
|
|
}
|
2022-05-07 07:50:01 +01:00
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_manual_implementation, code = "E0183")]
|
2022-05-07 07:50:01 +01:00
|
|
|
#[help]
|
|
|
|
pub struct ManualImplementation {
|
|
|
|
#[primary_span]
|
|
|
|
#[label]
|
|
|
|
pub span: Span,
|
|
|
|
pub trait_name: String,
|
|
|
|
}
|
2022-05-07 08:14:48 +01:00
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_substs_on_overridden_impl)]
|
2022-05-07 08:14:48 +01:00
|
|
|
pub struct SubstsOnOverriddenImpl {
|
|
|
|
#[primary_span]
|
|
|
|
pub span: Span,
|
|
|
|
}
|
2022-08-17 17:47:44 +08:00
|
|
|
|
|
|
|
#[derive(LintDiagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_unused_extern_crate)]
|
2022-08-17 17:47:44 +08:00
|
|
|
pub struct UnusedExternCrate {
|
|
|
|
#[suggestion(applicability = "machine-applicable", code = "")]
|
|
|
|
pub span: Span,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(LintDiagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(hir_analysis_extern_crate_not_idiomatic)]
|
2022-08-17 17:47:44 +08:00
|
|
|
pub struct ExternCrateNotIdiomatic {
|
2022-10-22 15:48:55 +02:00
|
|
|
#[suggestion(
|
|
|
|
style = "short",
|
|
|
|
applicability = "machine-applicable",
|
|
|
|
code = "{suggestion_code}"
|
|
|
|
)]
|
2022-08-17 17:47:44 +08:00
|
|
|
pub span: Span,
|
|
|
|
pub msg_code: String,
|
|
|
|
pub suggestion_code: String,
|
|
|
|
}
|
2022-08-18 08:14:21 -04:00
|
|
|
|
2022-10-25 18:28:04 +00:00
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(hir_analysis_const_impl_for_non_const_trait)]
|
|
|
|
pub struct ConstImplForNonConstTrait {
|
|
|
|
#[primary_span]
|
|
|
|
pub trait_ref_span: Span,
|
|
|
|
pub trait_name: String,
|
|
|
|
#[suggestion(applicability = "machine-applicable", code = "#[const_trait]")]
|
|
|
|
pub local_trait_span: Option<Span>,
|
|
|
|
#[note]
|
|
|
|
pub marking: (),
|
2022-10-13 10:13:02 +01:00
|
|
|
#[note(hir_analysis_adding)]
|
2022-10-25 18:28:04 +00:00
|
|
|
pub adding: (),
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(hir_analysis_const_bound_for_non_const_trait)]
|
|
|
|
pub struct ConstBoundForNonConstTrait {
|
|
|
|
#[primary_span]
|
|
|
|
pub span: Span,
|
|
|
|
}
|
2022-10-27 21:48:41 +01:00
|
|
|
|
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(hir_analysis_self_in_impl_self)]
|
|
|
|
pub struct SelfInImplSelf {
|
|
|
|
#[primary_span]
|
2022-10-27 22:18:26 +01:00
|
|
|
pub span: MultiSpan,
|
|
|
|
#[note]
|
|
|
|
pub note: (),
|
2022-10-27 21:48:41 +01:00
|
|
|
}
|
Move linkage type check to HIR analysis and fix semantics issues.
This ensures that the error is printed even for unused variables,
as well as unifying the handling between the LLVM and GCC backends.
This also fixes unusual behavior around exported Rust-defined variables
with linkage attributes. With the previous behavior, it appears to be
impossible to define such a variable such that it can actually be imported
and used by another crate. This is because on the importing side, the
variable is required to be a pointer, but on the exporting side, the
type checker rejects static variables of pointer type because they do
not implement `Sync`. Even if it were possible to import such a type, it
appears that code generation on the importing side would add an unexpected
additional level of pointer indirection, which would break type safety.
This highlighted that the semantics of linkage on Rust-defined variables
is different to linkage on foreign items. As such, we now model the
difference with two different codegen attributes: linkage for Rust-defined
variables, and import_linkage for foreign items.
This change gives semantics to the test
src/test/ui/linkage-attr/auxiliary/def_illtyped_external.rs which was
previously expected to fail to compile. Therefore, convert it into a
test that is expected to successfully compile.
The update to the GCC backend is speculative and untested.
2022-11-23 18:13:30 -08:00
|
|
|
|
|
|
|
#[derive(Diagnostic)]
|
2022-11-23 18:15:50 -08:00
|
|
|
#[diag(hir_analysis_linkage_type, code = "E0791")]
|
Move linkage type check to HIR analysis and fix semantics issues.
This ensures that the error is printed even for unused variables,
as well as unifying the handling between the LLVM and GCC backends.
This also fixes unusual behavior around exported Rust-defined variables
with linkage attributes. With the previous behavior, it appears to be
impossible to define such a variable such that it can actually be imported
and used by another crate. This is because on the importing side, the
variable is required to be a pointer, but on the exporting side, the
type checker rejects static variables of pointer type because they do
not implement `Sync`. Even if it were possible to import such a type, it
appears that code generation on the importing side would add an unexpected
additional level of pointer indirection, which would break type safety.
This highlighted that the semantics of linkage on Rust-defined variables
is different to linkage on foreign items. As such, we now model the
difference with two different codegen attributes: linkage for Rust-defined
variables, and import_linkage for foreign items.
This change gives semantics to the test
src/test/ui/linkage-attr/auxiliary/def_illtyped_external.rs which was
previously expected to fail to compile. Therefore, convert it into a
test that is expected to successfully compile.
The update to the GCC backend is speculative and untested.
2022-11-23 18:13:30 -08:00
|
|
|
pub(crate) struct LinkageType {
|
|
|
|
#[primary_span]
|
|
|
|
pub span: Span,
|
|
|
|
}
|
2022-12-27 00:39:36 +00:00
|
|
|
|
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[help]
|
|
|
|
#[diag(hir_analysis_auto_deref_reached_recursion_limit, code = "E0055")]
|
|
|
|
pub struct AutoDerefReachedRecursionLimit<'a> {
|
|
|
|
#[primary_span]
|
|
|
|
#[label]
|
|
|
|
pub span: Span,
|
|
|
|
pub ty: Ty<'a>,
|
|
|
|
pub suggested_limit: rustc_session::Limit,
|
|
|
|
pub crate_name: Symbol,
|
|
|
|
}
|
2023-02-21 22:27:16 +02:00
|
|
|
|
2023-02-23 01:50:38 +02:00
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(hir_analysis_where_clause_on_main, code = "E0646")]
|
|
|
|
pub(crate) struct WhereClauseOnMain {
|
|
|
|
#[primary_span]
|
|
|
|
pub span: Span,
|
|
|
|
#[label]
|
|
|
|
pub generics_span: Option<Span>,
|
|
|
|
}
|
|
|
|
|
2023-02-21 22:27:16 +02:00
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(hir_analysis_track_caller_on_main)]
|
|
|
|
pub(crate) struct TrackCallerOnMain {
|
|
|
|
#[primary_span]
|
|
|
|
pub span: Span,
|
|
|
|
#[label]
|
|
|
|
pub annotated: Span,
|
|
|
|
}
|