Suppress must_use in compiler and tools

This commit is contained in:
Michael Goulet
2025-02-22 23:55:08 +00:00
parent f3579934b1
commit 9eab078065
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -129,7 +129,7 @@ pub fn is_found(cx: &LateContext<'_>, hir_id: HirId) -> bool {
};
get_enclosing_block(cx, hir_id).is_some_and(|block| {
visitor.visit_block(block);
let _ = visitor.visit_block(block);
visitor.break_after_expr
})
}
@@ -40,7 +40,7 @@ pub fn check(cx: &LateContext<'_>, call: &Expr<'_>, recv: &Expr<'_>, arg: &Expr<
// We've checked that `call` is a call to `Stdin::read_line()` with the right receiver,
// now let's check if the first use of the string passed to `::read_line()`
// is used for operations that will always fail (e.g. parsing "6\n" into a number)
for_each_local_use_after_expr(cx, local_id, call.hir_id, |expr| {
let _ = for_each_local_use_after_expr(cx, local_id, call.hir_id, |expr| {
if let Some(parent) = get_parent_expr(cx, expr) {
let data = if let ExprKind::MethodCall(segment, recv, args, span) = parent.kind {
if args.is_empty()
+1 -1
View File
@@ -141,7 +141,7 @@ fn check_poly_fn(&mut self, cx: &LateContext<'_>, def_id: LocalDefId, decl: &FnD
// Gather all the lifetimes found in the output type which may affect whether
// `TRIVIALLY_COPY_PASS_BY_REF` should be linted.
let mut output_regions = FxHashSet::default();
for_each_top_level_late_bound_region(fn_sig.skip_binder().output(), |region| -> ControlFlow<!> {
let _ = for_each_top_level_late_bound_region(fn_sig.skip_binder().output(), |region| -> ControlFlow<!> {
output_regions.insert(region);
ControlFlow::Continue(())
});
+1 -1
View File
@@ -381,7 +381,7 @@ fn check_default_new<'tcx>(
implemented_ty_id,
method_span,
};
walk_body(&mut c, body);
let _ = walk_body(&mut c, body);
}
}
}