Skip to main content

rustc_hir_analysis/
lib.rs

1/*!
2
3# typeck
4
5The type checker is responsible for:
6
71. Determining the type of each expression.
82. Resolving methods and traits.
93. Guaranteeing that most type rules are met. ("Most?", you say, "why most?"
10   Well, dear reader, read on.)
11
12The main entry point is [`check_crate()`]. Type checking operates in
13several major phases:
14
151. The collect phase first passes over all items and determines their
16   type, without examining their "innards".
17
182. Variance inference then runs to compute the variance of each parameter.
19
203. Coherence checks for overlapping or orphaned impls.
21
224. Finally, the check phase then checks function bodies and so forth.
23   Within the check phase, we check each function body one at a time
24   (bodies of function expressions are checked as part of the
25   containing function). Inference is used to supply types wherever
26   they are unknown. The actual checking of a function itself has
27   several phases (check, regionck, writeback), as discussed in the
28   documentation for the [`check`] module.
29
30The type checker is defined into various submodules which are documented
31independently:
32
33- hir_ty_lowering: lowers type-system entities from the [HIR][hir] to the
34  [`rustc_middle::ty`] representation.
35
36- collect: computes the types of each top-level item and enters them into
37  the `tcx.types` table for later use.
38
39- coherence: enforces coherence rules, builds some tables.
40
41- variance: variance inference
42
43- outlives: outlives inference
44
45- check: walks over function bodies and type checks them, inferring types for
46  local variables, type parameters, etc as necessary.
47
48- infer: finds the types to use for each type variable such that
49  all subtyping and assignment constraints are met. In essence, the check
50  module specifies the constraints, and the infer module solves them.
51
52## Note
53
54This API is completely unstable and subject to change.
55
56*/
57
58// tidy-alphabetical-start
59#![feature(assert_matches)]
60#![feature(gen_blocks)]
61#![feature(if_let_guard)]
62#![feature(iter_intersperse)]
63#![feature(never_type)]
64#![feature(slice_partition_dedup)]
65#![feature(try_blocks)]
66#![feature(unwrap_infallible)]
67// tidy-alphabetical-end
68
69// These are used by Clippy.
70pub mod check;
71
72pub mod autoderef;
73mod check_unused;
74mod coherence;
75mod collect;
76mod constrained_generic_params;
77mod delegation;
78pub mod errors;
79pub mod hir_ty_lowering;
80pub mod hir_wf_check;
81mod impl_wf_check;
82mod outlives;
83mod variance;
84
85pub use errors::NoVariantNamed;
86use rustc_abi::{CVariadicStatus, ExternAbi};
87use rustc_hir::attrs::AttributeKind;
88use rustc_hir::def::DefKind;
89use rustc_hir::lints::DelayedLint;
90use rustc_hir::{
91    find_attr, {self as hir},
92};
93use rustc_middle::mir::interpret::GlobalId;
94use rustc_middle::query::Providers;
95use rustc_middle::ty::{Const, Ty, TyCtxt};
96use rustc_middle::{middle, ty};
97use rustc_session::parse::feature_err;
98use rustc_span::{ErrorGuaranteed, Span};
99use rustc_trait_selection::traits;
100
101pub use crate::collect::suggest_impl_trait;
102use crate::hir_ty_lowering::HirTyLowerer;
103
104#[allow(non_upper_case_globals)]
#[doc(hidden)]
#[doc =
r" Auto-generated constants for type-checked references to Fluent messages."]
pub(crate) mod fluent_generated {
    #[doc =
    "Constant referring to Fluent message `hir_analysis_abi_custom_clothed_function` from `hir_analysis`"]
    pub const hir_analysis_abi_custom_clothed_function:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_abi_custom_clothed_function"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_abi_custom_clothed_function.suggestion` from `hir_analysis`"]
    pub const hir_analysis_suggestion: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("suggestion"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_ambiguous_assoc_item` from `hir_analysis`"]
    pub const hir_analysis_ambiguous_assoc_item: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_ambiguous_assoc_item"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_ambiguous_assoc_item.label` from `hir_analysis`"]
    pub const hir_analysis_label: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_ambiguous_lifetime_bound` from `hir_analysis`"]
    pub const hir_analysis_ambiguous_lifetime_bound: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_ambiguous_lifetime_bound"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_assoc_item_constraints_not_allowed_here` from `hir_analysis`"]
    pub const hir_analysis_assoc_item_constraints_not_allowed_here:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_assoc_item_constraints_not_allowed_here"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_assoc_item_is_private` from `hir_analysis`"]
    pub const hir_analysis_assoc_item_is_private: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_assoc_item_is_private"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_assoc_item_is_private.defined_here_label` from `hir_analysis`"]
    pub const hir_analysis_defined_here_label: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("defined_here_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_assoc_item_not_found` from `hir_analysis`"]
    pub const hir_analysis_assoc_item_not_found: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_assoc_item_not_found"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_assoc_item_not_found_found_in_other_trait_label` from `hir_analysis`"]
    pub const hir_analysis_assoc_item_not_found_found_in_other_trait_label:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_assoc_item_not_found_found_in_other_trait_label"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_assoc_item_not_found_label` from `hir_analysis`"]
    pub const hir_analysis_assoc_item_not_found_label:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_assoc_item_not_found_label"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_assoc_item_not_found_other_sugg` from `hir_analysis`"]
    pub const hir_analysis_assoc_item_not_found_other_sugg:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_assoc_item_not_found_other_sugg"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_assoc_item_not_found_similar_in_other_trait_qpath_sugg` from `hir_analysis`"]
    pub const
        hir_analysis_assoc_item_not_found_similar_in_other_trait_qpath_sugg:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_assoc_item_not_found_similar_in_other_trait_qpath_sugg"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_assoc_item_not_found_similar_in_other_trait_sugg` from `hir_analysis`"]
    pub const hir_analysis_assoc_item_not_found_similar_in_other_trait_sugg:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_assoc_item_not_found_similar_in_other_trait_sugg"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_assoc_item_not_found_similar_in_other_trait_with_bound_sugg` from `hir_analysis`"]
    pub const
        hir_analysis_assoc_item_not_found_similar_in_other_trait_with_bound_sugg:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_assoc_item_not_found_similar_in_other_trait_with_bound_sugg"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_assoc_item_not_found_similar_sugg` from `hir_analysis`"]
    pub const hir_analysis_assoc_item_not_found_similar_sugg:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_assoc_item_not_found_similar_sugg"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_assoc_kind_mismatch` from `hir_analysis`"]
    pub const hir_analysis_assoc_kind_mismatch: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_assoc_kind_mismatch"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_assoc_kind_mismatch.expected_because_label` from `hir_analysis`"]
    pub const hir_analysis_expected_because_label:
        rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("expected_because_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_assoc_kind_mismatch.note` from `hir_analysis`"]
    pub const hir_analysis_note: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("note"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_assoc_kind_mismatch.bound_on_assoc_const_label` from `hir_analysis`"]
    pub const hir_analysis_bound_on_assoc_const_label:
        rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("bound_on_assoc_const_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_assoc_kind_mismatch_wrap_in_braces_sugg` from `hir_analysis`"]
    pub const hir_analysis_assoc_kind_mismatch_wrap_in_braces_sugg:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_assoc_kind_mismatch_wrap_in_braces_sugg"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_associated_type_trait_uninferred_generic_params` from `hir_analysis`"]
    pub const hir_analysis_associated_type_trait_uninferred_generic_params:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_associated_type_trait_uninferred_generic_params"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_associated_type_trait_uninferred_generic_params_multipart_suggestion` from `hir_analysis`"]
    pub const
        hir_analysis_associated_type_trait_uninferred_generic_params_multipart_suggestion:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_associated_type_trait_uninferred_generic_params_multipart_suggestion"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_async_drop_without_sync_drop` from `hir_analysis`"]
    pub const hir_analysis_async_drop_without_sync_drop:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_async_drop_without_sync_drop"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_async_drop_without_sync_drop.help` from `hir_analysis`"]
    pub const hir_analysis_help: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("help"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_auto_deref_reached_recursion_limit` from `hir_analysis`"]
    pub const hir_analysis_auto_deref_reached_recursion_limit:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_auto_deref_reached_recursion_limit"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_bad_precise_capture` from `hir_analysis`"]
    pub const hir_analysis_bad_precise_capture: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_bad_precise_capture"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_bad_return_type_notation_position` from `hir_analysis`"]
    pub const hir_analysis_bad_return_type_notation_position:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_bad_return_type_notation_position"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_cannot_capture_late_bound_const` from `hir_analysis`"]
    pub const hir_analysis_cannot_capture_late_bound_const:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_cannot_capture_late_bound_const"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_cannot_capture_late_bound_lifetime` from `hir_analysis`"]
    pub const hir_analysis_cannot_capture_late_bound_lifetime:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_cannot_capture_late_bound_lifetime"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_cannot_capture_late_bound_ty` from `hir_analysis`"]
    pub const hir_analysis_cannot_capture_late_bound_ty:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_cannot_capture_late_bound_ty"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_closure_implicit_hrtb` from `hir_analysis`"]
    pub const hir_analysis_closure_implicit_hrtb: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_closure_implicit_hrtb"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_cmse_generic` from `hir_analysis`"]
    pub const hir_analysis_cmse_generic: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_cmse_generic"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_cmse_impl_trait` from `hir_analysis`"]
    pub const hir_analysis_cmse_impl_trait: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_cmse_impl_trait"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_cmse_inputs_stack_spill` from `hir_analysis`"]
    pub const hir_analysis_cmse_inputs_stack_spill: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_cmse_inputs_stack_spill"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_cmse_output_stack_spill` from `hir_analysis`"]
    pub const hir_analysis_cmse_output_stack_spill: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_cmse_output_stack_spill"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_cmse_output_stack_spill.note1` from `hir_analysis`"]
    pub const hir_analysis_note1: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("note1"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_cmse_output_stack_spill.note2` from `hir_analysis`"]
    pub const hir_analysis_note2: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("note2"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_coerce_multi` from `hir_analysis`"]
    pub const hir_analysis_coerce_multi: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_coerce_multi"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_coerce_pointee_no_field` from `hir_analysis`"]
    pub const hir_analysis_coerce_pointee_no_field: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_coerce_pointee_no_field"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_coerce_pointee_no_user_validity_assertion` from `hir_analysis`"]
    pub const hir_analysis_coerce_pointee_no_user_validity_assertion:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_coerce_pointee_no_user_validity_assertion"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_coerce_pointee_not_concrete_ty` from `hir_analysis`"]
    pub const hir_analysis_coerce_pointee_not_concrete_ty:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_coerce_pointee_not_concrete_ty"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_coerce_pointee_not_struct` from `hir_analysis`"]
    pub const hir_analysis_coerce_pointee_not_struct:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_coerce_pointee_not_struct"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_coerce_pointee_not_transparent` from `hir_analysis`"]
    pub const hir_analysis_coerce_pointee_not_transparent:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_coerce_pointee_not_transparent"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_coerce_same_pat_kind` from `hir_analysis`"]
    pub const hir_analysis_coerce_same_pat_kind: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_coerce_same_pat_kind"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_coerce_unsized_field_validity` from `hir_analysis`"]
    pub const hir_analysis_coerce_unsized_field_validity:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_coerce_unsized_field_validity"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_coerce_unsized_may` from `hir_analysis`"]
    pub const hir_analysis_coerce_unsized_may: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_coerce_unsized_may"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_coerce_zero` from `hir_analysis`"]
    pub const hir_analysis_coerce_zero: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_coerce_zero"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_coercion_between_struct_same_note` from `hir_analysis`"]
    pub const hir_analysis_coercion_between_struct_same_note:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_coercion_between_struct_same_note"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_coercion_between_struct_single_note` from `hir_analysis`"]
    pub const hir_analysis_coercion_between_struct_single_note:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_coercion_between_struct_single_note"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_const_bound_for_non_const_trait` from `hir_analysis`"]
    pub const hir_analysis_const_bound_for_non_const_trait:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_const_bound_for_non_const_trait"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_const_impl_for_non_const_trait` from `hir_analysis`"]
    pub const hir_analysis_const_impl_for_non_const_trait:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_const_impl_for_non_const_trait"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_const_impl_for_non_const_trait.adding` from `hir_analysis`"]
    pub const hir_analysis_adding: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("adding"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_const_param_ty_impl_on_non_adt` from `hir_analysis`"]
    pub const hir_analysis_const_param_ty_impl_on_non_adt:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_const_param_ty_impl_on_non_adt"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_const_param_ty_impl_on_unsized` from `hir_analysis`"]
    pub const hir_analysis_const_param_ty_impl_on_unsized:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_const_param_ty_impl_on_unsized"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_copy_impl_on_non_adt` from `hir_analysis`"]
    pub const hir_analysis_copy_impl_on_non_adt: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_copy_impl_on_non_adt"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_copy_impl_on_type_with_dtor` from `hir_analysis`"]
    pub const hir_analysis_copy_impl_on_type_with_dtor:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_copy_impl_on_type_with_dtor"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_cross_crate_traits` from `hir_analysis`"]
    pub const hir_analysis_cross_crate_traits: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_cross_crate_traits"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_cross_crate_traits_defined` from `hir_analysis`"]
    pub const hir_analysis_cross_crate_traits_defined:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_cross_crate_traits_defined"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_dispatch_from_dyn_repr` from `hir_analysis`"]
    pub const hir_analysis_dispatch_from_dyn_repr: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_dispatch_from_dyn_repr"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_dispatch_from_dyn_zst` from `hir_analysis`"]
    pub const hir_analysis_dispatch_from_dyn_zst: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_dispatch_from_dyn_zst"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_drop_impl_negative` from `hir_analysis`"]
    pub const hir_analysis_drop_impl_negative: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_drop_impl_negative"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_drop_impl_on_wrong_item` from `hir_analysis`"]
    pub const hir_analysis_drop_impl_on_wrong_item: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_drop_impl_on_wrong_item"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_drop_impl_reservation` from `hir_analysis`"]
    pub const hir_analysis_drop_impl_reservation: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_drop_impl_reservation"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_duplicate_precise_capture` from `hir_analysis`"]
    pub const hir_analysis_duplicate_precise_capture:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_duplicate_precise_capture"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_dyn_trait_assoc_item_binding_mentions_self` from `hir_analysis`"]
    pub const hir_analysis_dyn_trait_assoc_item_binding_mentions_self:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_dyn_trait_assoc_item_binding_mentions_self"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_dyn_trait_assoc_item_binding_mentions_self.binding_label` from `hir_analysis`"]
    pub const hir_analysis_binding_label: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("binding_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_eii_with_generics` from `hir_analysis`"]
    pub const hir_analysis_eii_with_generics: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_eii_with_generics"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_empty_specialization` from `hir_analysis`"]
    pub const hir_analysis_empty_specialization: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_empty_specialization"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_enum_discriminant_overflowed` from `hir_analysis`"]
    pub const hir_analysis_enum_discriminant_overflowed:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_enum_discriminant_overflowed"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_escaping_bound_var_in_ty_of_assoc_const_binding` from `hir_analysis`"]
    pub const hir_analysis_escaping_bound_var_in_ty_of_assoc_const_binding:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_escaping_bound_var_in_ty_of_assoc_const_binding"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_escaping_bound_var_in_ty_of_assoc_const_binding.var_defined_here_label` from `hir_analysis`"]
    pub const hir_analysis_var_defined_here_label:
        rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("var_defined_here_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_field_already_declared` from `hir_analysis`"]
    pub const hir_analysis_field_already_declared: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_field_already_declared"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_field_already_declared.previous_decl_label` from `hir_analysis`"]
    pub const hir_analysis_previous_decl_label: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("previous_decl_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_field_already_declared_both_nested` from `hir_analysis`"]
    pub const hir_analysis_field_already_declared_both_nested:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_field_already_declared_both_nested"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_field_already_declared_both_nested.nested_field_decl_note` from `hir_analysis`"]
    pub const hir_analysis_nested_field_decl_note:
        rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("nested_field_decl_note"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_field_already_declared_both_nested.previous_nested_field_decl_note` from `hir_analysis`"]
    pub const hir_analysis_previous_nested_field_decl_note:
        rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("previous_nested_field_decl_note"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_field_already_declared_current_nested` from `hir_analysis`"]
    pub const hir_analysis_field_already_declared_current_nested:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_field_already_declared_current_nested"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_field_already_declared_nested_help` from `hir_analysis`"]
    pub const hir_analysis_field_already_declared_nested_help:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_field_already_declared_nested_help"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_field_already_declared_previous_nested` from `hir_analysis`"]
    pub const hir_analysis_field_already_declared_previous_nested:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_field_already_declared_previous_nested"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_generic_args_on_overridden_impl` from `hir_analysis`"]
    pub const hir_analysis_generic_args_on_overridden_impl:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_generic_args_on_overridden_impl"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_impl_not_marked_default` from `hir_analysis`"]
    pub const hir_analysis_impl_not_marked_default: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_impl_not_marked_default"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_impl_not_marked_default.ok_label` from `hir_analysis`"]
    pub const hir_analysis_ok_label: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("ok_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_impl_not_marked_default_err` from `hir_analysis`"]
    pub const hir_analysis_impl_not_marked_default_err:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_impl_not_marked_default_err"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_inherent_dyn` from `hir_analysis`"]
    pub const hir_analysis_inherent_dyn: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_inherent_dyn"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_inherent_nominal` from `hir_analysis`"]
    pub const hir_analysis_inherent_nominal: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_inherent_nominal"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_inherent_primitive_ty` from `hir_analysis`"]
    pub const hir_analysis_inherent_primitive_ty: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_inherent_primitive_ty"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_inherent_primitive_ty_note` from `hir_analysis`"]
    pub const hir_analysis_inherent_primitive_ty_note:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_inherent_primitive_ty_note"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_inherent_ty_outside` from `hir_analysis`"]
    pub const hir_analysis_inherent_ty_outside: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_inherent_ty_outside"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_inherent_ty_outside.span_help` from `hir_analysis`"]
    pub const hir_analysis_span_help: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("span_help"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_inherent_ty_outside_new` from `hir_analysis`"]
    pub const hir_analysis_inherent_ty_outside_new: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_inherent_ty_outside_new"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_inherent_ty_outside_primitive` from `hir_analysis`"]
    pub const hir_analysis_inherent_ty_outside_primitive:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_inherent_ty_outside_primitive"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_inherent_ty_outside_relevant` from `hir_analysis`"]
    pub const hir_analysis_inherent_ty_outside_relevant:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_inherent_ty_outside_relevant"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_invalid_generic_receiver_ty` from `hir_analysis`"]
    pub const hir_analysis_invalid_generic_receiver_ty:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_invalid_generic_receiver_ty"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_invalid_generic_receiver_ty_help` from `hir_analysis`"]
    pub const hir_analysis_invalid_generic_receiver_ty_help:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_invalid_generic_receiver_ty_help"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_invalid_receiver_ty` from `hir_analysis`"]
    pub const hir_analysis_invalid_receiver_ty: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_invalid_receiver_ty"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_invalid_receiver_ty_help` from `hir_analysis`"]
    pub const hir_analysis_invalid_receiver_ty_help: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_invalid_receiver_ty_help"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_invalid_receiver_ty_help_no_arbitrary_self_types` from `hir_analysis`"]
    pub const hir_analysis_invalid_receiver_ty_help_no_arbitrary_self_types:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_invalid_receiver_ty_help_no_arbitrary_self_types"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_invalid_receiver_ty_help_nonnull_note` from `hir_analysis`"]
    pub const hir_analysis_invalid_receiver_ty_help_nonnull_note:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_invalid_receiver_ty_help_nonnull_note"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_invalid_receiver_ty_help_weak_note` from `hir_analysis`"]
    pub const hir_analysis_invalid_receiver_ty_help_weak_note:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_invalid_receiver_ty_help_weak_note"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_invalid_receiver_ty_no_arbitrary_self_types` from `hir_analysis`"]
    pub const hir_analysis_invalid_receiver_ty_no_arbitrary_self_types:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_invalid_receiver_ty_no_arbitrary_self_types"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_invalid_union_field` from `hir_analysis`"]
    pub const hir_analysis_invalid_union_field: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_invalid_union_field"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_invalid_union_field_sugg` from `hir_analysis`"]
    pub const hir_analysis_invalid_union_field_sugg: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_invalid_union_field_sugg"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_late_bound_const_in_apit` from `hir_analysis`"]
    pub const hir_analysis_late_bound_const_in_apit: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_late_bound_const_in_apit"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_late_bound_lifetime_in_apit` from `hir_analysis`"]
    pub const hir_analysis_late_bound_lifetime_in_apit:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_late_bound_lifetime_in_apit"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_late_bound_type_in_apit` from `hir_analysis`"]
    pub const hir_analysis_late_bound_type_in_apit: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_late_bound_type_in_apit"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_lifetime_implicitly_captured` from `hir_analysis`"]
    pub const hir_analysis_lifetime_implicitly_captured:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_lifetime_implicitly_captured"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_lifetime_implicitly_captured.param_label` from `hir_analysis`"]
    pub const hir_analysis_param_label: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("param_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_lifetime_must_be_first` from `hir_analysis`"]
    pub const hir_analysis_lifetime_must_be_first: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_lifetime_must_be_first"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_lifetime_not_captured` from `hir_analysis`"]
    pub const hir_analysis_lifetime_not_captured: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_lifetime_not_captured"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_lifetimes_or_bounds_mismatch_on_eii` from `hir_analysis`"]
    pub const hir_analysis_lifetimes_or_bounds_mismatch_on_eii:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_lifetimes_or_bounds_mismatch_on_eii"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_lifetimes_or_bounds_mismatch_on_eii.generics_label` from `hir_analysis`"]
    pub const hir_analysis_generics_label: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("generics_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_lifetimes_or_bounds_mismatch_on_eii.where_label` from `hir_analysis`"]
    pub const hir_analysis_where_label: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("where_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_lifetimes_or_bounds_mismatch_on_eii.bounds_label` from `hir_analysis`"]
    pub const hir_analysis_bounds_label: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("bounds_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_lifetimes_or_bounds_mismatch_on_trait` from `hir_analysis`"]
    pub const hir_analysis_lifetimes_or_bounds_mismatch_on_trait:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_lifetimes_or_bounds_mismatch_on_trait"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_linkage_type` from `hir_analysis`"]
    pub const hir_analysis_linkage_type: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_linkage_type"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_main_function_async` from `hir_analysis`"]
    pub const hir_analysis_main_function_async: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_main_function_async"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_main_function_generic_parameters` from `hir_analysis`"]
    pub const hir_analysis_main_function_generic_parameters:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_main_function_generic_parameters"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_main_function_return_type_generic` from `hir_analysis`"]
    pub const hir_analysis_main_function_return_type_generic:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_main_function_return_type_generic"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_manual_implementation` from `hir_analysis`"]
    pub const hir_analysis_manual_implementation: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_manual_implementation"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_method_should_return_future` from `hir_analysis`"]
    pub const hir_analysis_method_should_return_future:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_method_should_return_future"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_missing_generic_params` from `hir_analysis`"]
    pub const hir_analysis_missing_generic_params: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_missing_generic_params"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_missing_generic_params.no_suggestion_label` from `hir_analysis`"]
    pub const hir_analysis_no_suggestion_label: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("no_suggestion_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_missing_one_of_trait_item` from `hir_analysis`"]
    pub const hir_analysis_missing_one_of_trait_item:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_missing_one_of_trait_item"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_missing_trait_item` from `hir_analysis`"]
    pub const hir_analysis_missing_trait_item: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_missing_trait_item"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_missing_trait_item_label` from `hir_analysis`"]
    pub const hir_analysis_missing_trait_item_label: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_missing_trait_item_label"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_missing_trait_item_suggestion` from `hir_analysis`"]
    pub const hir_analysis_missing_trait_item_suggestion:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_missing_trait_item_suggestion"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_missing_trait_item_unstable` from `hir_analysis`"]
    pub const hir_analysis_missing_trait_item_unstable:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_missing_trait_item_unstable"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_missing_trait_item_unstable.some_note` from `hir_analysis`"]
    pub const hir_analysis_some_note: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("some_note"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_missing_trait_item_unstable.none_note` from `hir_analysis`"]
    pub const hir_analysis_none_note: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("none_note"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_no_variant_named` from `hir_analysis`"]
    pub const hir_analysis_no_variant_named: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_no_variant_named"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_not_supported_delegation` from `hir_analysis`"]
    pub const hir_analysis_not_supported_delegation: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_not_supported_delegation"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_only_current_traits_adt` from `hir_analysis`"]
    pub const hir_analysis_only_current_traits_adt: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_only_current_traits_adt"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_only_current_traits_arbitrary` from `hir_analysis`"]
    pub const hir_analysis_only_current_traits_arbitrary:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_only_current_traits_arbitrary"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_only_current_traits_foreign` from `hir_analysis`"]
    pub const hir_analysis_only_current_traits_foreign:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_only_current_traits_foreign"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_only_current_traits_name` from `hir_analysis`"]
    pub const hir_analysis_only_current_traits_name: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_only_current_traits_name"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_only_current_traits_note` from `hir_analysis`"]
    pub const hir_analysis_only_current_traits_note: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_only_current_traits_note"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_only_current_traits_note_more_info` from `hir_analysis`"]
    pub const hir_analysis_only_current_traits_note_more_info:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_only_current_traits_note_more_info"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_only_current_traits_note_uncovered` from `hir_analysis`"]
    pub const hir_analysis_only_current_traits_note_uncovered:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_only_current_traits_note_uncovered"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_only_current_traits_opaque` from `hir_analysis`"]
    pub const hir_analysis_only_current_traits_opaque:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_only_current_traits_opaque"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_only_current_traits_outside` from `hir_analysis`"]
    pub const hir_analysis_only_current_traits_outside:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_only_current_traits_outside"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_only_current_traits_pointer` from `hir_analysis`"]
    pub const hir_analysis_only_current_traits_pointer:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_only_current_traits_pointer"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_only_current_traits_pointer_sugg` from `hir_analysis`"]
    pub const hir_analysis_only_current_traits_pointer_sugg:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_only_current_traits_pointer_sugg"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_only_current_traits_primitive` from `hir_analysis`"]
    pub const hir_analysis_only_current_traits_primitive:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_only_current_traits_primitive"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_only_current_traits_ty` from `hir_analysis`"]
    pub const hir_analysis_only_current_traits_ty: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_only_current_traits_ty"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_opaque_captures_higher_ranked_lifetime` from `hir_analysis`"]
    pub const hir_analysis_opaque_captures_higher_ranked_lifetime:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_opaque_captures_higher_ranked_lifetime"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_param_in_ty_of_assoc_const_binding` from `hir_analysis`"]
    pub const hir_analysis_param_in_ty_of_assoc_const_binding:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_param_in_ty_of_assoc_const_binding"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_param_in_ty_of_assoc_const_binding.param_defined_here_label` from `hir_analysis`"]
    pub const hir_analysis_param_defined_here_label:
        rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("param_defined_here_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_param_not_captured` from `hir_analysis`"]
    pub const hir_analysis_param_not_captured: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_param_not_captured"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_paren_sugar_attribute` from `hir_analysis`"]
    pub const hir_analysis_paren_sugar_attribute: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_paren_sugar_attribute"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_parenthesized_fn_trait_expansion` from `hir_analysis`"]
    pub const hir_analysis_parenthesized_fn_trait_expansion:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_parenthesized_fn_trait_expansion"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_placeholder_not_allowed_item_signatures` from `hir_analysis`"]
    pub const hir_analysis_placeholder_not_allowed_item_signatures:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_placeholder_not_allowed_item_signatures"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_precise_capture_self_alias` from `hir_analysis`"]
    pub const hir_analysis_precise_capture_self_alias:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_precise_capture_self_alias"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_recursive_generic_parameter` from `hir_analysis`"]
    pub const hir_analysis_recursive_generic_parameter:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_recursive_generic_parameter"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_redundant_lifetime_args` from `hir_analysis`"]
    pub const hir_analysis_redundant_lifetime_args: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_redundant_lifetime_args"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_requires_note` from `hir_analysis`"]
    pub const hir_analysis_requires_note: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_requires_note"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_return_type_notation_equality_bound` from `hir_analysis`"]
    pub const hir_analysis_return_type_notation_equality_bound:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_return_type_notation_equality_bound"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_return_type_notation_illegal_param_const` from `hir_analysis`"]
    pub const hir_analysis_return_type_notation_illegal_param_const:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_return_type_notation_illegal_param_const"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_return_type_notation_illegal_param_type` from `hir_analysis`"]
    pub const hir_analysis_return_type_notation_illegal_param_type:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_return_type_notation_illegal_param_type"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_return_type_notation_on_non_rpitit` from `hir_analysis`"]
    pub const hir_analysis_return_type_notation_on_non_rpitit:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_return_type_notation_on_non_rpitit"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_rpitit_refined` from `hir_analysis`"]
    pub const hir_analysis_rpitit_refined: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_rpitit_refined"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_rpitit_refined.unmatched_bound_label` from `hir_analysis`"]
    pub const hir_analysis_unmatched_bound_label: rustc_errors::SubdiagMessage
        =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("unmatched_bound_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_rpitit_refined.feedback_note` from `hir_analysis`"]
    pub const hir_analysis_feedback_note: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("feedback_note"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_rpitit_refined_lifetimes` from `hir_analysis`"]
    pub const hir_analysis_rpitit_refined_lifetimes: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_rpitit_refined_lifetimes"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_self_in_impl_self` from `hir_analysis`"]
    pub const hir_analysis_self_in_impl_self: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_self_in_impl_self"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_self_ty_not_captured` from `hir_analysis`"]
    pub const hir_analysis_self_ty_not_captured: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_self_ty_not_captured"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_simd_ffi_highly_experimental` from `hir_analysis`"]
    pub const hir_analysis_simd_ffi_highly_experimental:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_simd_ffi_highly_experimental"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_specialization_trait` from `hir_analysis`"]
    pub const hir_analysis_specialization_trait: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_specialization_trait"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_static_specialize` from `hir_analysis`"]
    pub const hir_analysis_static_specialize: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_static_specialize"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_supertrait_item_multiple_shadowee` from `hir_analysis`"]
    pub const hir_analysis_supertrait_item_multiple_shadowee:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_supertrait_item_multiple_shadowee"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_supertrait_item_shadowee` from `hir_analysis`"]
    pub const hir_analysis_supertrait_item_shadowee: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_supertrait_item_shadowee"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_supertrait_item_shadowing` from `hir_analysis`"]
    pub const hir_analysis_supertrait_item_shadowing:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_supertrait_item_shadowing"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_target_feature_on_main` from `hir_analysis`"]
    pub const hir_analysis_target_feature_on_main: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_target_feature_on_main"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_too_large_static` from `hir_analysis`"]
    pub const hir_analysis_too_large_static: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_too_large_static"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_track_caller_on_main` from `hir_analysis`"]
    pub const hir_analysis_track_caller_on_main: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_track_caller_on_main"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_trait_cannot_impl_for_ty` from `hir_analysis`"]
    pub const hir_analysis_trait_cannot_impl_for_ty: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_trait_cannot_impl_for_ty"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_trait_object_declared_with_no_traits` from `hir_analysis`"]
    pub const hir_analysis_trait_object_declared_with_no_traits:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_trait_object_declared_with_no_traits"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_trait_object_declared_with_no_traits.alias_span` from `hir_analysis`"]
    pub const hir_analysis_alias_span: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("alias_span"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_traits_with_default_impl` from `hir_analysis`"]
    pub const hir_analysis_traits_with_default_impl: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_traits_with_default_impl"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_transparent_enum_variant` from `hir_analysis`"]
    pub const hir_analysis_transparent_enum_variant: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_transparent_enum_variant"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_transparent_enum_variant.many_label` from `hir_analysis`"]
    pub const hir_analysis_many_label: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("many_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_transparent_enum_variant.multi_label` from `hir_analysis`"]
    pub const hir_analysis_multi_label: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("multi_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_transparent_non_zero_sized` from `hir_analysis`"]
    pub const hir_analysis_transparent_non_zero_sized:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_transparent_non_zero_sized"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_transparent_non_zero_sized.labels` from `hir_analysis`"]
    pub const hir_analysis_labels: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("labels"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_transparent_non_zero_sized_enum` from `hir_analysis`"]
    pub const hir_analysis_transparent_non_zero_sized_enum:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_transparent_non_zero_sized_enum"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_ty_of_assoc_const_binding_note` from `hir_analysis`"]
    pub const hir_analysis_ty_of_assoc_const_binding_note:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_ty_of_assoc_const_binding_note"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_ty_param_first_local` from `hir_analysis`"]
    pub const hir_analysis_ty_param_first_local: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_ty_param_first_local"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_ty_param_first_local.case_note` from `hir_analysis`"]
    pub const hir_analysis_case_note: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("case_note"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_ty_param_some` from `hir_analysis`"]
    pub const hir_analysis_ty_param_some: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_ty_param_some"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_ty_param_some.only_note` from `hir_analysis`"]
    pub const hir_analysis_only_note: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("only_note"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_type_of` from `hir_analysis`"]
    pub const hir_analysis_type_of: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_type_of"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_unconstrained_generic_parameter` from `hir_analysis`"]
    pub const hir_analysis_unconstrained_generic_parameter:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_unconstrained_generic_parameter"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_unconstrained_generic_parameter.const_param_note` from `hir_analysis`"]
    pub const hir_analysis_const_param_note: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("const_param_note"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_unconstrained_generic_parameter.const_param_note2` from `hir_analysis`"]
    pub const hir_analysis_const_param_note2: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("const_param_note2"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_unconstrained_opaque_type` from `hir_analysis`"]
    pub const hir_analysis_unconstrained_opaque_type:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_unconstrained_opaque_type"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_unrecognized_intrinsic_function` from `hir_analysis`"]
    pub const hir_analysis_unrecognized_intrinsic_function:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_unrecognized_intrinsic_function"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_unused_associated_type_bounds` from `hir_analysis`"]
    pub const hir_analysis_unused_associated_type_bounds:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_unused_associated_type_bounds"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_unused_generic_parameter` from `hir_analysis`"]
    pub const hir_analysis_unused_generic_parameter: rustc_errors::DiagMessage
        =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_unused_generic_parameter"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_unused_generic_parameter.const_param_help` from `hir_analysis`"]
    pub const hir_analysis_const_param_help: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("const_param_help"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_unused_generic_parameter.usage_spans` from `hir_analysis`"]
    pub const hir_analysis_usage_spans: rustc_errors::SubdiagMessage =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("usage_spans"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_unused_generic_parameter_adt_help` from `hir_analysis`"]
    pub const hir_analysis_unused_generic_parameter_adt_help:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_unused_generic_parameter_adt_help"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_unused_generic_parameter_adt_no_phantom_data_help` from `hir_analysis`"]
    pub const hir_analysis_unused_generic_parameter_adt_no_phantom_data_help:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_unused_generic_parameter_adt_no_phantom_data_help"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_unused_generic_parameter_ty_alias_help` from `hir_analysis`"]
    pub const hir_analysis_unused_generic_parameter_ty_alias_help:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_unused_generic_parameter_ty_alias_help"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_useless_impl_item` from `hir_analysis`"]
    pub const hir_analysis_useless_impl_item: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_useless_impl_item"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_value_of_associated_struct_already_specified` from `hir_analysis`"]
    pub const hir_analysis_value_of_associated_struct_already_specified:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_value_of_associated_struct_already_specified"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_value_of_associated_struct_already_specified.previous_bound_label` from `hir_analysis`"]
    pub const hir_analysis_previous_bound_label: rustc_errors::SubdiagMessage
        =
        rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("previous_bound_label"));
    #[doc =
    "Constant referring to Fluent message `hir_analysis_variadic_function_compatible_convention` from `hir_analysis`"]
    pub const hir_analysis_variadic_function_compatible_convention:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_variadic_function_compatible_convention"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_variances_of` from `hir_analysis`"]
    pub const hir_analysis_variances_of: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_variances_of"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_where_clause_on_main` from `hir_analysis`"]
    pub const hir_analysis_where_clause_on_main: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_where_clause_on_main"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_within_macro` from `hir_analysis`"]
    pub const hir_analysis_within_macro: rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_within_macro"),
            None);
    #[doc =
    "Constant referring to Fluent message `hir_analysis_wrong_number_of_generic_arguments_to_intrinsic` from `hir_analysis`"]
    pub const hir_analysis_wrong_number_of_generic_arguments_to_intrinsic:
        rustc_errors::DiagMessage =
        rustc_errors::DiagMessage::FluentIdentifier(std::borrow::Cow::Borrowed("hir_analysis_wrong_number_of_generic_arguments_to_intrinsic"),
            None);
    #[doc =
    r" Constants expected to exist by the diagnostic derive macros to use as default Fluent"]
    #[doc = r" identifiers for different subdiagnostic kinds."]
    pub mod _subdiag {
        #[doc = r" Default for `#[help]`"]
        pub const help: rustc_errors::SubdiagMessage =
            rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("help"));
        #[doc = r" Default for `#[note]`"]
        pub const note: rustc_errors::SubdiagMessage =
            rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("note"));
        #[doc = r" Default for `#[warn]`"]
        pub const warn: rustc_errors::SubdiagMessage =
            rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("warn"));
        #[doc = r" Default for `#[label]`"]
        pub const label: rustc_errors::SubdiagMessage =
            rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("label"));
        #[doc = r" Default for `#[suggestion]`"]
        pub const suggestion: rustc_errors::SubdiagMessage =
            rustc_errors::SubdiagMessage::FluentAttr(std::borrow::Cow::Borrowed("suggestion"));
    }
}rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
105
106fn check_c_variadic_abi(tcx: TyCtxt<'_>, decl: &hir::FnDecl<'_>, abi: ExternAbi, span: Span) {
107    if !decl.c_variadic {
108        // Not even a variadic function.
109        return;
110    }
111
112    match abi.supports_c_variadic() {
113        CVariadicStatus::Stable => {}
114        CVariadicStatus::NotSupported => {
115            tcx.dcx()
116                .create_err(errors::VariadicFunctionCompatibleConvention {
117                    span,
118                    convention: &::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("{0}", abi))
    })format!("{abi}"),
119                })
120                .emit();
121        }
122        CVariadicStatus::Unstable { feature } => {
123            if !tcx.features().enabled(feature) {
124                feature_err(
125                    &tcx.sess,
126                    feature,
127                    span,
128                    ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("C-variadic functions with the {0} calling convention are unstable",
                abi))
    })format!("C-variadic functions with the {abi} calling convention are unstable"),
129                )
130                .emit();
131            }
132        }
133    }
134}
135
136/// Adds query implementations to the [Providers] vtable, see [`rustc_middle::query`]
137pub fn provide(providers: &mut Providers) {
138    collect::provide(providers);
139    coherence::provide(providers);
140    check::provide(providers);
141    *providers = Providers {
142        check_unused_traits: check_unused::check_unused_traits,
143        diagnostic_hir_wf_check: hir_wf_check::diagnostic_hir_wf_check,
144        inferred_outlives_crate: outlives::inferred_outlives_crate,
145        inferred_outlives_of: outlives::inferred_outlives_of,
146        inherit_sig_for_delegation_item: delegation::inherit_sig_for_delegation_item,
147        enforce_impl_non_lifetime_params_are_constrained:
148            impl_wf_check::enforce_impl_non_lifetime_params_are_constrained,
149        crate_variances: variance::crate_variances,
150        variances_of: variance::variances_of,
151        ..*providers
152    };
153}
154
155fn emit_delayed_lint(lint: &DelayedLint, tcx: TyCtxt<'_>) {
156    match lint {
157        DelayedLint::AttributeParsing(attribute_lint) => {
158            tcx.node_span_lint(
159                attribute_lint.lint_id.lint,
160                attribute_lint.id,
161                attribute_lint.span,
162                |diag| {
163                    rustc_lint::decorate_attribute_lint(
164                        tcx.sess,
165                        Some(tcx),
166                        &attribute_lint.kind,
167                        diag,
168                    );
169                },
170            );
171        }
172    }
173}
174
175pub fn check_crate(tcx: TyCtxt<'_>) {
176    let _prof_timer = tcx.sess.timer("type_check_crate");
177
178    tcx.sess.time("coherence_checking", || {
179        // When discarding query call results, use an explicit type to indicate
180        // what we are intending to discard, to help future type-based refactoring.
181        type R = Result<(), ErrorGuaranteed>;
182
183        let _: R = tcx.ensure_ok().check_type_wf(());
184
185        for &trait_def_id in tcx.all_local_trait_impls(()).keys() {
186            let _: R = tcx.ensure_ok().coherent_trait(trait_def_id);
187        }
188        // these queries are executed for side-effects (error reporting):
189        let _: R = tcx.ensure_ok().crate_inherent_impls_validity_check(());
190        let _: R = tcx.ensure_ok().crate_inherent_impls_overlap_check(());
191    });
192
193    tcx.sess.time("emit_ast_lowering_delayed_lints", || {
194        // sanity check in debug mode that all lints are really noticed
195        // and we really will emit them all in the loop right below.
196        //
197        // during ast lowering, when creating items, foreign items, trait items and impl items
198        // we store in them whether they have any lints in their owner node that should be
199        // picked up by `hir_crate_items`. However, theoretically code can run between that
200        // boolean being inserted into the item and the owner node being created.
201        // We don't want any new lints to be emitted there
202        // (though honestly, you have to really try to manage to do that but still),
203        // but this check is there to catch that.
204        #[cfg(debug_assertions)]
205        {
206            // iterate over all owners
207            for owner_id in tcx.hir_crate_items(()).owners() {
208                // if it has delayed lints
209                if let Some(delayed_lints) = tcx.opt_ast_lowering_delayed_lints(owner_id) {
210                    if !delayed_lints.lints.is_empty() {
211                        // assert that delayed_lint_items also picked up this item to have lints
212                        if !tcx.hir_crate_items(()).delayed_lint_items().any(|i| i == owner_id) {
    ::core::panicking::panic("assertion failed: tcx.hir_crate_items(()).delayed_lint_items().any(|i| i == owner_id)")
};assert!(
213                            tcx.hir_crate_items(()).delayed_lint_items().any(|i| i == owner_id)
214                        );
215                    }
216                }
217            }
218        }
219
220        for owner_id in tcx.hir_crate_items(()).delayed_lint_items() {
221            if let Some(delayed_lints) = tcx.opt_ast_lowering_delayed_lints(owner_id) {
222                for lint in &delayed_lints.lints {
223                    emit_delayed_lint(lint, tcx);
224                }
225            }
226        }
227    });
228
229    tcx.par_hir_body_owners(|item_def_id| {
230        let def_kind = tcx.def_kind(item_def_id);
231        // Make sure we evaluate all static and (non-associated) const items, even if unused.
232        // If any of these fail to evaluate, we do not want this crate to pass compilation.
233        match def_kind {
234            DefKind::Static { .. } => {
235                tcx.ensure_ok().eval_static_initializer(item_def_id);
236                check::maybe_check_static_with_link_section(tcx, item_def_id);
237            }
238            DefKind::Const
239                if !tcx.generics_of(item_def_id).own_requires_monomorphization()
240                    && !{
    {
            'done:
                {
                for i in tcx.get_all_attrs(item_def_id) {
                    let i: &rustc_hir::Attribute = i;
                    match i {
                        rustc_hir::Attribute::Parsed(AttributeKind::TypeConst(_)) =>
                            {
                            break 'done Some(());
                        }
                        _ => {}
                    }
                }
                None
            }
        }.is_some()
}find_attr!(tcx.get_all_attrs(item_def_id), AttributeKind::TypeConst(_)) =>
241            {
242                // FIXME(generic_const_items): Passing empty instead of identity args is fishy but
243                //                             seems to be fine for now. Revisit this!
244                let instance = ty::Instance::new_raw(item_def_id.into(), ty::GenericArgs::empty());
245                let cid = GlobalId { instance, promoted: None };
246                let typing_env = ty::TypingEnv::fully_monomorphized();
247                tcx.ensure_ok().eval_to_const_value_raw(typing_env.as_query_input(cid));
248            }
249            _ => (),
250        }
251        // Skip `AnonConst`s because we feed their `type_of`.
252        // Also skip items for which typeck forwards to parent typeck.
253        if !(#[allow(non_exhaustive_omitted_patterns)] match def_kind {
    DefKind::AnonConst => true,
    _ => false,
}matches!(def_kind, DefKind::AnonConst) || def_kind.is_typeck_child()) {
254            tcx.ensure_ok().typeck(item_def_id);
255        }
256        // Ensure we generate the new `DefId` before finishing `check_crate`.
257        // Afterwards we freeze the list of `DefId`s.
258        if tcx.needs_coroutine_by_move_body_def_id(item_def_id.to_def_id()) {
259            tcx.ensure_done().coroutine_by_move_body_def_id(item_def_id);
260        }
261    });
262
263    if tcx.features().rustc_attrs() {
264        tcx.sess.time("dumping_rustc_attr_data", || {
265            outlives::dump::inferred_outlives(tcx);
266            variance::dump::variances(tcx);
267            collect::dump::opaque_hidden_types(tcx);
268            collect::dump::predicates_and_item_bounds(tcx);
269            collect::dump::def_parents(tcx);
270            collect::dump::vtables(tcx);
271        });
272    }
273
274    tcx.ensure_ok().check_unused_traits(());
275}
276
277/// Lower a [`hir::Ty`] to a [`Ty`].
278///
279/// <div class="warning">
280///
281/// This function is **quasi-deprecated**. It can cause ICEs if called inside of a body
282/// (of a function or constant) and especially if it contains inferred types (`_`).
283///
284/// It's used in rustdoc and Clippy.
285///
286/// </div>
287pub fn lower_ty<'tcx>(tcx: TyCtxt<'tcx>, hir_ty: &hir::Ty<'tcx>) -> Ty<'tcx> {
288    // In case there are any projections, etc., find the "environment"
289    // def-ID that will be used to determine the traits/predicates in
290    // scope. This is derived from the enclosing item-like thing.
291    let env_def_id = tcx.hir_get_parent_item(hir_ty.hir_id);
292    collect::ItemCtxt::new(tcx, env_def_id.def_id)
293        .lowerer()
294        .lower_ty_maybe_return_type_notation(hir_ty)
295}
296
297/// This is for rustdoc.
298// FIXME(const_generics): having special methods for rustdoc in `rustc_hir_analysis` is cursed
299pub fn lower_const_arg_for_rustdoc<'tcx>(
300    tcx: TyCtxt<'tcx>,
301    hir_ct: &hir::ConstArg<'tcx>,
302    ty: Ty<'tcx>,
303) -> Const<'tcx> {
304    let env_def_id = tcx.hir_get_parent_item(hir_ct.hir_id);
305    collect::ItemCtxt::new(tcx, env_def_id.def_id).lowerer().lower_const_arg(hir_ct, ty)
306}