]> git.lizzy.rs Git - rust.git/commitdiff
Fix each_linked_rlib when the current crate has 0 crate types
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>
Wed, 4 Jan 2023 13:37:38 +0000 (13:37 +0000)
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>
Wed, 4 Jan 2023 13:58:08 +0000 (13:58 +0000)
compiler/rustc_codegen_ssa/src/back/link.rs

index 71589e9993b7bd679e6493f956c3adef1898ffa1..e7df9cc695a45d11e7760a0eafa26f0f4d257eb7 100644 (file)
@@ -230,6 +230,9 @@ pub fn each_linked_rlib(
                 });
             }
         }
+        if info.dependency_formats.is_empty() {
+            return Err(errors::LinkRlibError::MissingFormat);
+        }
         &info.dependency_formats[0].1
     } else {
         let fmts = info