diff options
| author | vayunbiyani <vayunbiyani9@gmail.com> | 2025-01-21 15:06:52 -0500 |
|---|---|---|
| committer | vayunbiyani <vayunbiyani9@gmail.com> | 2025-01-23 14:32:21 -0500 |
| commit | 8e22ec095799a126a133a6bf6145abc39acaf591 (patch) | |
| tree | 7150c8c16c177cbb4cabf3edcc5653865123a0ab /compiler | |
| parent | 65d7296fc9868af121adb5e07358a3815a80a7a1 (diff) | |
omit unused args warnings for intrinsics without body
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_passes/src/liveness.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_passes/src/liveness.rs b/compiler/rustc_passes/src/liveness.rs index b85a987c641..279729365ee 100644 --- a/compiler/rustc_passes/src/liveness.rs +++ b/compiler/rustc_passes/src/liveness.rs @@ -1521,6 +1521,14 @@ impl<'tcx> Liveness<'_, 'tcx> { } fn warn_about_unused_args(&self, body: &hir::Body<'_>, entry_ln: LiveNode) { + if let Some(intrinsic) = + self.ir.tcx.intrinsic(self.ir.tcx.hir().body_owner_def_id(body.id())) + { + if intrinsic.must_be_overridden { + return; + } + } + for p in body.params { self.check_unused_vars_in_pat( p.pat, |
