Warn and error about some things and make METADATA_FILENAME an &str

This commit is contained in:
bjorn3
2018-11-10 15:01:01 +01:00
parent 9ceb1a170b
commit c88353c942
3 changed files with 16 additions and 4 deletions

View File

@@ -73,7 +73,7 @@ mod prelude {
pub use rustc::hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
pub use rustc::mir::{self, interpret::AllocId, *};
pub use rustc::session::{config::CrateType, Session};
pub use rustc::session::{config::{CrateType, Lto}, Session};
pub use rustc::ty::layout::{self, Abi, LayoutOf, Scalar, Size, TyLayout};
pub use rustc::ty::{
self, subst::Substs, FnSig, Instance, InstanceDef, ParamEnv, PolyFnSig, Ty, TyCtxt,
@@ -143,6 +143,18 @@ impl CodegenBackend for CraneliftCodegenBackend {
}
}
}
match sess.lto() {
Lto::Fat | Lto::Thin | Lto::ThinLocal => {
sess.warn("Rustc codegen cranelift doesn't support lto");
}
Lto::No => {},
}
if sess.opts.cg.rpath {
sess.err("rpath is not yet supported");
}
if sess.opts.debugging_opts.pgo_gen.is_some() {
sess.err("pgo is not supported");
}
}
fn metadata_loader(&self) -> Box<MetadataLoader + Sync> {