diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:13:23 +0000 |
commit | 20431706a863f92cb37dc512fef6e48d192aaf2c (patch) | |
tree | 2867f13f5fd5437ba628c67d7f87309ccadcd286 /compiler/rustc_lint/src/enum_intrinsics_non_enums.rs | |
parent | Releasing progress-linux version 1.65.0+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.tar.xz rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.zip |
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | compiler/rustc_lint/src/enum_intrinsics_non_enums.rs | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/compiler/rustc_lint/src/enum_intrinsics_non_enums.rs b/compiler/rustc_lint/src/enum_intrinsics_non_enums.rs index f41ee6404..f9d746622 100644 --- a/compiler/rustc_lint/src/enum_intrinsics_non_enums.rs +++ b/compiler/rustc_lint/src/enum_intrinsics_non_enums.rs @@ -50,26 +50,24 @@ fn enforce_mem_discriminant( ) { let ty_param = cx.typeck_results().node_substs(func_expr.hir_id).type_at(0); if is_non_enum(ty_param) { - cx.struct_span_lint(ENUM_INTRINSICS_NON_ENUMS, expr_span, |builder| { - builder - .build(fluent::lint::enum_intrinsics_mem_discriminant) - .set_arg("ty_param", ty_param) - .span_note(args_span, fluent::lint::note) - .emit(); - }); + cx.struct_span_lint( + ENUM_INTRINSICS_NON_ENUMS, + expr_span, + fluent::lint_enum_intrinsics_mem_discriminant, + |lint| lint.set_arg("ty_param", ty_param).span_note(args_span, fluent::note), + ); } } fn enforce_mem_variant_count(cx: &LateContext<'_>, func_expr: &hir::Expr<'_>, span: Span) { let ty_param = cx.typeck_results().node_substs(func_expr.hir_id).type_at(0); if is_non_enum(ty_param) { - cx.struct_span_lint(ENUM_INTRINSICS_NON_ENUMS, span, |builder| { - builder - .build(fluent::lint::enum_intrinsics_mem_variant) - .set_arg("ty_param", ty_param) - .note(fluent::lint::note) - .emit(); - }); + cx.struct_span_lint( + ENUM_INTRINSICS_NON_ENUMS, + span, + fluent::lint_enum_intrinsics_mem_variant, + |lint| lint.set_arg("ty_param", ty_param).note(fluent::note), + ); } } |