We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65d7296 commit e6a6271Copy full SHA for e6a6271
compiler/rustc_passes/src/liveness.rs
@@ -1521,6 +1521,18 @@ impl<'tcx> Liveness<'_, 'tcx> {
1521
}
1522
1523
fn warn_about_unused_args(&self, body: &hir::Body<'_>, entry_ln: LiveNode) {
1524
+ let fn_attrs = self.ir.tcx.hir().attrs(body.value.hir_id);
1525
+ let is_intrinsic = fn_attrs.iter().any(|attr| attr.has_name(sym::rustc_intrinsic));
1526
+ if is_intrinsic {
1527
+ let has_body = match &body.value.kind {
1528
+ rustc_hir::ExprKind::Block(block, _) => !block.stmts.is_empty() || block.expr.is_some(),
1529
+ _ => false,
1530
+ };
1531
+ if has_body {
1532
+ return;
1533
+ }
1534
1535
+
1536
for p in body.params {
1537
self.check_unused_vars_in_pat(
1538
p.pat,
0 commit comments