@@ -93,12 +93,10 @@ impl<'tcx> UnsafetyVisitor<'_, 'tcx> {
9393 fn emit_deprecated_safe_fn_call ( & self , span : Span , kind : & UnsafeOpKind ) -> bool {
9494 fn parse_rustc_deprecated_safe_2024_attr ( attr : & Attribute ) -> Option < Symbol > {
9595 for item in attr. meta_item_list ( ) . unwrap_or_default ( ) {
96- if item. has_name ( sym:: todo) {
97- return Some (
98- item. value_str ( ) . expect (
99- "`#[rustc_deprecated_safe_2024(todo)]` must have a string value" ,
100- ) ,
101- ) ;
96+ if item. has_name ( sym:: audit_that) {
97+ return Some ( item. value_str ( ) . expect (
98+ "`#[rustc_deprecated_safe_2024(audit_that)]` must have a string value" ,
99+ ) ) ;
102100 }
103101 }
104102 None
@@ -115,10 +113,15 @@ impl<'tcx> UnsafetyVisitor<'_, 'tcx> {
115113 let suggestion = parse_rustc_deprecated_safe_2024_attr ( attr) ;
116114
117115 let sm = self . tcx . sess . source_map ( ) ;
116+ let guarantee = suggestion
117+ . as_ref ( )
118+ . map ( |suggestion| format ! ( "that {}" , suggestion) )
119+ . unwrap_or_else ( || String :: from ( "its unsafe preconditions" ) ) ;
118120 let suggestion = suggestion
119121 . and_then ( |suggestion| {
120- sm. indentation_before ( span)
121- . map ( |indent| format ! ( "{}// TODO: {}\n " , indent, suggestion) ) // ignore-tidy-todo
122+ sm. indentation_before ( span) . map ( |indent| {
123+ format ! ( "{}// TODO: Audit that {}.\n " , indent, suggestion) // ignore-tidy-todo
124+ } )
122125 } )
123126 . unwrap_or_default ( ) ;
124127
@@ -129,6 +132,7 @@ impl<'tcx> UnsafetyVisitor<'_, 'tcx> {
129132 CallToDeprecatedSafeFnRequiresUnsafe {
130133 span,
131134 function : with_no_trimmed_paths ! ( self . tcx. def_path_str( id) ) ,
135+ guarantee,
132136 sub : CallToDeprecatedSafeFnRequiresUnsafeSub {
133137 start_of_line_suggestion : suggestion,
134138 start_of_line : sm. span_extend_to_line ( span) . shrink_to_lo ( ) ,
0 commit comments