11use rustc_middle:: mir:: visit:: Visitor ;
22use rustc_middle:: mir:: { Body , Location , Operand , Terminator , TerminatorKind } ;
33use rustc_middle:: ty:: * ;
4- use rustc_session:: lint:: builtin:: UNNECESSARY_TRANSMUTATE ;
4+ use rustc_session:: lint:: builtin:: UNNECESSARY_TRANSMUTES ;
55use rustc_span:: source_map:: Spanned ;
66use rustc_span:: { Span , sym} ;
77
@@ -24,7 +24,7 @@ struct UnnecessaryTransmuteChecker<'a, 'tcx> {
2424}
2525
2626impl < ' a , ' tcx > UnnecessaryTransmuteChecker < ' a , ' tcx > {
27- fn is_redundant_transmute (
27+ fn is_unnecessary_transmute (
2828 & self ,
2929 function : & Operand < ' tcx > ,
3030 arg : String ,
@@ -87,14 +87,14 @@ impl<'tcx> Visitor<'tcx> for UnnecessaryTransmuteChecker<'_, 'tcx> {
8787 && let Some ( ( func_def_id, _) ) = func. const_fn_def ( )
8888 && self . tcx . is_intrinsic ( func_def_id, sym:: transmute)
8989 && let span = self . body . source_info ( location) . span
90- && let Some ( lint) = self . is_redundant_transmute (
90+ && let Some ( lint) = self . is_unnecessary_transmute (
9191 func,
9292 self . tcx . sess . source_map ( ) . span_to_snippet ( arg) . expect ( "ok" ) ,
9393 span,
9494 )
9595 && let Some ( hir_id) = terminator. source_info . scope . lint_root ( & self . body . source_scopes )
9696 {
97- self . tcx . emit_node_span_lint ( UNNECESSARY_TRANSMUTATE , hir_id, span, lint) ;
97+ self . tcx . emit_node_span_lint ( UNNECESSARY_TRANSMUTES , hir_id, span, lint) ;
9898 }
9999 }
100100}
0 commit comments