about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src
diff options
context:
space:
mode:
authorCelina G. Val <celinval@amazon.com>2025-04-07 17:42:08 -0700
committerCelina G. Val <celinval@amazon.com>2025-04-08 10:46:31 -0700
commit3feac59b794acf326c0efebaabd500e47fc65ba9 (patch)
treec522cc6dfe56fda0621496f4146f9ad12f170237 /compiler/rustc_hir_analysis/src
parentb9754f9e7bfe2d8eed780962b550a25a87118ce4 (diff)
downloadrust-3feac59b794acf326c0efebaabd500e47fc65ba9.tar.gz
rust-3feac59b794acf326c0efebaabd500e47fc65ba9.zip
Fix unreachable expression warning
Invert the order that we pass the arguments to the
`contract_check_ensures` function to avoid the warning when the tail
of the function is unreachable.

Note that the call itself is also unreachable, but we have already
handled that case by ignoring unreachable call for contract calls.
Diffstat (limited to 'compiler/rustc_hir_analysis/src')
-rw-r--r--compiler/rustc_hir_analysis/src/check/intrinsic.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/intrinsic.rs b/compiler/rustc_hir_analysis/src/check/intrinsic.rs
index 290e47b42b5..e54fa89328c 100644
--- a/compiler/rustc_hir_analysis/src/check/intrinsic.rs
+++ b/compiler/rustc_hir_analysis/src/check/intrinsic.rs
@@ -236,7 +236,7 @@ pub fn check_intrinsic_type(
         // where C: for<'a> Fn(&'a Ret) -> bool,
         //
         // so: two type params, 0 lifetime param, 0 const params, two inputs, no return
-        (2, 0, 0, vec![param(0), param(1)], param(0), hir::Safety::Safe)
+        (2, 0, 0, vec![param(0), param(1)], param(1), hir::Safety::Safe)
     } else {
         let safety = intrinsic_operation_unsafety(tcx, intrinsic_id);
         let (n_tps, n_cts, inputs, output) = match intrinsic_name {