We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1bae4f5 commit ff7f6d5Copy full SHA for ff7f6d5
src/librustc_mir/borrow_check/nll/type_check/liveness/liveness_map.rs
@@ -86,6 +86,11 @@ impl NllLivenessMap {
86
to_local,
87
}
88
89
+
90
+ /// True if there are no local variables that need liveness computation.
91
+ crate fn is_empty(&self) -> bool {
92
+ self.to_local.is_empty()
93
+ }
94
95
96
/// Index given to each local variable whose type contains a region.
src/librustc_mir/borrow_check/nll/type_check/liveness/mod.rs
@@ -55,7 +55,7 @@ pub(super) fn generate<'gcx, 'tcx>(
55
let liveness = LivenessResults::compute(mir, &liveness_map);
56
57
// For everything else, it is only live where it is actually used.
58
- {
+ if !liveness_map.is_empty() {
59
let mut generator = TypeLivenessGenerator {
60
cx,
61
mir,
0 commit comments