]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_session/src/session.rs
Rollup merge of #103757 - ffmancera:ff/clarify_E0207, r=jackh726
[rust.git] / compiler / rustc_session / src / session.rs
index 6d3cda684a62a2b11ff43e739cde88d3268de293..103521983578bc4d8670429afd93e6c3dde5cb6e 100644 (file)
@@ -1018,11 +1018,8 @@ pub fn lto(&self) -> config::Lto {
                 return config::Lto::Fat;
             }
             config::LtoCli::Thin => {
-                return if self.opts.cli_forced_thinlto_off {
-                    config::Lto::Fat
-                } else {
-                    config::Lto::Thin
-                };
+                // The user explicitly asked for ThinLTO
+                return config::Lto::Thin;
             }
         }
 
@@ -1034,7 +1031,7 @@ pub fn lto(&self) -> config::Lto {
 
         // If processing command line options determined that we're incompatible
         // with ThinLTO (e.g., `-C lto --emit llvm-ir`) then return that option.
-        if self.opts.cli_forced_thinlto_off {
+        if self.opts.cli_forced_local_thinlto_off {
             return config::Lto::No;
         }
 
@@ -1312,7 +1309,7 @@ pub fn build_session(
 
     let sysroot = match &sopts.maybe_sysroot {
         Some(sysroot) => sysroot.clone(),
-        None => filesearch::get_or_default_sysroot(),
+        None => filesearch::get_or_default_sysroot().expect("Failed finding sysroot"),
     };
 
     let target_cfg = config::build_target_config(&sopts, target_override, &sysroot);