]> git.lizzy.rs Git - rust.git/blobdiff - src/bootstrap/config.rs
Introduce dedicated `-Zdylib-lto` flag for enabling LTO on `dylib`s
[rust.git] / src / bootstrap / config.rs
index 4025697dabe12f8cdafc686dbae1e9e968bae55a..a8c403675d82197d618728a179e4e5f3e3a662f1 100644 (file)
@@ -321,12 +321,12 @@ fn default_for_platform(target: &str) -> Self {
 }
 
 /// LTO mode used for compiling rustc itself.
-#[derive(Default)]
+#[derive(Default, Clone)]
 pub enum RustcLto {
     #[default]
     ThinLocal,
     Thin,
-    Fat
+    Fat,
 }
 
 impl std::str::FromStr for RustcLto {
@@ -1201,8 +1201,7 @@ pub fn parse(args: &[String]) -> Config {
             config.rust_lto = rust
                 .lto
                 .as_deref()
-                .map(RustcLto::from_str)
-                .map(|v| v.expect("invalid value for rust.lto"))
+                .map(|value| RustcLto::from_str(value).unwrap())
                 .unwrap_or_default();
         } else {
             config.rust_profile_use = flags.rust_profile_use;