[−][src]Struct rustc_codegen_ssa::base::AbortCodegenOnDrop
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...
Implementations
impl<B: ExtraBackendMethods> AbortCodegenOnDrop<B>[src]
pub(in base) fn into_inner(
self
) -> OngoingCodegen<B>[src]
self
) -> OngoingCodegen<B>
Methods from Deref<Target = OngoingCodegen<B>>
pub fn submit_pre_codegened_module_to_llvm(
&self,
tcx: TyCtxt<'_>,
module: ModuleCodegen<B::Module>
)[src]
&self,
tcx: TyCtxt<'_>,
module: ModuleCodegen<B::Module>
)
pub fn codegen_finished(&self, tcx: TyCtxt<'_>)[src]
pub fn check_for_errors(&self, sess: &Session)[src]
pub fn wait_for_signal_to_codegen_item(&self)[src]
Trait Implementations
impl<B: ExtraBackendMethods> Deref for AbortCodegenOnDrop<B>[src]
type Target = OngoingCodegen<B>
The resulting type after dereferencing.
pub fn deref(&self) -> &OngoingCodegen<B>[src]
impl<B: ExtraBackendMethods> DerefMut for AbortCodegenOnDrop<B>[src]
pub fn deref_mut(&mut self) -> &mut OngoingCodegen<B>[src]
impl<B: ExtraBackendMethods> Drop for AbortCodegenOnDrop<B>[src]
Auto Trait Implementations
impl<B> !RefUnwindSafe for AbortCodegenOnDrop<B>
impl<B> !Send for AbortCodegenOnDrop<B>
impl<B> !Sync for AbortCodegenOnDrop<B>
impl<B> Unpin for AbortCodegenOnDrop<B> where
B: Unpin,
B: Unpin,
impl<B> !UnwindSafe for AbortCodegenOnDrop<B>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,