Rollup merge of #135840 - vayunbiyani:omit_intrinsic_unused_param_warning, r=oli-obk

omit unused args warnings for intrinsics without body

potential fix for https://github.com/rust-lang/rust/issues/135598
This commit is contained in:
Matthias Krüger 2025-02-01 01:19:19 +01:00 committed by GitHub
commit 2460b280db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 14 deletions

View file

@ -1522,6 +1522,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,