Skip to main content

rustc_mir_transform/
elaborate_drop.rs

1use std::{fmt, iter, mem};
2
3use itertools::Itertools;
4use rustc_abi::{FIRST_VARIANT, FieldIdx, VariantIdx};
5use rustc_attr_ir::lang_items::LangItem;
6use rustc_hir::{CoroutineDesugaring, CoroutineKind};
7use rustc_index::Idx;
8use rustc_middle::mir::*;
9use rustc_middle::ty::adjustment::PointerCoercion;
10use rustc_middle::ty::util::{Discr, IntTypeExt};
11use rustc_middle::ty::{self, GenericArgs, Ty, TyCtxt};
12use rustc_mir_dataflow::DropFlagState;
13use rustc_span::{DUMMY_SP, bug, dummy_spanned, span_bug};
14use tracing::{debug, instrument};
15
16use crate::coroutine::CTX_ARG;
17use crate::patch::MirPatch;
18
19/// Describes how/if a value should be dropped.
20#[derive(#[automatically_derived]impl ::core::fmt::Debug for DropStyle {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                DropStyle::Dead => "Dead",
                DropStyle::Static => "Static",
                DropStyle::Conditional => "Conditional",
                DropStyle::Open => "Open",
            })
    }
}Debug)]
21pub(crate) enum DropStyle {
22    /// The value is already dead at the drop location, no drop will be executed.
23    Dead,
24
25    /// The value is known to always be initialized at the drop location, drop will always be
26    /// executed.
27    Static,
28
29    /// Whether the value needs to be dropped depends on its drop flag.
30    Conditional,
31
32    /// An "open" drop is one where only the fields of a value are dropped.
33    ///
34    /// For example, this happens when moving out of a struct field: The rest of the struct will be
35    /// dropped in such an "open" drop. It is also used to generate drop glue for the individual
36    /// components of a value, for example for dropping array elements.
37    Open,
38}
39
40/// Which drop flags to affect/check with an operation.
41#[derive(#[automatically_derived]impl ::core::fmt::Debug for DropFlagMode {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                DropFlagMode::Shallow => "Shallow",
                DropFlagMode::Deep => "Deep",
            })
    }
}Debug)]
42pub(crate) enum DropFlagMode {
43    /// Only affect the top-level drop flag, not that of any contained fields.
44    Shallow,
45    /// Affect all nested drop flags in addition to the top-level one.
46    Deep,
47}
48
49/// Describes if unwinding is necessary and where to unwind to if a panic occurs.
50#[derive(#[automatically_derived]impl ::core::marker::Copy for Unwind { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for Unwind {
}
#[automatically_derived]impl ::core::clone::Clone for Unwind {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<BasicBlock>;
        *self
    }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for Unwind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::To(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "To",
                    &__self_0),
            Self::InCleanup =>
                ::core::fmt::Formatter::write_str(f, "InCleanup"),
        }
    }
}Debug)]
51pub(crate) enum Unwind {
52    /// Unwind to this block.
53    To(BasicBlock),
54    /// Already in an unwind path, any panic will cause an abort.
55    InCleanup,
56}
57
58impl Unwind {
59    fn is_cleanup(self) -> bool {
60        match self {
61            Unwind::To(..) => false,
62            Unwind::InCleanup => true,
63        }
64    }
65
66    fn into_action(self) -> UnwindAction {
67        match self {
68            Unwind::To(bb) => UnwindAction::Cleanup(bb),
69            Unwind::InCleanup => UnwindAction::Terminate(UnwindTerminateReason::InCleanup),
70        }
71    }
72
73    fn map<F>(self, f: F) -> Self
74    where
75        F: FnOnce(BasicBlock) -> BasicBlock,
76    {
77        match self {
78            Unwind::To(bb) => Unwind::To(f(bb)),
79            Unwind::InCleanup => Unwind::InCleanup,
80        }
81    }
82}
83
84pub(crate) trait DropElaborator<'a, 'tcx>: fmt::Debug {
85    /// The type representing paths that can be moved out of.
86    ///
87    /// Users can move out of individual fields of a struct, such as `a.b.c`. This type is used to
88    /// represent such move paths. Sometimes tracking individual move paths is not necessary, in
89    /// which case this may be set to (for example) `()`.
90    type Path: Copy + fmt::Debug;
91
92    // Accessors
93
94    fn patch_ref(&self) -> &MirPatch<'tcx>;
95    fn patch(&mut self) -> &mut MirPatch<'tcx>;
96    fn body(&self) -> &'a Body<'tcx>;
97    fn tcx(&self) -> TyCtxt<'tcx>;
98    fn typing_env(&self) -> ty::TypingEnv<'tcx>;
99    fn allow_async_drops(&self) -> bool;
100
101    // Drop logic
102
103    /// Returns how `path` should be dropped, given `mode`.
104    fn drop_style(&self, path: Self::Path, mode: DropFlagMode) -> DropStyle;
105
106    /// Returns the drop flag of `path` as a MIR `Operand` (or `None` if `path` has no drop flag).
107    fn get_drop_flag(&mut self, path: Self::Path) -> Option<Operand<'tcx>>;
108
109    /// Return the drop flag of `path`, if any.
110    ///
111    /// If `mode` is deep, drop flags of all child paths should be returned.
112    fn drop_flags_for(&mut self, path: Self::Path, mode: DropFlagMode) -> Vec<Place<'tcx>>;
113
114    // Subpaths
115
116    /// Returns the subpath of a field of `path` (or `None` if there is no dedicated subpath).
117    ///
118    /// If this returns `None`, `field` will not get a dedicated drop flag.
119    fn field_subpath(&self, path: Self::Path, field: FieldIdx) -> Option<Self::Path>;
120
121    /// Returns the subpath of a dereference of `path` (or `None` if there is no dedicated subpath).
122    ///
123    /// If this returns `None`, `*path` will not get a dedicated drop flag.
124    ///
125    /// This is only relevant for `Box<T>`, where the contained `T` can be moved out of the box.
126    fn deref_subpath(&self, path: Self::Path) -> Option<Self::Path>;
127
128    /// Returns the subpath of downcasting `path` to one of its variants.
129    ///
130    /// If this returns `None`, the downcast of `path` will not get a dedicated drop flag.
131    fn downcast_subpath(&self, path: Self::Path, variant: VariantIdx) -> Option<Self::Path>;
132
133    /// Returns the subpath of indexing a fixed-size array `path`.
134    ///
135    /// If this returns `None`, elements of `path` will not get a dedicated drop flag.
136    ///
137    /// This is only relevant for array patterns, which can move out of individual array elements.
138    fn array_subpath(&self, path: Self::Path, index: u64, size: u64) -> Option<Self::Path>;
139}
140
141#[derive(#[automatically_derived]impl<'a, 'b, 'tcx, D: ::core::fmt::Debug>
    ::core::fmt::Debug for DropCtxt<'a, 'b, 'tcx, D> where
    D: DropElaborator<'b, 'tcx>, D::Path: ::core::fmt::Debug {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        let names: &'static _ =
            "DropCtxt elaborator source_info place path succ unwind dropline";
        let values: &[&dyn ::core::fmt::Debug] =
            &[&self.elaborator, &self.source_info, &self.place, &self.path,
                        &self.succ, &self.unwind, &&self.dropline];
        ::core::fmt::Formatter::debug_struct_fields_finish(f, names, values)
    }
}Debug)]
142struct DropCtxt<'a, 'b, 'tcx, D>
143where
144    D: DropElaborator<'b, 'tcx>,
145{
146    elaborator: &'a mut D,
147
148    source_info: SourceInfo,
149
150    place: Place<'tcx>,
151    path: D::Path,
152    succ: BasicBlock,
153    unwind: Unwind,
154    dropline: Option<BasicBlock>,
155}
156
157/// "Elaborates" a drop of `place`/`path` and patches `bb`'s terminator to execute it.
158///
159/// The passed `elaborator` is used to determine what should happen at the drop terminator. It
160/// decides whether the drop can be statically determined or whether it needs a dynamic drop flag,
161/// and whether the drop is "open", i.e. should be expanded to drop all subfields of the dropped
162/// value.
163///
164/// When this returns, the MIR patch in the `elaborator` contains the necessary changes.
165pub(crate) fn elaborate_drop<'b, 'tcx, D>(
166    elaborator: &mut D,
167    source_info: SourceInfo,
168    place: Place<'tcx>,
169    path: D::Path,
170    succ: BasicBlock,
171    unwind: Unwind,
172    bb: BasicBlock,
173    dropline: Option<BasicBlock>,
174) where
175    D: DropElaborator<'b, 'tcx>,
176    'tcx: 'b,
177{
178    DropCtxt { elaborator, source_info, place, path, succ, unwind, dropline }.elaborate_drop(bb)
179}
180
181impl<'a, 'b, 'tcx, D> DropCtxt<'a, 'b, 'tcx, D>
182where
183    D: DropElaborator<'b, 'tcx>,
184    'tcx: 'b,
185{
186    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::TRACE <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::TRACE <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("place_ty",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::TRACE,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(186u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("place")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("place");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::TRACE <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::TRACE <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&place)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: Ty<'tcx> = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        if place.local <
                                self.elaborator.body().local_decls.next_index() {
                            place.ty(self.elaborator.body(), self.tcx()).ty
                        } else {
                            PlaceTy::from_ty(self.elaborator.patch_ref().local_ty(place.local)).multi_projection_ty(self.elaborator.tcx(),
                                    place.projection).ty
                        }
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:186",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::TRACE,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(186u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::TRACE <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::TRACE <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "trace", skip(self), ret)]
187    fn place_ty(&self, place: Place<'tcx>) -> Ty<'tcx> {
188        if place.local < self.elaborator.body().local_decls.next_index() {
189            place.ty(self.elaborator.body(), self.tcx()).ty
190        } else {
191            // We don't have a slice with all the locals, since some are in the patch.
192            PlaceTy::from_ty(self.elaborator.patch_ref().local_ty(place.local))
193                .multi_projection_ty(self.elaborator.tcx(), place.projection)
194                .ty
195        }
196    }
197
198    fn tcx(&self) -> TyCtxt<'tcx> {
199        self.elaborator.tcx()
200    }
201
202    /// Async-drop `place: drop_ty`.
203    ///
204    /// Conceptually, we want to run `async_drop_in_place(&mut obj).await`.
205    ///
206    /// Await syntax does not exist in MIR, so we need to manually expand it into a poll-yield
207    /// loop, essentially:
208    /// ```mir
209    ///   let fut = async_drop_in_place(&mut obj);
210    ///   loop {
211    ///     let pin_fut = Pin::new_unchecked(&mut fut);
212    ///     match Future::poll(pin_fut, CTX_ARG) {
213    ///       Poll::Ready => break,
214    ///       Poll::Pending(..) => CTX_ARG = yield (),
215    ///     }
216    ///   }
217    ///   // continue to `succ`
218    /// ```
219    ///
220    /// We also need to ensure that async drop also happens on the coroutine drop path, ie. when
221    /// `yield` branches along its `drop` target. This requires a second loop, this time jumping to
222    /// `dropline`.
223    ///
224    /// Arguments:
225    ///   `call_destructor_only`: call only `AsyncDrop::drop`, not full `async_drop_in_place` glue
226    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::DEBUG <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("build_async_drop",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::DEBUG,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(226u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("place")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("place");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("drop_ty")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("drop_ty");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("succ")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("succ");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("unwind")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("unwind");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("dropline")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("dropline");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("call_destructor_only")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("call_destructor_only");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&place)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&drop_ty)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&succ)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&unwind)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&dropline)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&call_destructor_only
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: BasicBlock = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        let tcx = self.tcx();
                        let span = self.source_info.span;
                        let obj_ref_ty =
                            Ty::new_mut_ref(tcx, tcx.lifetimes.re_erased, drop_ty);
                        let async_drop_fn_def_id =
                            if call_destructor_only {
                                let async_drop_trait =
                                    tcx.require_lang_item(LangItem::AsyncDrop, span);
                                tcx.associated_item_def_ids(async_drop_trait)[0]
                            } else {
                                tcx.require_lang_item(LangItem::AsyncDropInPlace, span)
                            };
                        let fut_ty =
                            tcx.instantiate_bound_regions_with_erased(tcx.fn_sig(async_drop_fn_def_id).instantiate(tcx,
                                            &[drop_ty.into()]).skip_norm_wip()).output();
                        let fut = self.new_temp(fut_ty);
                        let succ_with_dead =
                            self.new_block_with_statements(unwind,
                                ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                                        [self.storage_dead(fut)])), TerminatorKind::goto(succ));
                        let dropline_with_dead =
                            dropline.map(|target|
                                    {
                                        self.new_block_with_statements(unwind,
                                            ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                                                    [self.storage_dead(fut)])), TerminatorKind::goto(target))
                                    });
                        let unwind_with_dead =
                            unwind.map(|target|
                                    {
                                        self.new_block_with_statements(Unwind::InCleanup,
                                            ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                                                    [self.storage_dead(fut)])), TerminatorKind::goto(target))
                                    });
                        let coroutine_kind =
                            self.elaborator.body().coroutine_kind().unwrap();
                        let yield_value =
                            match coroutine_kind {
                                CoroutineKind::Desugared(CoroutineDesugaring::AsyncGen, _)
                                    => {
                                    let full_yield_ty =
                                        self.elaborator.body().yield_ty().unwrap();
                                    let ty::Adt(_poll_adt, args) =
                                        *full_yield_ty.kind() else {
                                            ::rustc_span::macros::bug_impl(None,
                                                format_args!("impossible case reached"), Location::caller())
                                        };
                                    let ty::Adt(_option_adt, args) =
                                        *args.type_at(0).kind() else {
                                            ::rustc_span::macros::bug_impl(None,
                                                format_args!("impossible case reached"), Location::caller())
                                        };
                                    let yield_ty = args.type_at(0);
                                    Operand::unevaluated_constant(tcx,
                                        tcx.require_lang_item(LangItem::AsyncGenPending, span),
                                        tcx.mk_args(&[yield_ty.into()]), span)
                                }
                                CoroutineKind::Desugared(CoroutineDesugaring::Async, _) => {
                                    Operand::zero_sized_constant(tcx.types.unit, span)
                                }
                                _ => {
                                    ::core::panicking::panic_fmt(format_args!("unexpected coroutine for async drop {0:?}",
                                            coroutine_kind));
                                }
                            };
                        let panic_bb =
                            self.build_resumed_after_drop_abort_block(unwind_with_dead,
                                coroutine_kind);
                        let (drop_pin_bb, drop_resume_bb, drop_drop_bb) =
                            self.build_pin_poll_yield_loop(CTX_ARG.into(), fut.into(),
                                yield_value.clone(),
                                dropline_with_dead.unwrap_or(succ_with_dead),
                                unwind_with_dead);
                        self.elaborator.patch().patch_terminator(drop_resume_bb,
                            TerminatorKind::goto(panic_bb));
                        self.elaborator.patch().patch_terminator(drop_drop_bb,
                            TerminatorKind::goto(drop_pin_bb));
                        let succ_yield_loop =
                            if dropline_with_dead.is_some() {
                                let (pin_bb, resume_bb, drop_bb) =
                                    self.build_pin_poll_yield_loop(CTX_ARG.into(), fut.into(),
                                        yield_value, succ_with_dead, unwind_with_dead);
                                self.elaborator.patch().patch_terminator(resume_bb,
                                    TerminatorKind::goto(pin_bb));
                                self.elaborator.patch().patch_terminator(drop_bb,
                                    TerminatorKind::goto(drop_pin_bb));
                                pin_bb
                            } else { drop_pin_bb };
                        let pin_adt_def =
                            tcx.adt_def(tcx.require_lang_item(LangItem::Pin, span));
                        let pin_obj_ty =
                            Ty::new_adt(tcx, pin_adt_def,
                                tcx.mk_args(&[obj_ref_ty.into()]));
                        let pin_obj_local = self.new_temp(pin_obj_ty);
                        let drop_arg =
                            if call_destructor_only {
                                Operand::Move(pin_obj_local.into())
                            } else {
                                Operand::Copy(tcx.mk_place_field(pin_obj_local.into(),
                                        FieldIdx::ZERO, obj_ref_ty))
                            };
                        let call_drop_bb =
                            self.new_block_with_statements(unwind_with_dead,
                                ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                                        [self.storage_live(fut)])),
                                TerminatorKind::Call {
                                    func: Operand::function_handle(tcx, async_drop_fn_def_id,
                                        &[drop_ty.into()], span),
                                    args: [dummy_spanned(drop_arg)].into(),
                                    destination: fut.into(),
                                    target: Some(succ_yield_loop),
                                    unwind: unwind_with_dead.into_action(),
                                    call_source: CallSource::Misc,
                                    fn_span: self.source_info.span,
                                });
                        let obj_ref_place = Place::from(self.new_temp(obj_ref_ty));
                        let pin_obj_new_unchecked_fn =
                            tcx.require_lang_item(LangItem::PinNewUnchecked, span);
                        let assign_obj_ref_place =
                            self.assign(obj_ref_place,
                                Rvalue::Ref(tcx.lifetimes.re_erased,
                                    BorrowKind::Mut { kind: MutBorrowKind::Default }, place));
                        self.new_block_with_statements(unwind,
                            ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                                    [assign_obj_ref_place])),
                            TerminatorKind::Call {
                                func: Operand::function_handle(tcx,
                                    pin_obj_new_unchecked_fn, &[obj_ref_ty.into()], span),
                                args: [dummy_spanned(Operand::Move(obj_ref_place))].into(),
                                destination: pin_obj_local.into(),
                                target: Some(call_drop_bb),
                                unwind: unwind.into_action(),
                                call_source: CallSource::Misc,
                                fn_span: span,
                            })
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:226",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(226u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "debug", skip(self), ret)]
227    fn build_async_drop(
228        &mut self,
229        place: Place<'tcx>,
230        drop_ty: Ty<'tcx>,
231        succ: BasicBlock,
232        unwind: Unwind,
233        dropline: Option<BasicBlock>,
234        call_destructor_only: bool,
235    ) -> BasicBlock {
236        let tcx = self.tcx();
237        let span = self.source_info.span;
238        let obj_ref_ty = Ty::new_mut_ref(tcx, tcx.lifetimes.re_erased, drop_ty);
239
240        let async_drop_fn_def_id = if call_destructor_only {
241            // Resolving obj.<AsyncDrop::drop>()
242            let async_drop_trait = tcx.require_lang_item(LangItem::AsyncDrop, span);
243            tcx.associated_item_def_ids(async_drop_trait)[0]
244        } else {
245            // Resolving async_drop_in_place<T> function for drop_ty
246            tcx.require_lang_item(LangItem::AsyncDropInPlace, span)
247        };
248
249        let fut_ty = tcx
250            .instantiate_bound_regions_with_erased(
251                tcx.fn_sig(async_drop_fn_def_id)
252                    .instantiate(tcx, &[drop_ty.into()])
253                    .skip_norm_wip(),
254            )
255            .output();
256        let fut = self.new_temp(fut_ty);
257
258        // Create an intermediate block that does StorageDead(fut) then jumps to succ.
259        // This is necessary because we do not want to modify statements
260        // in existing blocks, in case those are used somewhere else in MIR.
261        let succ_with_dead = self.new_block_with_statements(
262            unwind,
263            vec![self.storage_dead(fut)],
264            TerminatorKind::goto(succ),
265        );
266        let dropline_with_dead = dropline.map(|target| {
267            self.new_block_with_statements(
268                unwind,
269                vec![self.storage_dead(fut)],
270                TerminatorKind::goto(target),
271            )
272        });
273        let unwind_with_dead = unwind.map(|target| {
274            self.new_block_with_statements(
275                Unwind::InCleanup,
276                vec![self.storage_dead(fut)],
277                TerminatorKind::goto(target),
278            )
279        });
280
281        // The yielded value depends on the kind of coroutine, to match what AST lowering does.
282        let coroutine_kind = self.elaborator.body().coroutine_kind().unwrap();
283        let yield_value = match coroutine_kind {
284            // For async gen, we need `yield Poll<OptRet>::Pending`.
285            CoroutineKind::Desugared(CoroutineDesugaring::AsyncGen, _) => {
286                let full_yield_ty = self.elaborator.body().yield_ty().unwrap();
287                let ty::Adt(_poll_adt, args) = *full_yield_ty.kind() else { bug!() };
288                let ty::Adt(_option_adt, args) = *args.type_at(0).kind() else { bug!() };
289                let yield_ty = args.type_at(0);
290                Operand::unevaluated_constant(
291                    tcx,
292                    tcx.require_lang_item(LangItem::AsyncGenPending, span),
293                    tcx.mk_args(&[yield_ty.into()]),
294                    span,
295                )
296            }
297            // For regular async fn, we need `yield ()`.
298            CoroutineKind::Desugared(CoroutineDesugaring::Async, _) => {
299                Operand::zero_sized_constant(tcx.types.unit, span)
300            }
301            // `is_async_drop` should have checked that.
302            _ => panic!("unexpected coroutine for async drop {coroutine_kind:?}"),
303        };
304
305        // The branching here is tricky and deserves some explanation.
306        //
307        // If we are in the drop code path, ie. we are currently dropping the coroutine.
308        // The state machine follows the `drop` branch in the `yield` terminator.
309        // To repeatedly poll the future, the `drop` branch must loop.
310        // Meanwhile, the `resume` branch corresponds to anomalous execution,
311        // trying to resume the coroutine while it is being dropped. So that branch panics
312        // (`panic_bb`).
313        let panic_bb = self.build_resumed_after_drop_abort_block(unwind_with_dead, coroutine_kind);
314        let (drop_pin_bb, drop_resume_bb, drop_drop_bb) = self.build_pin_poll_yield_loop(
315            CTX_ARG.into(),
316            fut.into(),
317            yield_value.clone(),
318            // If `dropline_with_dead` is set, it points to the continuation of the drop execution.
319            // Otherwise, we are already dropping the coroutine, and `succ_with_dead` does.
320            dropline_with_dead.unwrap_or(succ_with_dead),
321            unwind_with_dead,
322        );
323        self.elaborator.patch().patch_terminator(drop_resume_bb, TerminatorKind::goto(panic_bb));
324        self.elaborator.patch().patch_terminator(drop_drop_bb, TerminatorKind::goto(drop_pin_bb));
325
326        // If we are in the regular code path, `dropline_with_dead` is `Some`.
327        //
328        // In that case, the logic is reversed. Normal execution branches on `resume` from the
329        // `yield` terminator. To repeatedly poll the future, that `resume` branch must loop.
330        // When the future is dropped, the `yield` terminator branches to `drop`, which follows to
331        // the previous loop `drop_pin_bb`.
332        let succ_yield_loop = if dropline_with_dead.is_some() {
333            let (pin_bb, resume_bb, drop_bb) = self.build_pin_poll_yield_loop(
334                CTX_ARG.into(),
335                fut.into(),
336                yield_value,
337                // `dropline_with_dead` is `Some`, so the previous loop point to it.
338                succ_with_dead,
339                unwind_with_dead,
340            );
341            self.elaborator.patch().patch_terminator(resume_bb, TerminatorKind::goto(pin_bb));
342            self.elaborator.patch().patch_terminator(drop_bb, TerminatorKind::goto(drop_pin_bb));
343            pin_bb
344        } else {
345            // We were already in the drop line, so return the loop we created for it.
346            drop_pin_bb
347        };
348
349        // #2:call_drop_bb >>>
350        //    call AsyncDrop::drop(pin_obj)
351        // OR call async_drop_in_place(pin_obj.pointer)
352        let pin_adt_def = tcx.adt_def(tcx.require_lang_item(LangItem::Pin, span));
353        let pin_obj_ty = Ty::new_adt(tcx, pin_adt_def, tcx.mk_args(&[obj_ref_ty.into()]));
354        // Where we store the result of Pin<&drop_ty>::new_unchecked(&mut place).
355        let pin_obj_local = self.new_temp(pin_obj_ty);
356        let drop_arg = if call_destructor_only {
357            // `AsyncDrop::drop` takes `self: Pin<&mut Self>`.
358            Operand::Move(pin_obj_local.into())
359        } else {
360            // `async_drop_in_place` takes `obj: &mut T`.
361            Operand::Copy(tcx.mk_place_field(pin_obj_local.into(), FieldIdx::ZERO, obj_ref_ty))
362        };
363        let call_drop_bb = self.new_block_with_statements(
364            unwind_with_dead,
365            vec![self.storage_live(fut)],
366            TerminatorKind::Call {
367                func: Operand::function_handle(tcx, async_drop_fn_def_id, &[drop_ty.into()], span),
368                args: [dummy_spanned(drop_arg)].into(),
369                destination: fut.into(),
370                target: Some(succ_yield_loop),
371                unwind: unwind_with_dead.into_action(),
372                call_source: CallSource::Misc,
373                fn_span: self.source_info.span,
374            },
375        );
376
377        // #1:pin_obj_bb >>> call Pin<ObjTy>::new_unchecked(&mut obj)
378        let obj_ref_place = Place::from(self.new_temp(obj_ref_ty));
379        let pin_obj_new_unchecked_fn = tcx.require_lang_item(LangItem::PinNewUnchecked, span);
380        let assign_obj_ref_place = self.assign(
381            obj_ref_place,
382            Rvalue::Ref(
383                tcx.lifetimes.re_erased,
384                BorrowKind::Mut { kind: MutBorrowKind::Default },
385                place,
386            ),
387        );
388        self.new_block_with_statements(
389            unwind,
390            vec![assign_obj_ref_place],
391            TerminatorKind::Call {
392                func: Operand::function_handle(
393                    tcx,
394                    pin_obj_new_unchecked_fn,
395                    &[obj_ref_ty.into()],
396                    span,
397                ),
398                args: [dummy_spanned(Operand::Move(obj_ref_place))].into(),
399                destination: pin_obj_local.into(),
400                target: Some(call_drop_bb),
401                unwind: unwind.into_action(),
402                call_source: CallSource::Misc,
403                fn_span: span,
404            },
405        )
406    }
407
408    fn build_resumed_after_drop_abort_block(
409        &mut self,
410        unwind: Unwind,
411        coroutine_kind: CoroutineKind,
412    ) -> BasicBlock {
413        let tcx = self.tcx();
414        let panic_bb = self.new_block(unwind, TerminatorKind::Unreachable);
415        let msg = AssertMessage::ResumedAfterDrop(coroutine_kind);
416        let false_op = Operand::Constant(Box::new(ConstOperand {
417            span: self.source_info.span,
418            user_ty: None,
419            const_: Const::from_bool(tcx, false),
420        }));
421        self.elaborator.patch().patch_terminator(
422            panic_bb,
423            TerminatorKind::Assert {
424                cond: false_op,
425                expected: true,
426                msg: Box::new(msg),
427                target: panic_bb,
428                unwind: unwind.into_action(),
429            },
430        );
431        panic_bb
432    }
433
434    /// Build a small MIR loop that pins and polls a future, yielding when
435    /// the future returns `Poll::Pending` and continuing to `ready_target`
436    /// when it returns `Poll::Ready`.
437    ///
438    /// Pseudo-code:
439    /// ```mir
440    /// pin_bb:
441    ///   let pin_fut = Pin::new_unchecked(&mut fut_place);
442    ///   match Future::poll(pin_fut, CTX_ARG) {
443    ///     Poll::Ready => goto succ,
444    ///     Poll::Pending(..) => CTX_ARG = yield () [resume: resume_bb, drop: drop_bb],
445    ///   }
446    /// ```
447    ///
448    ///  Returns: the tuple `(pin_bb, resume_bb, drop_bb)`.
449    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::TRACE <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::TRACE <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("build_pin_poll_yield_loop",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::TRACE,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(449u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("resume_place")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("resume_place");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("fut_place")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("fut_place");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("yield_value")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("yield_value");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("succ")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("succ");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("unwind")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("unwind");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::TRACE <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::TRACE <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&resume_place)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&fut_place)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&yield_value)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&succ)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&unwind)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return:
                                (BasicBlock, BasicBlock, BasicBlock) = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        let tcx = self.tcx();
                        let source_info = self.source_info;
                        let resume_arg_ty =
                            resume_place.ty(self.elaborator.body(), tcx).ty;
                        let context_ref_ty = Ty::new_task_context(tcx);
                        let poll_adt_def =
                            tcx.adt_def(tcx.require_lang_item(LangItem::Poll,
                                    source_info.span));
                        let poll_enum =
                            Ty::new_adt(tcx, poll_adt_def,
                                tcx.mk_args(&[tcx.types.unit.into()]));
                        let fut_ty =
                            self.elaborator.patch_ref().local_ty(fut_place.local);
                        let fut_ref_ty =
                            Ty::new_mut_ref(tcx, tcx.lifetimes.re_erased, fut_ty);
                        let pin_adt_def =
                            tcx.adt_def(tcx.require_lang_item(LangItem::Pin,
                                    source_info.span));
                        let fut_pin_ty =
                            Ty::new_adt(tcx, pin_adt_def,
                                tcx.mk_args(&[fut_ref_ty.into()]));
                        let yield_resume_local = self.new_temp(resume_arg_ty);
                        let resume_bb =
                            self.new_block_with_statements(unwind,
                                ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                                        [self.assign(resume_place,
                                                    Rvalue::Use(Operand::Move(yield_resume_local.into()),
                                                        WithRetag::Yes)), self.storage_dead(yield_resume_local)])),
                                TerminatorKind::Unreachable);
                        let dropline_bb =
                            self.new_block_with_statements(unwind,
                                ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                                        [self.assign(resume_place,
                                                    Rvalue::Use(Operand::Move(yield_resume_local.into()),
                                                        WithRetag::Yes)), self.storage_dead(yield_resume_local)])),
                                TerminatorKind::Unreachable);
                        let yield_bb =
                            self.new_block_with_statements(unwind,
                                ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                                        [self.storage_live(yield_resume_local)])),
                                TerminatorKind::Yield {
                                    value: yield_value,
                                    resume: resume_bb,
                                    resume_arg: yield_resume_local.into(),
                                    drop: Some(dropline_bb),
                                });
                        let poll_unit_local = self.new_temp(poll_enum);
                        let switch_bb =
                            {
                                let poll_ready_variant =
                                    tcx.require_lang_item(LangItem::PollReady,
                                        self.source_info.span);
                                let poll_ready_variant_idx =
                                    poll_adt_def.variant_index_with_id(poll_ready_variant);
                                let poll_pending_variant =
                                    tcx.require_lang_item(LangItem::PollPending,
                                        self.source_info.span);
                                let poll_pending_variant_idx =
                                    poll_adt_def.variant_index_with_id(poll_pending_variant);
                                let Discr { val: poll_ready_discr, ty: poll_discr_ty } =
                                    poll_enum.discriminant_for_variant(tcx,
                                            poll_ready_variant_idx).unwrap();
                                let Discr { val: poll_pending_discr, ty: _ } =
                                    poll_enum.discriminant_for_variant(tcx,
                                            poll_pending_variant_idx).unwrap();
                                let poll_discr_local = self.new_temp(poll_discr_ty);
                                let otherwise_bb =
                                    self.elaborator.patch().unreachable_no_cleanup_block();
                                self.new_block_with_statements(unwind,
                                    ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                                            [self.assign(poll_discr_local.into(),
                                                        Rvalue::Discriminant(poll_unit_local.into()))])),
                                    TerminatorKind::SwitchInt {
                                        discr: Operand::Move(poll_discr_local.into()),
                                        targets: SwitchTargets::new([(poll_ready_discr, succ),
                                                        (poll_pending_discr, yield_bb)].into_iter(), otherwise_bb),
                                    })
                            };
                        let fut_pin_local = self.new_temp(fut_pin_ty);
                        let context_ref_local = self.new_temp(context_ref_ty);
                        let poll_fn =
                            tcx.require_lang_item(LangItem::FuturePoll,
                                source_info.span);
                        let poll_bb =
                            self.new_block_with_statements(unwind, Vec::new(),
                                TerminatorKind::Call {
                                    func: Operand::function_handle(tcx, poll_fn,
                                        &[fut_ty.into()], source_info.span),
                                    args: [dummy_spanned(Operand::Move(fut_pin_local.into())),
                                                dummy_spanned(Operand::Move(context_ref_local.into()))].into(),
                                    destination: poll_unit_local.into(),
                                    target: Some(switch_bb),
                                    unwind: unwind.into_action(),
                                    call_source: CallSource::Misc,
                                    fn_span: source_info.span,
                                });
                        let get_context_fn =
                            tcx.require_lang_item(LangItem::GetContext,
                                source_info.span);
                        let get_context_bb =
                            {
                                let entry_resume_local = self.new_temp(resume_arg_ty);
                                self.new_block_with_statements(unwind,
                                    ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                                            [self.assign(entry_resume_local.into(),
                                                        Rvalue::Use(Operand::Move(resume_place),
                                                            WithRetag::Yes))])),
                                    TerminatorKind::Call {
                                        func: Operand::function_handle(tcx, get_context_fn,
                                            &[tcx.lifetimes.re_erased.into(),
                                                        tcx.lifetimes.re_erased.into()], source_info.span),
                                        args: [dummy_spanned(Operand::Move(entry_resume_local.into()))].into(),
                                        destination: context_ref_local.into(),
                                        target: Some(poll_bb),
                                        unwind: unwind.into_action(),
                                        call_source: CallSource::Misc,
                                        fn_span: source_info.span,
                                    })
                            };
                        let fut_ref_local = self.new_temp(fut_ref_ty);
                        let fut_pin_new_unchecked_fn =
                            tcx.require_lang_item(LangItem::PinNewUnchecked,
                                source_info.span);
                        let pin_bb =
                            self.new_block_with_statements(unwind,
                                ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                                        [self.assign(fut_ref_local.into(),
                                                    Rvalue::Ref(tcx.lifetimes.re_erased,
                                                        BorrowKind::Mut { kind: MutBorrowKind::Default },
                                                        fut_place))])),
                                TerminatorKind::Call {
                                    func: Operand::function_handle(tcx,
                                        fut_pin_new_unchecked_fn, &[fut_ref_ty.into()],
                                        source_info.span),
                                    args: [dummy_spanned(Operand::Move(fut_ref_local.into()))].into(),
                                    destination: fut_pin_local.into(),
                                    target: Some(get_context_bb),
                                    unwind: unwind.into_action(),
                                    call_source: CallSource::Misc,
                                    fn_span: source_info.span,
                                });
                        (pin_bb, resume_bb, dropline_bb)
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:449",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::TRACE,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(449u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::TRACE <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::TRACE <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "trace", skip(self), ret)]
450    fn build_pin_poll_yield_loop(
451        &mut self,
452        resume_place: Place<'tcx>,
453        fut_place: Place<'tcx>,
454        yield_value: Operand<'tcx>,
455        succ: BasicBlock,
456        unwind: Unwind,
457    ) -> (BasicBlock, BasicBlock, BasicBlock) {
458        let tcx = self.tcx();
459        let source_info = self.source_info;
460
461        let resume_arg_ty = resume_place.ty(self.elaborator.body(), tcx).ty;
462        let context_ref_ty = Ty::new_task_context(tcx);
463
464        let poll_adt_def = tcx.adt_def(tcx.require_lang_item(LangItem::Poll, source_info.span));
465        let poll_enum = Ty::new_adt(tcx, poll_adt_def, tcx.mk_args(&[tcx.types.unit.into()]));
466
467        let fut_ty = self.elaborator.patch_ref().local_ty(fut_place.local);
468        let fut_ref_ty = Ty::new_mut_ref(tcx, tcx.lifetimes.re_erased, fut_ty);
469
470        let pin_adt_def = tcx.adt_def(tcx.require_lang_item(LangItem::Pin, source_info.span));
471        let fut_pin_ty = Ty::new_adt(tcx, pin_adt_def, tcx.mk_args(&[fut_ref_ty.into()]));
472
473        // Coroutine `transform_async_context` assumes that the local `resume_arg` to a yield
474        // is not used once, so create a special temp for it.
475        let yield_resume_local = self.new_temp(resume_arg_ty);
476        let resume_bb = self.new_block_with_statements(
477            unwind,
478            vec![
479                self.assign(
480                    resume_place,
481                    Rvalue::Use(Operand::Move(yield_resume_local.into()), WithRetag::Yes),
482                ),
483                self.storage_dead(yield_resume_local),
484            ],
485            // This will be transformed by the caller.
486            TerminatorKind::Unreachable,
487        );
488        let dropline_bb = self.new_block_with_statements(
489            unwind,
490            vec![
491                self.assign(
492                    resume_place,
493                    Rvalue::Use(Operand::Move(yield_resume_local.into()), WithRetag::Yes),
494                ),
495                self.storage_dead(yield_resume_local),
496            ],
497            // This will be transformed by the caller.
498            TerminatorKind::Unreachable,
499        );
500        let yield_bb = self.new_block_with_statements(
501            unwind,
502            vec![self.storage_live(yield_resume_local)],
503            TerminatorKind::Yield {
504                value: yield_value,
505                resume: resume_bb,
506                resume_arg: yield_resume_local.into(),
507                drop: Some(dropline_bb),
508            },
509        );
510
511        let poll_unit_local = self.new_temp(poll_enum);
512        let switch_bb = {
513            let poll_ready_variant =
514                tcx.require_lang_item(LangItem::PollReady, self.source_info.span);
515            let poll_ready_variant_idx = poll_adt_def.variant_index_with_id(poll_ready_variant);
516            let poll_pending_variant =
517                tcx.require_lang_item(LangItem::PollPending, self.source_info.span);
518            let poll_pending_variant_idx = poll_adt_def.variant_index_with_id(poll_pending_variant);
519
520            let Discr { val: poll_ready_discr, ty: poll_discr_ty } =
521                poll_enum.discriminant_for_variant(tcx, poll_ready_variant_idx).unwrap();
522            let Discr { val: poll_pending_discr, ty: _ } =
523                poll_enum.discriminant_for_variant(tcx, poll_pending_variant_idx).unwrap();
524
525            let poll_discr_local = self.new_temp(poll_discr_ty);
526            let otherwise_bb = self.elaborator.patch().unreachable_no_cleanup_block();
527            self.new_block_with_statements(
528                unwind,
529                vec![
530                    self.assign(
531                        poll_discr_local.into(),
532                        Rvalue::Discriminant(poll_unit_local.into()),
533                    ),
534                ],
535                TerminatorKind::SwitchInt {
536                    discr: Operand::Move(poll_discr_local.into()),
537                    targets: SwitchTargets::new(
538                        [
539                            // on `Ready`, exit the loop, jump to `succ`
540                            (poll_ready_discr, succ),
541                            // on `Pending`, yield and resume back into the loop
542                            (poll_pending_discr, yield_bb),
543                        ]
544                        .into_iter(),
545                        // otherwise: unreachable
546                        otherwise_bb,
547                    ),
548                },
549            )
550        };
551
552        let fut_pin_local = self.new_temp(fut_pin_ty);
553        let context_ref_local = self.new_temp(context_ref_ty);
554
555        let poll_fn = tcx.require_lang_item(LangItem::FuturePoll, source_info.span);
556        let poll_bb = self.new_block_with_statements(
557            unwind,
558            Vec::new(),
559            TerminatorKind::Call {
560                func: Operand::function_handle(tcx, poll_fn, &[fut_ty.into()], source_info.span),
561                args: [
562                    dummy_spanned(Operand::Move(fut_pin_local.into())),
563                    dummy_spanned(Operand::Move(context_ref_local.into())),
564                ]
565                .into(),
566                destination: poll_unit_local.into(),
567                target: Some(switch_bb),
568                unwind: unwind.into_action(),
569                call_source: CallSource::Misc,
570                fn_span: source_info.span,
571            },
572        );
573
574        let get_context_fn = tcx.require_lang_item(LangItem::GetContext, source_info.span);
575        let get_context_bb = {
576            // Coroutine `transform_async_context` assumes that the local argument to `GetContext`
577            // is not used once, so create a special temp for it.
578            let entry_resume_local = self.new_temp(resume_arg_ty);
579            self.new_block_with_statements(
580                unwind,
581                vec![self.assign(
582                    entry_resume_local.into(),
583                    Rvalue::Use(Operand::Move(resume_place), WithRetag::Yes),
584                )],
585                TerminatorKind::Call {
586                    func: Operand::function_handle(
587                        tcx,
588                        get_context_fn,
589                        &[tcx.lifetimes.re_erased.into(), tcx.lifetimes.re_erased.into()],
590                        source_info.span,
591                    ),
592                    args: [dummy_spanned(Operand::Move(entry_resume_local.into()))].into(),
593                    destination: context_ref_local.into(),
594                    target: Some(poll_bb),
595                    unwind: unwind.into_action(),
596                    call_source: CallSource::Misc,
597                    fn_span: source_info.span,
598                },
599            )
600        };
601
602        let fut_ref_local = self.new_temp(fut_ref_ty);
603        let fut_pin_new_unchecked_fn =
604            tcx.require_lang_item(LangItem::PinNewUnchecked, source_info.span);
605        let pin_bb = self.new_block_with_statements(
606            unwind,
607            vec![self.assign(
608                fut_ref_local.into(),
609                Rvalue::Ref(
610                    tcx.lifetimes.re_erased,
611                    BorrowKind::Mut { kind: MutBorrowKind::Default },
612                    fut_place,
613                ),
614            )],
615            TerminatorKind::Call {
616                func: Operand::function_handle(
617                    tcx,
618                    fut_pin_new_unchecked_fn,
619                    &[fut_ref_ty.into()],
620                    source_info.span,
621                ),
622                args: [dummy_spanned(Operand::Move(fut_ref_local.into()))].into(),
623                destination: fut_pin_local.into(),
624                target: Some(get_context_bb),
625                unwind: unwind.into_action(),
626                call_source: CallSource::Misc,
627                fn_span: source_info.span,
628            },
629        );
630
631        (pin_bb, resume_bb, dropline_bb)
632    }
633
634    fn build_drop(&mut self, bb: BasicBlock) {
635        let drop_ty = self.place_ty(self.place);
636        if !self.elaborator.patch_ref().block(self.elaborator.body(), bb).is_cleanup
637            && self.check_if_can_async_drop(drop_ty, false)
638        {
639            let async_drop_bb = self.build_async_drop(
640                self.place,
641                drop_ty,
642                self.succ,
643                self.unwind,
644                self.dropline,
645                false,
646            );
647            self.elaborator.patch().patch_terminator(bb, TerminatorKind::goto(async_drop_bb));
648        } else {
649            self.elaborator.patch().patch_terminator(
650                bb,
651                TerminatorKind::Drop {
652                    place: self.place,
653                    target: self.succ,
654                    unwind: self.unwind.into_action(),
655                    replace: false,
656                    drop: None,
657                },
658            );
659        }
660    }
661
662    /// Function to check if we can generate an async drop here
663    fn check_if_can_async_drop(&mut self, drop_ty: Ty<'tcx>, call_destructor_only: bool) -> bool {
664        if !self.elaborator.allow_async_drops()
665            || !self
666                .elaborator
667                .body()
668                .coroutine
669                .as_ref()
670                .is_some_and(|ck| ck.coroutine_kind.is_async_desugaring())
671        {
672            return false;
673        }
674
675        if drop_ty == self.place_ty(Local::arg(0).into()) {
676            return false;
677        }
678
679        let is_async_drop_feature_enabled = if self.tcx().features().async_drop() {
680            true
681        } else {
682            // Check if the type needing async drop comes from a dependency crate.
683            if let ty::Adt(adt_def, _) = drop_ty.kind() {
684                !adt_def.did().is_local() && adt_def.async_destructor(self.tcx()).is_some()
685            } else {
686                false
687            }
688        };
689
690        // Short-circuit before calling needs_async_drop/is_async_drop, as those
691        // require the `async_drop` lang item to exist (which may not be present
692        // in minimal/custom core environments like cranelift's mini_core).
693        if !is_async_drop_feature_enabled {
694            return false;
695        }
696
697        let needs_async_drop = if call_destructor_only {
698            drop_ty.is_async_drop(self.tcx(), self.elaborator.typing_env())
699        } else {
700            drop_ty.needs_async_drop(self.tcx(), self.elaborator.typing_env())
701        };
702
703        // Async drop in libstd/libcore would become insta-stable — catch that mistake.
704        if needs_async_drop && self.tcx().features().staged_api() {
705            ::rustc_span::macros::bug_impl(Some(self.source_info.span),
    format_args!("don\'t use async drop in libstd, it becomes insta-stable"),
    Location::caller());span_bug!(
706                self.source_info.span,
707                "don't use async drop in libstd, it becomes insta-stable"
708            );
709        }
710
711        needs_async_drop
712    }
713
714    /// This elaborates a single drop instruction, located at `bb`, and
715    /// patches over it.
716    ///
717    /// The elaborated drop checks the drop flags to only drop what
718    /// is initialized.
719    ///
720    /// In addition, the relevant drop flags also need to be cleared
721    /// to avoid double-drops. However, in the middle of a complex
722    /// drop, one must avoid clearing some of the flags before they
723    /// are read, as that would cause a memory leak.
724    ///
725    /// In particular, when dropping an ADT, multiple fields may be
726    /// joined together under the `rest` subpath. They are all controlled
727    /// by the primary drop flag, but only the last rest-field dropped
728    /// should clear it (and it must also not clear anything else).
729    //
730    // FIXME: I think we should just control the flags externally,
731    // and then we do not need this machinery.
732    {}
#[allow(clippy :: suspicious_else_formatting)]
{
    let __tracing_attr_span;
    let __tracing_attr_guard;
    if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() ||
            { false } {
        __tracing_attr_span =
            {
                use ::tracing::__macro_support::Callsite as _;
                static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                    {
                        static META: ::tracing::Metadata<'static> =
                            {
                                ::tracing_core::metadata::Metadata::new("elaborate_drop",
                                    "rustc_mir_transform::elaborate_drop",
                                    ::tracing::Level::DEBUG,
                                    ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                    ::tracing_core::__macro_support::Option::Some(732u32),
                                    ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                    ::tracing_core::field::FieldSet::new(&[{
                                                        const NAME:
                                                            ::tracing::__macro_support::FieldName<{
                                                                ::tracing::__macro_support::FieldName::len("self")
                                                            }> =
                                                            ::tracing::__macro_support::FieldName::new("self");
                                                        NAME.as_str()
                                                    },
                                                    {
                                                        const NAME:
                                                            ::tracing::__macro_support::FieldName<{
                                                                ::tracing::__macro_support::FieldName::len("bb")
                                                            }> =
                                                            ::tracing::__macro_support::FieldName::new("bb");
                                                        NAME.as_str()
                                                    }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                    ::tracing::metadata::Kind::SPAN)
                            };
                        ::tracing::callsite::DefaultCallsite::new(&META)
                    };
                let mut interest = ::tracing::subscriber::Interest::never();
                if ::tracing::Level::DEBUG <=
                                    ::tracing::level_filters::STATIC_MAX_LEVEL &&
                                ::tracing::Level::DEBUG <=
                                    ::tracing::level_filters::LevelFilter::current() &&
                            { interest = __CALLSITE.interest(); !interest.is_never() }
                        &&
                        ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                            interest) {
                    let meta = __CALLSITE.metadata();
                    ::tracing::Span::new(meta,
                        &{
                                #[allow(unused_imports)]
                                use ::tracing::field::{debug, display, Value};
                                meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&self)
                                                            as &dyn ::tracing::field::Value)),
                                                (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&bb)
                                                            as &dyn ::tracing::field::Value))])
                            })
                } else {
                    let span =
                        ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                    {};
                    span
                }
            };
        __tracing_attr_guard = __tracing_attr_span.enter();
    }

    #[warn(clippy :: suspicious_else_formatting)]
    {

        #[allow(unknown_lints, unreachable_code, clippy ::
        diverging_sub_expression, clippy :: empty_loop, clippy ::
        let_unit_value, clippy :: let_with_type_underscore, clippy ::
        needless_return, clippy :: unreachable)]
        if false {
            let __tracing_attr_fake_return: () = loop {};
            return __tracing_attr_fake_return;
        }
        {
            match self.elaborator.drop_style(self.path, DropFlagMode::Deep) {
                DropStyle::Dead => {
                    self.elaborator.patch().patch_terminator(bb,
                        TerminatorKind::goto(self.succ));
                }
                DropStyle::Static => { self.build_drop(bb); }
                DropStyle::Conditional => {
                    let drop_bb = self.complete_drop(self.succ, self.unwind);
                    self.elaborator.patch().patch_terminator(bb,
                        TerminatorKind::goto(drop_bb));
                }
                DropStyle::Open => {
                    let drop_bb = self.open_drop();
                    self.elaborator.patch().patch_terminator(bb,
                        TerminatorKind::goto(drop_bb));
                }
            }
        }
    }
}#[instrument(level = "debug")]
733    fn elaborate_drop(&mut self, bb: BasicBlock) {
734        match self.elaborator.drop_style(self.path, DropFlagMode::Deep) {
735            DropStyle::Dead => {
736                self.elaborator.patch().patch_terminator(bb, TerminatorKind::goto(self.succ));
737            }
738            DropStyle::Static => {
739                self.build_drop(bb);
740            }
741            DropStyle::Conditional => {
742                let drop_bb = self.complete_drop(self.succ, self.unwind);
743                self.elaborator.patch().patch_terminator(bb, TerminatorKind::goto(drop_bb));
744            }
745            DropStyle::Open => {
746                let drop_bb = self.open_drop();
747                self.elaborator.patch().patch_terminator(bb, TerminatorKind::goto(drop_bb));
748            }
749        }
750    }
751
752    /// Returns the place and move path for each field of `variant`,
753    /// (the move path is `None` if the field is a rest field).
754    fn move_paths_for_fields(
755        &self,
756        base_place: Place<'tcx>,
757        variant_path: D::Path,
758        variant: &'tcx ty::VariantDef,
759        args: GenericArgs<'tcx>,
760    ) -> Vec<(Place<'tcx>, Option<D::Path>)> {
761        variant
762            .fields
763            .iter_enumerated()
764            .map(|(field_idx, field)| {
765                let subpath = self.elaborator.field_subpath(variant_path, field_idx);
766                let tcx = self.tcx();
767
768                match self.elaborator.typing_env().typing_mode().assert_not_erased() {
769                    ty::TypingMode::PostAnalysis | ty::TypingMode::Codegen => {}
770                    ty::TypingMode::Coherence
771                    | ty::TypingMode::Reflection
772                    | ty::TypingMode::Typeck { .. }
773                    | ty::TypingMode::PostTypeckThroughBorrowck { .. }
774                    | ty::TypingMode::PostBorrowck { .. } => {
775                        ::rustc_span::macros::bug_impl(None, format_args!("impossible case reached"),
    Location::caller())bug!()
776                    }
777                }
778
779                let field_ty = field.ty(tcx, args);
780                // We silently leave an unnormalized type here to support polymorphic drop
781                // elaboration for users of rustc internal APIs
782                let field_ty = tcx
783                    .try_normalize_erasing_regions(self.elaborator.typing_env(), field_ty)
784                    .unwrap_or(field_ty.skip_norm_wip());
785
786                (tcx.mk_place_field(base_place, field_idx, field_ty), subpath)
787            })
788            .filter(|path| self.should_retain_for_ladder(path))
789            .collect()
790    }
791
792    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::DEBUG <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("drop_subpath",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::DEBUG,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(792u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("place")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("place");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("path")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("path");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("succ")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("succ");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("unwind")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("unwind");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("dropline")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("dropline");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&place)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&path)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&succ)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&unwind)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&dropline)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: BasicBlock = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        if let Some(path) = path {
                            DropCtxt {
                                    elaborator: self.elaborator,
                                    source_info: self.source_info,
                                    path,
                                    place,
                                    succ,
                                    unwind,
                                    dropline,
                                }.elaborated_drop_block()
                        } else {
                            DropCtxt {
                                    elaborator: self.elaborator,
                                    source_info: self.source_info,
                                    place,
                                    succ,
                                    unwind,
                                    dropline,
                                    path: self.path,
                                }.complete_drop(succ, unwind)
                        }
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:792",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(792u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "debug", skip(self), ret)]
793    fn drop_subpath(
794        &mut self,
795        place: Place<'tcx>,
796        path: Option<D::Path>,
797        succ: BasicBlock,
798        unwind: Unwind,
799        dropline: Option<BasicBlock>,
800    ) -> BasicBlock {
801        if let Some(path) = path {
802            DropCtxt {
803                elaborator: self.elaborator,
804                source_info: self.source_info,
805                path,
806                place,
807                succ,
808                unwind,
809                dropline,
810            }
811            .elaborated_drop_block()
812        } else {
813            DropCtxt {
814                elaborator: self.elaborator,
815                source_info: self.source_info,
816                place,
817                succ,
818                unwind,
819                dropline,
820                // Using `self.path` here to condition the drop on our own drop flag.
821                path: self.path,
822            }
823            .complete_drop(succ, unwind)
824        }
825    }
826
827    /// Creates one-half of the drop ladder for a list of fields, and return
828    /// the list of steps in it in reverse order, with the first step
829    /// dropping 0 fields and so on.
830    ///
831    /// `unwind_ladder` is such a list of steps in reverse order,
832    /// which is called if the matching step of the drop glue panics.
833    ///
834    /// `dropline_ladder` is a similar list of steps in reverse order,
835    /// which is called if the matching step of the drop glue will contain async drop
836    /// (expanded later to Yield) and the containing coroutine will be dropped at this point.
837    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::DEBUG <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("drop_halfladder",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::DEBUG,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(837u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("unwind_ladder")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("unwind_ladder");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("dropline_ladder")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("dropline_ladder");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("succ")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("succ");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("fields")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("fields");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&unwind_ladder)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&dropline_ladder)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&succ)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&fields)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: Vec<BasicBlock> = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        iter::once(succ).chain(::itertools::__std_iter::Iterator::map(::itertools::__std_iter::Iterator::zip(::itertools::__std_iter::IntoIterator::into_iter(fields.iter().rev()),
                                            ::itertools::__std_iter::Iterator::zip(::itertools::__std_iter::IntoIterator::into_iter(unwind_ladder),
                                                ::itertools::__std_iter::IntoIterator::into_iter(dropline_ladder))),
                                        |(b, (b, a))|
                                            (b, b,
                                                a)).map(|(&(place, path), &unwind_succ, &dropline_to)|
                                        {
                                            succ =
                                                self.drop_subpath(place, path, succ, unwind_succ,
                                                    dropline_to);
                                            succ
                                        })).collect()
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:837",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(837u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "debug", skip(self), ret)]
838    fn drop_halfladder(
839        &mut self,
840        unwind_ladder: &[Unwind],
841        dropline_ladder: &[Option<BasicBlock>],
842        mut succ: BasicBlock,
843        fields: &[(Place<'tcx>, Option<D::Path>)],
844    ) -> Vec<BasicBlock> {
845        iter::once(succ)
846            .chain(itertools::izip!(fields.iter().rev(), unwind_ladder, dropline_ladder).map(
847                |(&(place, path), &unwind_succ, &dropline_to)| {
848                    succ = self.drop_subpath(place, path, succ, unwind_succ, dropline_to);
849                    succ
850                },
851            ))
852            .collect()
853    }
854
855    fn drop_ladder_bottom(&mut self) -> (BasicBlock, Unwind, Option<BasicBlock>) {
856        // Clear the "master" drop flag at the end. This is needed
857        // because the "master" drop protects the ADT's discriminant,
858        // which is invalidated after the ADT is dropped.
859        (
860            self.drop_flag_reset_block(DropFlagMode::Shallow, self.succ, self.unwind),
861            self.unwind,
862            self.dropline,
863        )
864    }
865
866    /// Whether this drop is useful. This is purely an optimization to avoid generating useless blocks.
867    fn should_retain_for_ladder(&self, (place, subpath): &(Place<'tcx>, Option<D::Path>)) -> bool {
868        if !self.place_ty(*place).needs_drop(self.tcx(), self.elaborator.typing_env()) {
869            return false;
870        }
871        if let Some(subpath) = subpath
872            && let DropStyle::Dead = self.elaborator.drop_style(*subpath, DropFlagMode::Deep)
873        {
874            return false;
875        }
876        true
877    }
878
879    /// Creates a full drop ladder, consisting of 2 connected half-drop-ladders
880    ///
881    /// For example, with 3 fields, the drop ladder is
882    ///
883    /// ```text
884    /// .d0:
885    ///     ELAB(drop location.0 [target=.d1, unwind=.c1])
886    /// .d1:
887    ///     ELAB(drop location.1 [target=.d2, unwind=.c2])
888    /// .d2:
889    ///     ELAB(drop location.2 [target=`self.succ`, unwind=`self.unwind`])
890    /// .c1:
891    ///     ELAB(drop location.1 [target=.c2])
892    /// .c2:
893    ///     ELAB(drop location.2 [target=`self.unwind`])
894    /// ```
895    ///
896    /// For possible-async drops in coroutines we also need dropline ladder
897    /// ```text
898    /// .d0 (mainline):
899    ///     ELAB(drop location.0 [target=.d1, unwind=.c1, drop=.e1])
900    /// .d1 (mainline):
901    ///     ELAB(drop location.1 [target=.d2, unwind=.c2, drop=.e2])
902    /// .d2 (mainline):
903    ///     ELAB(drop location.2 [target=`self.succ`, unwind=`self.unwind`, drop=`self.drop`])
904    /// .c1 (unwind):
905    ///     ELAB(drop location.1 [target=.c2])
906    /// .c2 (unwind):
907    ///     ELAB(drop location.2 [target=`self.unwind`])
908    /// .e1 (dropline):
909    ///     ELAB(drop location.1 [target=.e2, unwind=.c2])
910    /// .e2 (dropline):
911    ///     ELAB(drop location.2 [target=`self.drop`, unwind=`self.unwind`])
912    /// ```
913    ///
914    /// NOTE: this does not clear the master drop flag, so you need
915    /// to point succ/unwind on a `drop_ladder_bottom`.
916    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::DEBUG <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("drop_ladder",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::DEBUG,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(916u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("fields")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("fields");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("succ")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("succ");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("unwind")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("unwind");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("dropline")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("dropline");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&fields)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&succ)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&unwind)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&dropline)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return:
                                (BasicBlock, Unwind, Option<BasicBlock>) = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        if !if unwind.is_cleanup() {
                                    dropline.is_none()
                                } else { true } {
                            {
                                ::core::panicking::panic_fmt(format_args!("Dropline is set for cleanup drop ladder"));
                            }
                        };
                        fields.retain(|path| self.should_retain_for_ladder(path));
                        {
                            use ::tracing::__macro_support::Callsite as _;
                            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                                {
                                    static META: ::tracing::Metadata<'static> =
                                        {
                                            ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:931",
                                                "rustc_mir_transform::elaborate_drop",
                                                ::tracing::Level::DEBUG,
                                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                                ::tracing_core::__macro_support::Option::Some(931u32),
                                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                                ::tracing_core::field::FieldSet::new(&["message"],
                                                    ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                                ::tracing::metadata::Kind::EVENT)
                                        };
                                    ::tracing::callsite::DefaultCallsite::new(&META)
                                };
                            let enabled =
                                ::tracing::Level::DEBUG <=
                                            ::tracing::level_filters::STATIC_MAX_LEVEL &&
                                        ::tracing::Level::DEBUG <=
                                            ::tracing::level_filters::LevelFilter::current() &&
                                    {
                                        let interest = __CALLSITE.interest();
                                        !interest.is_never() &&
                                            ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                                                interest)
                                    };
                            if enabled {
                                (|value_set: ::tracing::field::ValueSet|
                                            {
                                                let meta = __CALLSITE.metadata();
                                                ::tracing::Event::dispatch(meta, &value_set);
                                                ;
                                            })({
                                        #[allow(unused_imports)]
                                        use ::tracing::field::{debug, display, Value};
                                        __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("drop_ladder - fields needing drop: {0:?}",
                                                                            fields) as &dyn ::tracing::field::Value))])
                                    });
                            } else { ; }
                        };
                        let dropline_ladder: Vec<Option<BasicBlock>> =
                            ::alloc::vec::from_elem_global(None, fields.len() + 1);
                        let unwind_ladder =
                            ::alloc::vec::from_elem_global(Unwind::InCleanup,
                                fields.len() + 1);
                        let unwind_ladder: Vec<_> =
                            if let Unwind::To(succ) = unwind {
                                let halfladder =
                                    self.drop_halfladder(&unwind_ladder, &dropline_ladder, succ,
                                        &fields);
                                halfladder.into_iter().map(Unwind::To).collect()
                            } else { unwind_ladder };
                        let dropline_ladder: Vec<_> =
                            if let Some(succ) = dropline {
                                let halfladder =
                                    self.drop_halfladder(&unwind_ladder, &dropline_ladder, succ,
                                        &fields);
                                halfladder.into_iter().map(Some).collect()
                            } else { dropline_ladder };
                        let normal_ladder =
                            self.drop_halfladder(&unwind_ladder, &dropline_ladder, succ,
                                &fields);
                        (*normal_ladder.last().unwrap(),
                            *unwind_ladder.last().unwrap(),
                            *dropline_ladder.last().unwrap())
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:916",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(916u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "debug", skip(self), ret)]
917    fn drop_ladder(
918        &mut self,
919        mut fields: Vec<(Place<'tcx>, Option<D::Path>)>,
920        succ: BasicBlock,
921        unwind: Unwind,
922        dropline: Option<BasicBlock>,
923    ) -> (BasicBlock, Unwind, Option<BasicBlock>) {
924        assert!(
925            if unwind.is_cleanup() { dropline.is_none() } else { true },
926            "Dropline is set for cleanup drop ladder"
927        );
928
929        fields.retain(|path| self.should_retain_for_ladder(path));
930
931        debug!("drop_ladder - fields needing drop: {:?}", fields);
932
933        let dropline_ladder: Vec<Option<BasicBlock>> = vec![None; fields.len() + 1];
934        let unwind_ladder = vec![Unwind::InCleanup; fields.len() + 1];
935        let unwind_ladder: Vec<_> = if let Unwind::To(succ) = unwind {
936            let halfladder = self.drop_halfladder(&unwind_ladder, &dropline_ladder, succ, &fields);
937            halfladder.into_iter().map(Unwind::To).collect()
938        } else {
939            unwind_ladder
940        };
941        let dropline_ladder: Vec<_> = if let Some(succ) = dropline {
942            let halfladder = self.drop_halfladder(&unwind_ladder, &dropline_ladder, succ, &fields);
943            halfladder.into_iter().map(Some).collect()
944        } else {
945            dropline_ladder
946        };
947
948        let normal_ladder = self.drop_halfladder(&unwind_ladder, &dropline_ladder, succ, &fields);
949
950        (
951            *normal_ladder.last().unwrap(),
952            *unwind_ladder.last().unwrap(),
953            *dropline_ladder.last().unwrap(),
954        )
955    }
956
957    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::DEBUG <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("open_drop_for_tuple",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::DEBUG,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(957u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("tys")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("tys");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&tys)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: BasicBlock = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        let fields =
                            tys.iter().enumerate().map(|(i, &ty)|
                                        {
                                            (self.tcx().mk_place_field(self.place, FieldIdx::new(i),
                                                    ty),
                                                self.elaborator.field_subpath(self.path, FieldIdx::new(i)))
                                        }).collect();
                        let (succ, unwind, dropline) = self.drop_ladder_bottom();
                        self.drop_ladder(fields, succ, unwind, dropline).0
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:957",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(957u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "debug", skip(self), ret)]
958    fn open_drop_for_tuple(&mut self, tys: &[Ty<'tcx>]) -> BasicBlock {
959        let fields = tys
960            .iter()
961            .enumerate()
962            .map(|(i, &ty)| {
963                (
964                    self.tcx().mk_place_field(self.place, FieldIdx::new(i), ty),
965                    self.elaborator.field_subpath(self.path, FieldIdx::new(i)),
966                )
967            })
968            .collect();
969
970        let (succ, unwind, dropline) = self.drop_ladder_bottom();
971        self.drop_ladder(fields, succ, unwind, dropline).0
972    }
973
974    /// Drops the T contained in a `Box<T>` if it has not been moved out of
975    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::DEBUG <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("open_drop_for_box_contents",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::DEBUG,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(975u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("self")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("self");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("adt")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("adt");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("args")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("args");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("succ")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("succ");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("unwind")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("unwind");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("dropline")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("dropline");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&self)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&adt)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&args)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&succ)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&unwind)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&dropline)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: BasicBlock = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        let unique_ty =
                            adt.non_enum_variant().fields[FieldIdx::ZERO].ty(self.tcx(),
                                    args).skip_norm_wip();
                        let unique_variant =
                            unique_ty.ty_adt_def().unwrap().non_enum_variant();
                        let nonnull_ty =
                            unique_variant.fields[FieldIdx::ZERO].ty(self.tcx(),
                                    args).skip_norm_wip();
                        let ptr_ty =
                            Ty::new_imm_ptr(self.tcx(), args[0].expect_ty());
                        let unique_place =
                            self.tcx().mk_place_field(self.place, FieldIdx::ZERO,
                                unique_ty);
                        let nonnull_place =
                            self.tcx().mk_place_field(unique_place, FieldIdx::ZERO,
                                nonnull_ty);
                        let ptr_local = self.new_temp(ptr_ty);
                        let interior =
                            self.tcx().mk_place_deref(Place::from(ptr_local));
                        let interior_path =
                            self.elaborator.deref_subpath(self.path);
                        let do_drop_bb =
                            self.drop_subpath(interior, interior_path, succ, unwind,
                                dropline);
                        self.new_block_with_statements(unwind,
                            ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                                    [self.assign(Place::from(ptr_local),
                                                Rvalue::Cast(CastKind::Transmute,
                                                    Operand::Copy(nonnull_place), ptr_ty))])),
                            TerminatorKind::goto(do_drop_bb))
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:975",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(975u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "debug", ret)]
976    fn open_drop_for_box_contents(
977        &mut self,
978        adt: ty::AdtDef<'tcx>,
979        args: GenericArgs<'tcx>,
980        succ: BasicBlock,
981        unwind: Unwind,
982        dropline: Option<BasicBlock>,
983    ) -> BasicBlock {
984        // drop glue is sent straight to codegen
985        // box cannot be directly dereferenced
986        let unique_ty =
987            adt.non_enum_variant().fields[FieldIdx::ZERO].ty(self.tcx(), args).skip_norm_wip();
988        let unique_variant = unique_ty.ty_adt_def().unwrap().non_enum_variant();
989        let nonnull_ty = unique_variant.fields[FieldIdx::ZERO].ty(self.tcx(), args).skip_norm_wip();
990        let ptr_ty = Ty::new_imm_ptr(self.tcx(), args[0].expect_ty());
991
992        let unique_place = self.tcx().mk_place_field(self.place, FieldIdx::ZERO, unique_ty);
993        let nonnull_place = self.tcx().mk_place_field(unique_place, FieldIdx::ZERO, nonnull_ty);
994
995        let ptr_local = self.new_temp(ptr_ty);
996
997        let interior = self.tcx().mk_place_deref(Place::from(ptr_local));
998        let interior_path = self.elaborator.deref_subpath(self.path);
999
1000        let do_drop_bb = self.drop_subpath(interior, interior_path, succ, unwind, dropline);
1001
1002        self.new_block_with_statements(
1003            unwind,
1004            vec![self.assign(
1005                Place::from(ptr_local),
1006                Rvalue::Cast(CastKind::Transmute, Operand::Copy(nonnull_place), ptr_ty),
1007            )],
1008            TerminatorKind::goto(do_drop_bb),
1009        )
1010    }
1011
1012    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::DEBUG <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("open_drop_for_adt",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::DEBUG,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(1012u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("self")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("self");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("adt")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("adt");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("args")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("args");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&self)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&adt)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&args)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: BasicBlock = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        if adt.variants().is_empty() {
                            return self.new_block(self.unwind,
                                    TerminatorKind::Unreachable);
                        }
                        let skip_contents =
                            adt.is_union() || adt.is_manually_drop();
                        let (contents_succ, contents_unwind, contents_dropline) =
                            if skip_contents {
                                if adt.has_dtor(self.tcx()) &&
                                        self.elaborator.get_drop_flag(self.path).is_some() {
                                    ::rustc_span::macros::bug_impl(Some(self.source_info.span),
                                        format_args!("open dropping partially moved union"),
                                        Location::caller());
                                }
                                (self.succ, self.unwind, self.dropline)
                            } else { self.open_drop_for_adt_contents(adt, args) };
                        if adt.has_dtor(self.tcx()) {
                            let destructor_block =
                                if adt.is_box() {
                                    let succ =
                                        self.destructor_call_block_sync(contents_succ,
                                            contents_unwind);
                                    let unwind =
                                        contents_unwind.map(|unwind|
                                                self.destructor_call_block_sync(unwind, Unwind::InCleanup));
                                    let dropline =
                                        contents_dropline.map(|dropline|
                                                self.destructor_call_block_sync(dropline, contents_unwind));
                                    self.open_drop_for_box_contents(adt, args, succ, unwind,
                                        dropline)
                                } else {
                                    self.destructor_call_block(contents_succ, contents_unwind,
                                        contents_dropline)
                                };
                            self.drop_flag_test_block(destructor_block, contents_succ,
                                contents_unwind)
                        } else { contents_succ }
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:1012",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(1012u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "debug", ret)]
1013    fn open_drop_for_adt(&mut self, adt: ty::AdtDef<'tcx>, args: GenericArgs<'tcx>) -> BasicBlock {
1014        if adt.variants().is_empty() {
1015            return self.new_block(self.unwind, TerminatorKind::Unreachable);
1016        }
1017
1018        let skip_contents = adt.is_union() || adt.is_manually_drop();
1019        let (contents_succ, contents_unwind, contents_dropline) = if skip_contents {
1020            if adt.has_dtor(self.tcx()) && self.elaborator.get_drop_flag(self.path).is_some() {
1021                // the top-level drop flag is usually cleared by open_drop_for_adt_contents
1022                // types with destructors would still need an empty drop ladder to clear it
1023
1024                // however, these types are only open dropped in `DropShimElaborator`
1025                // which does not have drop flags
1026                // a future box-like "DerefMove" trait would allow for this case to happen
1027                span_bug!(self.source_info.span, "open dropping partially moved union");
1028            }
1029
1030            (self.succ, self.unwind, self.dropline)
1031        } else {
1032            self.open_drop_for_adt_contents(adt, args)
1033        };
1034
1035        if adt.has_dtor(self.tcx()) {
1036            let destructor_block = if adt.is_box() {
1037                // we need to drop the inside of the box before running the destructor
1038                let succ = self.destructor_call_block_sync(contents_succ, contents_unwind);
1039                let unwind = contents_unwind
1040                    .map(|unwind| self.destructor_call_block_sync(unwind, Unwind::InCleanup));
1041                let dropline = contents_dropline
1042                    .map(|dropline| self.destructor_call_block_sync(dropline, contents_unwind));
1043                self.open_drop_for_box_contents(adt, args, succ, unwind, dropline)
1044            } else {
1045                self.destructor_call_block(contents_succ, contents_unwind, contents_dropline)
1046            };
1047
1048            self.drop_flag_test_block(destructor_block, contents_succ, contents_unwind)
1049        } else {
1050            contents_succ
1051        }
1052    }
1053
1054    fn open_drop_for_adt_contents(
1055        &mut self,
1056        adt: ty::AdtDef<'tcx>,
1057        args: GenericArgs<'tcx>,
1058    ) -> (BasicBlock, Unwind, Option<BasicBlock>) {
1059        let (succ, unwind, dropline) = self.drop_ladder_bottom();
1060        if !adt.is_enum() {
1061            let fields =
1062                self.move_paths_for_fields(self.place, self.path, adt.variant(FIRST_VARIANT), args);
1063            self.drop_ladder(fields, succ, unwind, dropline)
1064        } else {
1065            self.open_drop_for_multivariant(adt, args, succ, unwind, dropline)
1066        }
1067    }
1068
1069    fn open_drop_for_multivariant(
1070        &mut self,
1071        adt: ty::AdtDef<'tcx>,
1072        args: GenericArgs<'tcx>,
1073        succ: BasicBlock,
1074        unwind: Unwind,
1075        dropline: Option<BasicBlock>,
1076    ) -> (BasicBlock, Unwind, Option<BasicBlock>) {
1077        let mut values = Vec::with_capacity(adt.variants().len());
1078        let mut normal_blocks = Vec::with_capacity(adt.variants().len());
1079        let mut unwind_blocks =
1080            Vec::with_capacity(if unwind.is_cleanup() { 0 } else { adt.variants().len() });
1081        let mut dropline_blocks =
1082            Vec::with_capacity(if dropline.is_none() { 0 } else { adt.variants().len() });
1083
1084        let mut have_otherwise_with_drop_glue = false;
1085        let mut have_otherwise = false;
1086        let tcx = self.tcx();
1087
1088        for (variant_index, discr) in adt.discriminants(tcx) {
1089            let variant = &adt.variant(variant_index);
1090            let subpath = self.elaborator.downcast_subpath(self.path, variant_index);
1091
1092            if let Some(variant_path) = subpath {
1093                let base_place = tcx.mk_place_elem(
1094                    self.place,
1095                    ProjectionElem::Downcast(Some(variant.name), variant_index),
1096                );
1097                let fields = self.move_paths_for_fields(base_place, variant_path, variant, args);
1098                values.push(discr.val);
1099                if let Unwind::To(unwind) = unwind {
1100                    // We can't use the half-ladder from the original
1101                    // drop ladder, because this breaks the
1102                    // "funclet can't have 2 successor funclets"
1103                    // requirement from MSVC:
1104                    //
1105                    //           switch       unwind-switch
1106                    //          /      \         /        \
1107                    //         v1.0    v2.0  v2.0-unwind  v1.0-unwind
1108                    //         |        |      /             |
1109                    //    v1.1-unwind  v2.1-unwind           |
1110                    //      ^                                |
1111                    //       \-------------------------------/
1112                    //
1113                    // Create a duplicate half-ladder to avoid that. We
1114                    // could technically only do this on MSVC, but I
1115                    // I want to minimize the divergence between MSVC
1116                    // and non-MSVC.
1117
1118                    let unwind_ladder = ::alloc::vec::from_elem_global(Unwind::InCleanup, fields.len() + 1)vec![Unwind::InCleanup; fields.len() + 1];
1119                    let dropline_ladder: Vec<Option<BasicBlock>> = ::alloc::vec::from_elem_global(None, fields.len() + 1)vec![None; fields.len() + 1];
1120                    let halfladder =
1121                        self.drop_halfladder(&unwind_ladder, &dropline_ladder, unwind, &fields);
1122                    unwind_blocks.push(halfladder.last().cloned().unwrap());
1123                }
1124                let (normal, _, drop_bb) = self.drop_ladder(fields, succ, unwind, dropline);
1125                normal_blocks.push(normal);
1126                if dropline.is_some() {
1127                    dropline_blocks.push(drop_bb.unwrap());
1128                }
1129            } else {
1130                have_otherwise = true;
1131
1132                let typing_env = self.elaborator.typing_env();
1133                let have_field_with_drop_glue = variant
1134                    .fields
1135                    .iter()
1136                    .any(|field| field.ty(tcx, args).skip_norm_wip().needs_drop(tcx, typing_env));
1137                if have_field_with_drop_glue {
1138                    have_otherwise_with_drop_glue = true;
1139                }
1140            }
1141        }
1142
1143        if !have_otherwise {
1144            values.pop();
1145        } else if !have_otherwise_with_drop_glue {
1146            normal_blocks.push(succ);
1147            if let Unwind::To(unwind) = unwind {
1148                unwind_blocks.push(unwind);
1149            }
1150            if let Some(dropline) = dropline {
1151                dropline_blocks.push(dropline);
1152            }
1153        } else {
1154            normal_blocks.push(self.drop_block(succ, unwind));
1155            if let Unwind::To(unwind) = unwind {
1156                unwind_blocks.push(self.drop_block(unwind, Unwind::InCleanup));
1157            }
1158            if let Some(dropline) = dropline {
1159                dropline_blocks.push(self.drop_block(dropline, unwind));
1160            }
1161        }
1162
1163        (
1164            self.adt_switch_block(adt, normal_blocks, &values, succ, unwind),
1165            unwind.map(|unwind| {
1166                self.adt_switch_block(adt, unwind_blocks, &values, unwind, Unwind::InCleanup)
1167            }),
1168            dropline.map(|dropline| {
1169                self.adt_switch_block(adt, dropline_blocks, &values, dropline, unwind)
1170            }),
1171        )
1172    }
1173
1174    fn adt_switch_block(
1175        &mut self,
1176        adt: ty::AdtDef<'tcx>,
1177        blocks: Vec<BasicBlock>,
1178        values: &[u128],
1179        succ: BasicBlock,
1180        unwind: Unwind,
1181    ) -> BasicBlock {
1182        let switch_block = blocks.iter().copied().all_equal_value().unwrap_or_else(|_| {
1183            // If there are multiple variants, then if something
1184            // is present within the enum the discriminant, tracked
1185            // by the rest path, must be initialized.
1186            //
1187            // Additionally, we do not want to switch on the
1188            // discriminant after it is free-ed, because that
1189            // way lies only trouble.
1190            let discr_ty = adt.repr().discr_type().to_ty(self.tcx());
1191            let discr = Place::from(self.new_temp(discr_ty));
1192            let discr_rv = Rvalue::Discriminant(self.place);
1193            self.new_block_with_statements(
1194                unwind,
1195                ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
        [self.assign(discr, discr_rv)]))vec![self.assign(discr, discr_rv)],
1196                TerminatorKind::SwitchInt {
1197                    discr: Operand::Move(discr),
1198                    targets: SwitchTargets::new(
1199                        values.iter().copied().zip(blocks.iter().copied()),
1200                        *blocks.last().unwrap(),
1201                    ),
1202                },
1203            )
1204        });
1205        self.drop_flag_test_block(switch_block, succ, unwind)
1206    }
1207
1208    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::DEBUG <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("destructor_call_block_sync",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::DEBUG,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(1208u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("succ")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("succ");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("unwind")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("unwind");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&succ)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&unwind)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: BasicBlock = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        let tcx = self.tcx();
                        let drop_trait =
                            tcx.require_lang_item(LangItem::Drop, DUMMY_SP);
                        let drop_fn = tcx.associated_item_def_ids(drop_trait)[0];
                        let ty = self.place_ty(self.place);
                        let ref_ty =
                            Ty::new_mut_ref(tcx, tcx.lifetimes.re_erased, ty);
                        let ref_place = self.new_temp(ref_ty);
                        let unit_temp = Place::from(self.new_temp(tcx.types.unit));
                        self.new_block_with_statements(unwind,
                            ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                                    [self.assign(Place::from(ref_place),
                                                Rvalue::Ref(tcx.lifetimes.re_erased,
                                                    BorrowKind::Mut { kind: MutBorrowKind::Default },
                                                    self.place))])),
                            TerminatorKind::Call {
                                func: Operand::function_handle(tcx, drop_fn, &[ty.into()],
                                    self.source_info.span),
                                args: [dummy_spanned(Operand::Move(Place::from(ref_place)))].into(),
                                destination: unit_temp,
                                target: Some(succ),
                                unwind: unwind.into_action(),
                                call_source: CallSource::Misc,
                                fn_span: self.source_info.span,
                            })
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:1208",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(1208u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "debug", skip(self), ret)]
1209    fn destructor_call_block_sync(&mut self, succ: BasicBlock, unwind: Unwind) -> BasicBlock {
1210        let tcx = self.tcx();
1211        let drop_trait = tcx.require_lang_item(LangItem::Drop, DUMMY_SP);
1212        let drop_fn = tcx.associated_item_def_ids(drop_trait)[0];
1213        let ty = self.place_ty(self.place);
1214
1215        let ref_ty = Ty::new_mut_ref(tcx, tcx.lifetimes.re_erased, ty);
1216        let ref_place = self.new_temp(ref_ty);
1217        let unit_temp = Place::from(self.new_temp(tcx.types.unit));
1218
1219        self.new_block_with_statements(
1220            unwind,
1221            vec![self.assign(
1222                Place::from(ref_place),
1223                Rvalue::Ref(
1224                    tcx.lifetimes.re_erased,
1225                    BorrowKind::Mut { kind: MutBorrowKind::Default },
1226                    self.place,
1227                ),
1228            )],
1229            TerminatorKind::Call {
1230                func: Operand::function_handle(tcx, drop_fn, &[ty.into()], self.source_info.span),
1231                args: [dummy_spanned(Operand::Move(Place::from(ref_place)))].into(),
1232                destination: unit_temp,
1233                target: Some(succ),
1234                unwind: unwind.into_action(),
1235                call_source: CallSource::Misc,
1236                fn_span: self.source_info.span,
1237            },
1238        )
1239    }
1240
1241    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::DEBUG <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("destructor_call_block",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::DEBUG,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(1241u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("succ")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("succ");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("unwind")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("unwind");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("dropline")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("dropline");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&succ)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&unwind)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&dropline)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: BasicBlock = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        let ty = self.place_ty(self.place);
                        if !unwind.is_cleanup() &&
                                self.check_if_can_async_drop(ty, true) {
                            self.build_async_drop(self.place, ty, succ, unwind,
                                dropline, true)
                        } else { self.destructor_call_block_sync(succ, unwind) }
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:1241",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(1241u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "debug", skip(self), ret)]
1242    fn destructor_call_block(
1243        &mut self,
1244        succ: BasicBlock,
1245        unwind: Unwind,
1246        dropline: Option<BasicBlock>,
1247    ) -> BasicBlock {
1248        let ty = self.place_ty(self.place);
1249        if !unwind.is_cleanup() && self.check_if_can_async_drop(ty, true) {
1250            self.build_async_drop(self.place, ty, succ, unwind, dropline, true)
1251        } else {
1252            self.destructor_call_block_sync(succ, unwind)
1253        }
1254    }
1255
1256    /// Create a loop that drops an array:
1257    ///
1258    /// ```text
1259    /// loop-block:
1260    ///    can_go = cur == len
1261    ///    if can_go then succ else drop-block
1262    /// drop-block:
1263    ///    ptr = &raw mut P[cur]
1264    ///    cur = cur + 1
1265    ///    drop(ptr)
1266    /// ```
1267    fn drop_loop(
1268        &mut self,
1269        succ: BasicBlock,
1270        cur: Local,
1271        len: Local,
1272        ety: Ty<'tcx>,
1273        unwind: Unwind,
1274        dropline: Option<BasicBlock>,
1275    ) -> BasicBlock {
1276        let copy = |place: Place<'tcx>| Operand::Copy(place);
1277        let move_ = |place: Place<'tcx>| Operand::Move(place);
1278        let tcx = self.tcx();
1279
1280        let ptr_ty = Ty::new_mut_ptr(tcx, ety);
1281        let ptr = Place::from(self.new_temp(ptr_ty));
1282        let can_go = Place::from(self.new_temp(tcx.types.bool));
1283        let one = self.constant_usize(1);
1284
1285        let drop_block = self.new_block_with_statements(
1286            unwind,
1287            ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
        [self.assign(ptr,
                    Rvalue::RawPtr(RawPtrKind::Mut,
                        tcx.mk_place_index(self.place, cur))),
                self.assign(cur.into(),
                    Rvalue::BinaryOp(BinOp::Add,
                        Box::new((move_(cur.into()), one))))]))vec![
1288                self.assign(
1289                    ptr,
1290                    Rvalue::RawPtr(RawPtrKind::Mut, tcx.mk_place_index(self.place, cur)),
1291                ),
1292                self.assign(
1293                    cur.into(),
1294                    Rvalue::BinaryOp(BinOp::Add, Box::new((move_(cur.into()), one))),
1295                ),
1296            ],
1297            // this gets overwritten by drop elaboration.
1298            TerminatorKind::Unreachable,
1299        );
1300
1301        let loop_block = self.new_block_with_statements(
1302            unwind,
1303            ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
        [self.assign(can_go,
                    Rvalue::BinaryOp(BinOp::Eq,
                        Box::new((copy(Place::from(cur)), copy(len.into())))))]))vec![self.assign(
1304                can_go,
1305                Rvalue::BinaryOp(BinOp::Eq, Box::new((copy(Place::from(cur)), copy(len.into())))),
1306            )],
1307            TerminatorKind::if_(move_(can_go), succ, drop_block),
1308        );
1309
1310        let place = tcx.mk_place_deref(ptr);
1311        if !unwind.is_cleanup() && self.check_if_can_async_drop(ety, false) {
1312            let async_drop_bb =
1313                self.build_async_drop(place, ety, loop_block, unwind, dropline, false);
1314            self.elaborator
1315                .patch()
1316                .patch_terminator(drop_block, TerminatorKind::goto(async_drop_bb));
1317        } else {
1318            self.elaborator.patch().patch_terminator(
1319                drop_block,
1320                TerminatorKind::Drop {
1321                    place,
1322                    target: loop_block,
1323                    unwind: unwind.into_action(),
1324                    replace: false,
1325                    drop: None,
1326                },
1327            );
1328        }
1329        loop_block
1330    }
1331
1332    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::DEBUG <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("open_drop_for_array",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::DEBUG,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(1332u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("array_ty")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("array_ty");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("ety")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("ety");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("opt_size")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("opt_size");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&array_ty)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&ety)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&opt_size)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: BasicBlock = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        let tcx = self.tcx();
                        if let Some(size) = opt_size {
                            enum ProjectionKind<Path> {
                                Drop(std::ops::Range<u64>),
                                Keep(u64, Path),
                            }
                            let mut drop_ranges = ::alloc::vec::Vec::new();
                            let mut dropping = true;
                            let mut start = 0;
                            for i in 0..size {
                                let path =
                                    self.elaborator.array_subpath(self.path, i, size);
                                if dropping && path.is_some() {
                                    drop_ranges.push(ProjectionKind::Drop(start..i));
                                    dropping = false;
                                } else if !dropping && path.is_none() {
                                    dropping = true;
                                    start = i;
                                }
                                if let Some(path) = path {
                                    drop_ranges.push(ProjectionKind::Keep(i, path));
                                }
                            }
                            if !drop_ranges.is_empty() {
                                if dropping {
                                    drop_ranges.push(ProjectionKind::Drop(start..size));
                                }
                                let fields =
                                    drop_ranges.iter().map(|p|
                                                {
                                                    let (project, path) =
                                                        match p {
                                                            ProjectionKind::Drop(r) =>
                                                                (ProjectionElem::Subslice {
                                                                        from: r.start,
                                                                        to: r.end,
                                                                        from_end: false,
                                                                    }, None),
                                                            &ProjectionKind::Keep(offset, path) =>
                                                                (ProjectionElem::ConstantIndex {
                                                                        offset,
                                                                        min_length: size,
                                                                        from_end: false,
                                                                    }, Some(path)),
                                                        };
                                                    (tcx.mk_place_elem(self.place, project), path)
                                                }).collect::<Vec<_>>();
                                let (succ, unwind, dropline) = self.drop_ladder_bottom();
                                return self.drop_ladder(fields, succ, unwind, dropline).0;
                            }
                        }
                        let array_ptr_ty = Ty::new_mut_ptr(tcx, array_ty);
                        let array_ptr = self.new_temp(array_ptr_ty);
                        let slice_ty = Ty::new_slice(tcx, ety);
                        let slice_ptr_ty = Ty::new_mut_ptr(tcx, slice_ty);
                        let slice_ptr = self.new_temp(slice_ptr_ty);
                        let array_place =
                            mem::replace(&mut self.place,
                                Place::from(slice_ptr).project_deeper(&[PlaceElem::Deref],
                                    tcx));
                        let slice_block = self.drop_loop_trio_for_slice(ety);
                        self.place = array_place;
                        self.new_block_with_statements(self.unwind,
                            ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                                    [self.assign(Place::from(array_ptr),
                                                Rvalue::RawPtr(RawPtrKind::Mut, self.place)),
                                            self.assign(Place::from(slice_ptr),
                                                Rvalue::Cast(CastKind::PointerCoercion(PointerCoercion::Unsize,
                                                        CoercionSource::Implicit),
                                                    Operand::Move(Place::from(array_ptr)), slice_ptr_ty))])),
                            TerminatorKind::goto(slice_block))
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:1332",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(1332u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "debug", skip(self), ret)]
1333    fn open_drop_for_array(
1334        &mut self,
1335        array_ty: Ty<'tcx>,
1336        ety: Ty<'tcx>,
1337        opt_size: Option<u64>,
1338    ) -> BasicBlock {
1339        let tcx = self.tcx();
1340
1341        if let Some(size) = opt_size {
1342            enum ProjectionKind<Path> {
1343                Drop(std::ops::Range<u64>),
1344                Keep(u64, Path),
1345            }
1346            // Previously, we'd make a projection for every element in the array and create a drop
1347            // ladder if any `array_subpath` was `Some`, i.e. moving out with an array pattern.
1348            // This caused huge memory usage when generating the drops for large arrays, so we instead
1349            // record the *subslices* which are dropped and the *indexes* which are kept
1350            let mut drop_ranges = vec![];
1351            let mut dropping = true;
1352            let mut start = 0;
1353            for i in 0..size {
1354                let path = self.elaborator.array_subpath(self.path, i, size);
1355                if dropping && path.is_some() {
1356                    drop_ranges.push(ProjectionKind::Drop(start..i));
1357                    dropping = false;
1358                } else if !dropping && path.is_none() {
1359                    dropping = true;
1360                    start = i;
1361                }
1362                if let Some(path) = path {
1363                    drop_ranges.push(ProjectionKind::Keep(i, path));
1364                }
1365            }
1366            if !drop_ranges.is_empty() {
1367                if dropping {
1368                    drop_ranges.push(ProjectionKind::Drop(start..size));
1369                }
1370                let fields = drop_ranges
1371                    .iter()
1372                    .map(|p| {
1373                        let (project, path) = match p {
1374                            ProjectionKind::Drop(r) => (
1375                                ProjectionElem::Subslice {
1376                                    from: r.start,
1377                                    to: r.end,
1378                                    from_end: false,
1379                                },
1380                                None,
1381                            ),
1382                            &ProjectionKind::Keep(offset, path) => (
1383                                ProjectionElem::ConstantIndex {
1384                                    offset,
1385                                    min_length: size,
1386                                    from_end: false,
1387                                },
1388                                Some(path),
1389                            ),
1390                        };
1391                        (tcx.mk_place_elem(self.place, project), path)
1392                    })
1393                    .collect::<Vec<_>>();
1394                let (succ, unwind, dropline) = self.drop_ladder_bottom();
1395                return self.drop_ladder(fields, succ, unwind, dropline).0;
1396            }
1397        }
1398
1399        let array_ptr_ty = Ty::new_mut_ptr(tcx, array_ty);
1400        let array_ptr = self.new_temp(array_ptr_ty);
1401
1402        let slice_ty = Ty::new_slice(tcx, ety);
1403        let slice_ptr_ty = Ty::new_mut_ptr(tcx, slice_ty);
1404        let slice_ptr = self.new_temp(slice_ptr_ty);
1405
1406        let array_place = mem::replace(
1407            &mut self.place,
1408            Place::from(slice_ptr).project_deeper(&[PlaceElem::Deref], tcx),
1409        );
1410        let slice_block = self.drop_loop_trio_for_slice(ety);
1411        self.place = array_place;
1412
1413        self.new_block_with_statements(
1414            self.unwind,
1415            vec![
1416                self.assign(Place::from(array_ptr), Rvalue::RawPtr(RawPtrKind::Mut, self.place)),
1417                self.assign(
1418                    Place::from(slice_ptr),
1419                    Rvalue::Cast(
1420                        CastKind::PointerCoercion(
1421                            PointerCoercion::Unsize,
1422                            CoercionSource::Implicit,
1423                        ),
1424                        Operand::Move(Place::from(array_ptr)),
1425                        slice_ptr_ty,
1426                    ),
1427                ),
1428            ],
1429            TerminatorKind::goto(slice_block),
1430        )
1431    }
1432
1433    /// Creates a trio of drop-loops of `place`, which drops its contents, even
1434    /// in the case of 1 panic or in the case of coroutine drop
1435    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::DEBUG <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("drop_loop_trio_for_slice",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::DEBUG,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(1435u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("ety")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("ety");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&ety)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: BasicBlock = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        let tcx = self.tcx();
                        let len = self.new_temp(tcx.types.usize);
                        let cur = self.new_temp(tcx.types.usize);
                        let unwind =
                            self.unwind.map(|unwind|
                                    self.drop_loop(unwind, cur, len, ety, Unwind::InCleanup,
                                        None));
                        let dropline =
                            self.dropline.map(|dropline|
                                    self.drop_loop(dropline, cur, len, ety, unwind, None));
                        let loop_block =
                            self.drop_loop(self.succ, cur, len, ety, unwind, dropline);
                        let [PlaceElem::Deref] =
                            self.place.projection.as_slice() else {
                                ::rustc_span::macros::bug_impl(Some(self.source_info.span),
                                    format_args!("Expected place for slice drop shim to be *_n, but it\'s {0:?}",
                                        self.place), Location::caller());
                            };
                        let zero = self.constant_usize(0);
                        let drop_block =
                            self.new_block_with_statements(unwind,
                                ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                                        [self.assign(len.into(),
                                                    Rvalue::UnaryOp(UnOp::PtrMetadata,
                                                        Operand::Copy(Place::from(self.place.local)))),
                                                self.assign(cur.into(),
                                                    Rvalue::Use(zero, WithRetag::Yes))])),
                                TerminatorKind::goto(loop_block));
                        let reset_block =
                            self.drop_flag_reset_block(DropFlagMode::Deep, drop_block,
                                unwind);
                        self.drop_flag_test_block(reset_block, self.succ, unwind)
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:1435",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(1435u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "debug", skip(self), ret)]
1436    fn drop_loop_trio_for_slice(&mut self, ety: Ty<'tcx>) -> BasicBlock {
1437        let tcx = self.tcx();
1438        let len = self.new_temp(tcx.types.usize);
1439        let cur = self.new_temp(tcx.types.usize);
1440
1441        let unwind = self
1442            .unwind
1443            .map(|unwind| self.drop_loop(unwind, cur, len, ety, Unwind::InCleanup, None));
1444
1445        let dropline =
1446            self.dropline.map(|dropline| self.drop_loop(dropline, cur, len, ety, unwind, None));
1447
1448        let loop_block = self.drop_loop(self.succ, cur, len, ety, unwind, dropline);
1449
1450        let [PlaceElem::Deref] = self.place.projection.as_slice() else {
1451            span_bug!(
1452                self.source_info.span,
1453                "Expected place for slice drop shim to be *_n, but it's {:?}",
1454                self.place,
1455            );
1456        };
1457
1458        let zero = self.constant_usize(0);
1459        let drop_block = self.new_block_with_statements(
1460            unwind,
1461            vec![
1462                self.assign(
1463                    len.into(),
1464                    Rvalue::UnaryOp(
1465                        UnOp::PtrMetadata,
1466                        Operand::Copy(Place::from(self.place.local)),
1467                    ),
1468                ),
1469                self.assign(cur.into(), Rvalue::Use(zero, WithRetag::Yes)),
1470            ],
1471            TerminatorKind::goto(loop_block),
1472        );
1473
1474        // FIXME(#34708): handle partially-dropped array/slice elements.
1475        let reset_block = self.drop_flag_reset_block(DropFlagMode::Deep, drop_block, unwind);
1476        self.drop_flag_test_block(reset_block, self.succ, unwind)
1477    }
1478
1479    /// The slow-path - create an "open", elaborated drop for a type
1480    /// which is moved-out-of only partially, and patch `bb` to a jump
1481    /// to it. This must not be called on ADTs with a destructor,
1482    /// as these can't be moved-out-of, except for `Box<T>`, which is
1483    /// special-cased.
1484    ///
1485    /// This creates a "drop ladder" that drops the needed fields of the
1486    /// ADT, both in the success case or if one of the destructors fail.
1487    fn open_drop(&mut self) -> BasicBlock {
1488        let ty = self.place_ty(self.place);
1489        match ty.kind() {
1490            ty::Closure(_, args) => self.open_drop_for_tuple(args.as_closure().upvar_tys()),
1491            ty::CoroutineClosure(_, args) => {
1492                self.open_drop_for_tuple(args.as_coroutine_closure().upvar_tys())
1493            }
1494            // Note that `elaborate_drops` only drops the upvars of a coroutine,
1495            // and this is ok because `open_drop` here can only be reached
1496            // within that own coroutine's resume function.
1497            // This should only happen for the self argument on the resume function.
1498            // It effectively only contains upvars until the coroutine transformation runs.
1499            // See librustc_body/transform/coroutine.rs for more details.
1500            ty::Coroutine(_, args) => self.open_drop_for_tuple(args.as_coroutine().upvar_tys()),
1501            ty::Tuple(fields) => self.open_drop_for_tuple(fields),
1502            ty::Adt(def, args) => self.open_drop_for_adt(*def, *args),
1503            ty::Dynamic(..) => self.complete_drop(self.succ, self.unwind),
1504            ty::Array(ety, size) => {
1505                let size = size.try_to_target_usize(self.tcx());
1506                self.open_drop_for_array(ty, *ety, size)
1507            }
1508            ty::Slice(ety) => self.drop_loop_trio_for_slice(*ety),
1509
1510            ty::UnsafeBinder(_) => {
1511                // Unsafe binders may elaborate drops if their inner type isn't copy.
1512                // This is enforced in typeck, so this should never happen.
1513                self.tcx().dcx().span_delayed_bug(
1514                    self.source_info.span,
1515                    "open drop for unsafe binder shouldn't be encountered",
1516                );
1517                self.new_block(self.unwind, TerminatorKind::Unreachable)
1518            }
1519
1520            _ => ::rustc_span::macros::bug_impl(Some(self.source_info.span),
    format_args!("open drop from non-ADT `{0:?}`", ty), Location::caller())span_bug!(self.source_info.span, "open drop from non-ADT `{:?}`", ty),
1521        }
1522    }
1523
1524    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::DEBUG <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("complete_drop",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::DEBUG,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(1524u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("succ")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("succ");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("unwind")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("unwind");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&succ)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&unwind)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: BasicBlock = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        let drop_block = self.drop_block(succ, unwind);
                        self.drop_flag_test_block(drop_block, succ, unwind)
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:1524",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(1524u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "debug", skip(self), ret)]
1525    fn complete_drop(&mut self, succ: BasicBlock, unwind: Unwind) -> BasicBlock {
1526        let drop_block = self.drop_block(succ, unwind);
1527        self.drop_flag_test_block(drop_block, succ, unwind)
1528    }
1529
1530    /// Creates a block that resets the drop flag. If `mode` is deep, all children drop flags will
1531    /// also be cleared.
1532    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::DEBUG <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("drop_flag_reset_block",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::DEBUG,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(1532u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("mode")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("mode");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("succ")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("succ");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("unwind")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("unwind");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&mode)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&succ)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&unwind)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: BasicBlock = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        if unwind.is_cleanup() { return succ; }
                        let flags = self.elaborator.drop_flags_for(self.path, mode);
                        let statements: Vec<_> =
                            flags.into_iter().map(|flag|
                                        {
                                            self.assign(flag,
                                                Rvalue::Use(self.constant_bool(DropFlagState::Absent.value()),
                                                    WithRetag::Yes))
                                        }).collect();
                        if statements.is_empty() { return succ; }
                        self.new_block_with_statements(unwind, statements,
                            TerminatorKind::goto(succ))
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:1532",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(1532u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "debug", skip(self), ret)]
1533    fn drop_flag_reset_block(
1534        &mut self,
1535        mode: DropFlagMode,
1536        succ: BasicBlock,
1537        unwind: Unwind,
1538    ) -> BasicBlock {
1539        if unwind.is_cleanup() {
1540            // The drop flag isn't read again on the unwind path, so don't
1541            // bother setting it.
1542            return succ;
1543        }
1544        let flags = self.elaborator.drop_flags_for(self.path, mode);
1545        let statements: Vec<_> = flags
1546            .into_iter()
1547            .map(|flag| {
1548                self.assign(
1549                    flag,
1550                    Rvalue::Use(self.constant_bool(DropFlagState::Absent.value()), WithRetag::Yes),
1551                )
1552            })
1553            .collect();
1554        if statements.is_empty() {
1555            return succ;
1556        }
1557        self.new_block_with_statements(unwind, statements, TerminatorKind::goto(succ))
1558    }
1559
1560    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::DEBUG <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("elaborated_drop_block",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::DEBUG,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(1560u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[],
                                    ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{ meta.fields().value_set_all(&[]) })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: BasicBlock = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        let blk =
                            self.new_block(self.unwind,
                                TerminatorKind::Drop {
                                    place: self.place,
                                    target: self.succ,
                                    unwind: self.unwind.into_action(),
                                    replace: false,
                                    drop: self.dropline,
                                });
                        self.elaborate_drop(blk);
                        blk
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:1560",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(1560u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "debug", skip(self), ret)]
1561    fn elaborated_drop_block(&mut self) -> BasicBlock {
1562        let blk = self.new_block(
1563            self.unwind,
1564            TerminatorKind::Drop {
1565                place: self.place,
1566                target: self.succ,
1567                unwind: self.unwind.into_action(),
1568                replace: false,
1569                drop: self.dropline,
1570            },
1571        );
1572        self.elaborate_drop(blk);
1573        blk
1574    }
1575
1576    fn drop_block(&mut self, target: BasicBlock, unwind: Unwind) -> BasicBlock {
1577        let drop_ty = self.place_ty(self.place);
1578        if !unwind.is_cleanup() && self.check_if_can_async_drop(drop_ty, false) {
1579            self.build_async_drop(self.place, drop_ty, self.succ, unwind, self.dropline, false)
1580        } else {
1581            self.new_block(
1582                unwind,
1583                TerminatorKind::Drop {
1584                    place: self.place,
1585                    target,
1586                    unwind: unwind.into_action(),
1587                    replace: false,
1588                    drop: None,
1589                },
1590            )
1591        }
1592    }
1593
1594    /// Returns the block to jump to in order to test the drop flag and execute the drop.
1595    ///
1596    /// Depending on the required `DropStyle`, this might be a generated block with an `if`
1597    /// terminator (for dynamic/open drops), or it might be `on_set` or `on_unset` itself, in case
1598    /// the drop can be statically determined.
1599    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::DEBUG <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("drop_flag_test_block",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::DEBUG,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(1599u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("on_set")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("on_set");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("on_unset")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("on_unset");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("unwind")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("unwind");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&on_set)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&on_unset)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&unwind)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: BasicBlock = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        let style =
                            self.elaborator.drop_style(self.path,
                                DropFlagMode::Shallow);
                        match style {
                            DropStyle::Dead => on_unset,
                            DropStyle::Static => on_set,
                            DropStyle::Conditional | DropStyle::Open => {
                                let flag =
                                    self.elaborator.get_drop_flag(self.path).unwrap();
                                let term = TerminatorKind::if_(flag, on_set, on_unset);
                                self.new_block(unwind, term)
                            }
                        }
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:1599",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(1599u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "debug", skip(self), ret)]
1600    fn drop_flag_test_block(
1601        &mut self,
1602        on_set: BasicBlock,
1603        on_unset: BasicBlock,
1604        unwind: Unwind,
1605    ) -> BasicBlock {
1606        let style = self.elaborator.drop_style(self.path, DropFlagMode::Shallow);
1607        match style {
1608            DropStyle::Dead => on_unset,
1609            DropStyle::Static => on_set,
1610            DropStyle::Conditional | DropStyle::Open => {
1611                let flag = self.elaborator.get_drop_flag(self.path).unwrap();
1612                let term = TerminatorKind::if_(flag, on_set, on_unset);
1613                self.new_block(unwind, term)
1614            }
1615        }
1616    }
1617
1618    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::TRACE <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::TRACE <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("new_block",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::TRACE,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(1618u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("unwind")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("unwind");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("k")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("k");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::TRACE <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::TRACE <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&unwind)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&k)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: BasicBlock = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        self.elaborator.patch().new_block(BasicBlockData::new(Terminator {
                                    source_info: self.source_info,
                                    kind: k,
                                }, unwind.is_cleanup()))
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:1618",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::TRACE,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(1618u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::TRACE <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::TRACE <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "trace", skip(self), ret)]
1619    fn new_block(&mut self, unwind: Unwind, k: TerminatorKind<'tcx>) -> BasicBlock {
1620        self.elaborator.patch().new_block(BasicBlockData::new(
1621            Terminator { source_info: self.source_info, kind: k },
1622            unwind.is_cleanup(),
1623        ))
1624    }
1625
1626    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::TRACE <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::TRACE <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("new_block_with_statements",
                                "rustc_mir_transform::elaborate_drop",
                                ::tracing::Level::TRACE,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                                ::tracing_core::__macro_support::Option::Some(1626u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("unwind")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("unwind");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("k")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("k");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::TRACE <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::TRACE <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&unwind)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&k)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: BasicBlock = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        self.elaborator.patch().new_block(BasicBlockData::new_stmts(statements,
                                Terminator { source_info: self.source_info, kind: k },
                                unwind.is_cleanup()))
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs:1626",
                        "rustc_mir_transform::elaborate_drop",
                        ::tracing::Level::TRACE,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/5b7b37aefcb5b2fba3c2392bc9065b9e4602d494/compiler/rustc_mir_transform/src/elaborate_drop.rs"),
                        ::tracing_core::__macro_support::Option::Some(1626u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_mir_transform::elaborate_drop"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::TRACE <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::TRACE <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(level = "trace", skip(self, statements), ret)]
1627    fn new_block_with_statements(
1628        &mut self,
1629        unwind: Unwind,
1630        statements: Vec<Statement<'tcx>>,
1631        k: TerminatorKind<'tcx>,
1632    ) -> BasicBlock {
1633        self.elaborator.patch().new_block(BasicBlockData::new_stmts(
1634            statements,
1635            Terminator { source_info: self.source_info, kind: k },
1636            unwind.is_cleanup(),
1637        ))
1638    }
1639
1640    fn new_temp(&mut self, ty: Ty<'tcx>) -> Local {
1641        self.elaborator.patch().new_temp(ty, self.source_info.span)
1642    }
1643
1644    fn constant_usize(&self, val: u16) -> Operand<'tcx> {
1645        Operand::Constant(Box::new(ConstOperand {
1646            span: self.source_info.span,
1647            user_ty: None,
1648            const_: Const::from_usize(self.tcx(), val.into()),
1649        }))
1650    }
1651
1652    fn constant_bool(&self, val: bool) -> Operand<'tcx> {
1653        Operand::Constant(Box::new(ConstOperand {
1654            span: self.source_info.span,
1655            user_ty: None,
1656            const_: Const::from_bool(self.tcx(), val),
1657        }))
1658    }
1659
1660    fn assign(&self, lhs: Place<'tcx>, rhs: Rvalue<'tcx>) -> Statement<'tcx> {
1661        Statement::new(self.source_info, StatementKind::Assign(Box::new((lhs, rhs))))
1662    }
1663
1664    fn storage_live(&self, local: Local) -> Statement<'tcx> {
1665        Statement::new(self.source_info, StatementKind::StorageLive(local))
1666    }
1667
1668    fn storage_dead(&self, local: Local) -> Statement<'tcx> {
1669        Statement::new(self.source_info, StatementKind::StorageDead(local))
1670    }
1671}