@@ -490,10 +490,14 @@ impl_lint_pass!(Transmute => [
490490
491491pub struct Transmute {
492492 msrv : Msrv ,
493+ annotations_in_expansions : bool ,
493494}
494495impl Transmute {
495496 pub fn new ( conf : & ' static Conf ) -> Self {
496- Self { msrv : conf. msrv . into ( ) }
497+ Self {
498+ msrv : conf. msrv . into ( ) ,
499+ annotations_in_expansions : conf. missing_transmute_annotations_in_expansions ,
500+ }
497501 }
498502
499503 /// When transmuting, a struct containing a single field works like the field.
@@ -555,7 +559,15 @@ impl<'tcx> LateLintPass<'tcx> for Transmute {
555559 | transmuting_null:: check ( cx, e, arg, to_ty)
556560 | transmute_null_to_fn:: check ( cx, e, arg, to_ty)
557561 | transmute_ptr_to_ref:: check ( cx, e, from_field_ty, to_ty, from_field_expr. clone ( ) , path, self . msrv )
558- | missing_transmute_annotations:: check ( cx, path, arg, from_ty, to_ty, e. hir_id )
562+ | missing_transmute_annotations:: check (
563+ cx,
564+ path,
565+ arg,
566+ from_ty,
567+ to_ty,
568+ e. hir_id ,
569+ self . annotations_in_expansions ,
570+ )
559571 | transmute_ref_to_ref:: check ( cx, e, from_ty, to_ty, arg, const_context)
560572 | transmute_ptr_to_ptr:: check ( cx, e, from_field_ty, to_ty, from_field_expr, self . msrv )
561573 | transmute_int_to_bool:: check ( cx, e, from_ty, to_ty, arg)
0 commit comments