Struct rustc_codegen_ssa::base::AbortCodegenOnDrop[][src]

struct AbortCodegenOnDrop<B: ExtraBackendMethods>(Option<OngoingCodegen<B>>);
Expand description

A curious wrapper structure whose only purpose is to call codegen_aborted when it’s dropped abnormally.

In the process of working on rust-lang/rust#55238 a mysterious segfault was stumbled upon. The segfault was never reproduced locally, but it was suspected to be related to the fact that codegen worker threads were sticking around by the time the main thread was exiting, causing issues.

This structure is an attempt to fix that issue where the codegen_aborted message will block until all workers have finished. This should ensure that even if the main codegen thread panics we’ll wait for pending work to complete before returning from the main thread, hopefully avoiding segfaults.

If you see this comment in the code, then it means that this workaround worked! We may yet one day track down the mysterious cause of that segfault…

Tuple Fields

0: Option<OngoingCodegen<B>>

Implementations

Methods from Deref<Target = OngoingCodegen<B>>

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Layout

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.