Skip to content

Commit f33875d

Browse files
committed
slight tweak to sanitizer target detection
1 parent b89e852 commit f33875d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc_metadata/creader.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -803,17 +803,17 @@ impl<'a> CrateLoader<'a> {
803803
return
804804
}
805805

806-
let any_unsupported = self.sess.crate_types.borrow().iter().any(|ct| {
806+
let all_supported = self.sess.crate_types.borrow().iter().all(|ct| {
807807
match *ct {
808808
config::CrateType::Executable |
809809
config::CrateType::Staticlib |
810810
config::CrateType::Cdylib |
811811
config::CrateType::Dylib |
812-
config::CrateType::Rlib => false,
813-
_ => true,
812+
config::CrateType::Rlib => true,
813+
_ => false,
814814
}
815815
});
816-
if any_unsupported {
816+
if !all_supported {
817817
self.sess.err("Only executables, staticlibs, cdylibs, dylibs and rlibs can be compiled \
818818
with `-Z sanitizer`");
819819
self.sess.injected_sanitizer_runtime.set(None);

0 commit comments

Comments
 (0)