@@ -102,18 +102,23 @@ impl<'tcx> UnsafetyVisitor<'_, 'tcx> {
102102 . meta_item_list ( )
103103 . unwrap_or_default ( )
104104 . into_iter ( )
105- . find ( |item| item. has_name ( sym:: todo ) )
105+ . find ( |item| item. has_name ( sym:: audit_that ) )
106106 . map ( |item| {
107107 item. value_str ( ) . expect (
108- "`#[rustc_deprecated_safe_2024(todo )]` must have a string value" ,
108+ "`#[rustc_deprecated_safe_2024(audit_that )]` must have a string value" ,
109109 )
110110 } ) ;
111111
112112 let sm = self . tcx . sess . source_map ( ) ;
113+ let guarantee = suggestion
114+ . as_ref ( )
115+ . map ( |suggestion| format ! ( "that {}" , suggestion) )
116+ . unwrap_or_else ( || String :: from ( "its unsafe preconditions" ) ) ;
113117 let suggestion = suggestion
114118 . and_then ( |suggestion| {
115- sm. indentation_before ( span)
116- . map ( |indent| format ! ( "{}// TODO: {}\n " , indent, suggestion) ) // ignore-tidy-todo
119+ sm. indentation_before ( span) . map ( |indent| {
120+ format ! ( "{}// TODO: Audit that {}.\n " , indent, suggestion) // ignore-tidy-todo
121+ } )
117122 } )
118123 . unwrap_or_default ( ) ;
119124
@@ -124,6 +129,7 @@ impl<'tcx> UnsafetyVisitor<'_, 'tcx> {
124129 CallToDeprecatedSafeFnRequiresUnsafe {
125130 span,
126131 function : with_no_trimmed_paths ! ( self . tcx. def_path_str( id) ) ,
132+ guarantee,
127133 sub : CallToDeprecatedSafeFnRequiresUnsafeSub {
128134 start_of_line_suggestion : suggestion,
129135 start_of_line : sm. span_extend_to_line ( span) . shrink_to_lo ( ) ,
0 commit comments