]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/hir/lowering.rs
Auto merge of #55014 - ljedrz:lazyboye_unwraps, r=matthewjasper
[rust.git] / src / librustc / hir / lowering.rs
index da5979e699aa1d612ccf556094929207aa52e268..cce872927b147c2a86d58c2e153d33f287cfb1cd 100644 (file)
@@ -1598,7 +1598,7 @@ fn lower_qpath(
 
         let resolution = self.resolver
             .get_resolution(id)
-            .unwrap_or(PathResolution::new(Def::Err));
+            .unwrap_or_else(|| PathResolution::new(Def::Err));
 
         let proj_start = p.segments.len() - resolution.unresolved_segments();
         let path = P(hir::Path {