]> git.lizzy.rs Git - rust.git/blobdiff - src/lib.rs
Disable "LTO is not supported" warning for sysroot build
[rust.git] / src / lib.rs
index 3a96184ad75e8c91a5129f344f0faaa229335fa6..3e562977b8ee21b017a0450805e9becc2848b379 100644 (file)
@@ -164,7 +164,7 @@ fn finalize(mut self) -> (Module<B>, Option<DebugContext<'tcx>>, UnwindContext<'
 
 impl CodegenBackend for CraneliftCodegenBackend {
     fn init(&self, sess: &Session) {
-        if sess.lto() != rustc_session::config::Lto::No {
+        if sess.lto() != rustc_session::config::Lto::No && sess.opts.cg.embed_bitcode {
             sess.warn("LTO is not supported. You may get a linker error.");
         }
     }