You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: kani_compiler.rs
    path of file: ./repos/kani/kani-compiler/src
    
    the code of the file until where you have to start completion: // Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! This module defines all compiler extensions that form the Kani compiler.
//!
//! The [KaniCompiler] can be used across multiple rustc driver runs ([RunCompiler::run()]),
//! which is used to implement stubs.
//!
//! In the first run, [KaniCompiler::config] will implement the compiler configuration and it will
//! also collect any stubs that may need to be applied. This method will b
    
    pub fn run(&mut self, orig_args: Vec<String>) -> Result<(), ErrorGuaranteed> {
        loop {
            debug!(next=?self.stage, "run");
            // Because this modifies `self.stage` we need to run this before
            // borrowing `&self.stage` immutably
            if let CompilationStage::Done { metadata: Some((metadata, _)), .. } = &mut self.stage {
                let mut contracts = self
                    .queries
                    .lock()
                    .unwrap()
                    .assigns_contracts()
                    .map(|(k, v)| (*k, v.clone()))
                    .collect::<FxHashMap<_, _>>();
                for harness in
                    metadata.proof_harnesses.iter_mut().chain(metadata.test_harnesses.iter_mut())
                {
                    if let Some(modifies_contract) =
                        contracts.remove(&(&harness.mangled_name).intern())
                    {
                        harness.contract = modifies_contract.into();
                    }
                }
                assert!(
                    contracts.is_empty(),
                    "Invariant broken: not all contracts have been handled."
                )
            }
            match &self.stage {
                CompilationStage::Init => self.run_compilation_session(&orig_args)?,
                CompilationStage::CodegenNoStubs { .. } => {
                    unreachable!("This stage should always run in the same session as Init");
                }
                CompilationStage::CodegenWithStubs { target_harnesses, all_harnesses, .. } => {
                    assert!(!target_harnesses.is_empty(), "expected at least one target harness");
                    let target_harness_name = &target_harnesses[0];
                    let target_harness = &all_harnesses[target_harness_name];
                    let extra_arg = stubbing::mk_rustc_arg(&target_harness.stub_map);
                    let mut args = orig_args.clone();
                    args.push(extra_arg);
                    self.run_compilation_session(&args)?
                }
                CompilationStage::Done { metadata: Some((kani_metadata, crate_info)) } => {
                    // Only store metadata for harnesses for now.
                    // TODO: This should only skip None.
                    // https://github.com/model-checking/kani/issues/2493
                    if self.queries.lock().unwrap().args().reachability_analysis
                        == ReachabilityType::Harnesses
                    {
                        // Store metadata file.
                        // We delay storing the metadata so we can include information collected
                        // during codegen.
                        self.store_metadata(&kani_metadata, &crate_info.output_path);
                    }
                    return Ok(());
                }
                CompilationStage::Done { metadata: None }
                | CompilationStage::CompilationSkipped => {
                    return Ok(());
                }
            };

            self.next_stage();
        }
    }