diff options
| author | klensy <klensy@users.noreply.github.com> | 2025-06-17 13:59:53 +0300 |
|---|---|---|
| committer | klensy <klensy@users.noreply.github.com> | 2025-06-17 13:59:53 +0300 |
| commit | 8c83935cdf87d4e3c0d9e7796fc810fb54ecbf39 (patch) | |
| tree | b1c85aae31c3fcadcb2f0be6457f7cf87c494e23 /compiler/rustc_trait_selection/src | |
| parent | 55d436467c351b56253deeba209ae2553d1c243f (diff) | |
apply clippy::or_fun_call
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/error_reporting/infer/region.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/normalize.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/error_reporting/infer/region.rs b/compiler/rustc_trait_selection/src/error_reporting/infer/region.rs index b8207c4f816..5c669678ccc 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/infer/region.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/infer/region.rs @@ -891,7 +891,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { (b'a'..=b'z') .map(|c| format!("'{}", c as char)) .find(|candidate| !used_names.iter().any(|e| e.as_str() == candidate)) - .unwrap_or("'lt".to_string()) + .unwrap_or_else(|| "'lt".to_string()) }; let mut visitor = LifetimeReplaceVisitor { diff --git a/compiler/rustc_trait_selection/src/traits/normalize.rs b/compiler/rustc_trait_selection/src/traits/normalize.rs index 35a43b294ee..9e02ce32b21 100644 --- a/compiler/rustc_trait_selection/src/traits/normalize.rs +++ b/compiler/rustc_trait_selection/src/traits/normalize.rs @@ -224,7 +224,7 @@ impl<'a, 'b, 'tcx> AssocTypeNormalizer<'a, 'b, 'tcx> { ) .ok() .flatten() - .unwrap_or(proj.to_term(infcx.tcx)); + .unwrap_or_else(|| proj.to_term(infcx.tcx)); PlaceholderReplacer::replace_placeholders( infcx, |
