Skip to content

Commit 435b540

Browse files
committed
Update hotplug codegen backend test
1 parent 7d5c794 commit 435b540

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

src/test/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs

+3-18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![feature(rustc_private)]
2+
#![deny(warnings)]
23

34
extern crate rustc_codegen_ssa;
45
extern crate rustc_errors;
@@ -15,44 +16,28 @@ use rustc_codegen_ssa::back::linker::LinkerInfo;
1516
use rustc_codegen_ssa::traits::CodegenBackend;
1617
use rustc_codegen_ssa::{CodegenResults, CrateInfo};
1718
use rustc_data_structures::fx::FxHashMap;
18-
use rustc_data_structures::sync::MetadataRef;
1919
use rustc_errors::ErrorReported;
20-
use rustc_middle::dep_graph::DepGraph;
2120
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
22-
use rustc_middle::middle::cstore::{EncodedMetadata, MetadataLoader, MetadataLoaderDyn};
23-
use rustc_middle::ty::query::Providers;
21+
use rustc_middle::middle::cstore::EncodedMetadata;
2422
use rustc_middle::ty::TyCtxt;
2523
use rustc_session::config::OutputFilenames;
2624
use rustc_session::Session;
27-
use rustc_target::spec::Target;
2825
use std::any::Any;
29-
use std::path::Path;
3026

3127
struct TheBackend;
3228

3329
impl CodegenBackend for TheBackend {
34-
fn metadata_loader(&self) -> Box<MetadataLoaderDyn> {
35-
Box::new(rustc_codegen_ssa::back::metadata::DefaultMetadataLoader)
36-
}
37-
38-
fn provide(&self, providers: &mut Providers) {}
39-
fn provide_extern(&self, providers: &mut Providers) {}
40-
4130
fn codegen_crate<'a, 'tcx>(
4231
&self,
4332
tcx: TyCtxt<'tcx>,
4433
metadata: EncodedMetadata,
4534
_need_metadata_module: bool,
4635
) -> Box<dyn Any> {
47-
use rustc_hir::def_id::LOCAL_CRATE;
48-
4936
Box::new(CodegenResults {
50-
crate_name: tcx.crate_name(LOCAL_CRATE),
5137
modules: vec![],
5238
allocator_module: None,
5339
metadata_module: None,
5440
metadata,
55-
windows_subsystem: None,
5641
linker_info: LinkerInfo::new(tcx, "fake_target_cpu".to_string()),
5742
crate_info: CrateInfo::new(tcx),
5843
})
@@ -77,7 +62,7 @@ impl CodegenBackend for TheBackend {
7762
) -> Result<(), ErrorReported> {
7863
use rustc_session::{config::CrateType, output::out_filename};
7964
use std::io::Write;
80-
let crate_name = codegen_results.crate_name;
65+
let crate_name = codegen_results.crate_info.local_crate_name;
8166
for &crate_type in sess.opts.crate_types.iter() {
8267
if crate_type != CrateType::Rlib {
8368
sess.fatal(&format!("Crate type is {:?}", crate_type));

0 commit comments

Comments
 (0)