diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index 54bcc64d0685d..f643d048ef0ad 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -807,9 +807,15 @@ impl Session { return enabled } - // If there's only one codegen unit and LTO isn't enabled then there's - // no need for ThinLTO so just return false. - if self.codegen_units() == 1 && !self.lto() { + // If LTO is enabled we right now unconditionally disable ThinLTO. + // This'll come at a later date! (full crate graph ThinLTO) + if self.lto() { + return false + } + + // If there's only one codegen unit or then there's no need for ThinLTO + // so just return false. + if self.codegen_units() == 1 { return false }