Skip to content

Commit

Permalink
Use DefaultMetadataLoader in the hotplug_codegen_backend test
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed May 13, 2021
1 parent 537e814 commit 6381aaf
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,11 @@ use rustc_target::spec::Target;
use std::any::Any;
use std::path::Path;

pub struct NoLlvmMetadataLoader;

impl MetadataLoader for NoLlvmMetadataLoader {
fn get_rlib_metadata(&self, _: &Target, filename: &Path) -> Result<MetadataRef, String> {
unreachable!("some_crate.rs shouldn't depend on any external crates");
}

fn get_dylib_metadata(&self, target: &Target, filename: &Path) -> Result<MetadataRef, String> {
unreachable!("some_crate.rs shouldn't depend on any external crates");
}
}

struct TheBackend;

impl CodegenBackend for TheBackend {
fn metadata_loader(&self) -> Box<MetadataLoaderDyn> {
Box::new(NoLlvmMetadataLoader)
Box::new(rustc_codegen_ssa::back::metadata::DefaultMetadataLoader)
}

fn provide(&self, providers: &mut Providers) {}
Expand Down

0 comments on commit 6381aaf

Please sign in to comment.