diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 15e2251d76321..8cebcaccfaad7 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -761,14 +761,14 @@ LLVMRustOptimizeWithNewPassManager( } if (SanitizerOptions->SanitizeAddress) { - // FIXME: Rust does not expose the UseAfterScope option. PipelineStartEPCallbacks.push_back([&](ModulePassManager &MPM) { MPM.addPass(RequireAnalysisPass()); }); OptimizerLastEPCallbacks.push_back( [SanitizerOptions](FunctionPassManager &FPM, PassBuilder::OptimizationLevel Level) { FPM.addPass(AddressSanitizerPass( - /*CompileKernel=*/false, SanitizerOptions->SanitizeRecover)); + /*CompileKernel=*/false, SanitizerOptions->SanitizeRecover, + /*UseAfterScope=*/true)); } ); PipelineStartEPCallbacks.push_back(