@@ -102,18 +102,23 @@ impl<'tcx> UnsafetyVisitor<'_, 'tcx> {
102
102
. meta_item_list ( )
103
103
. unwrap_or_default ( )
104
104
. into_iter ( )
105
- . find ( |item| item. has_name ( sym:: todo ) )
105
+ . find ( |item| item. has_name ( sym:: audit_that ) )
106
106
. map ( |item| {
107
107
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" ,
109
109
)
110
110
} ) ;
111
111
112
112
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" ) ) ;
113
117
let suggestion = suggestion
114
118
. 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
+ } )
117
122
} )
118
123
. unwrap_or_default ( ) ;
119
124
@@ -124,6 +129,7 @@ impl<'tcx> UnsafetyVisitor<'_, 'tcx> {
124
129
CallToDeprecatedSafeFnRequiresUnsafe {
125
130
span,
126
131
function : with_no_trimmed_paths ! ( self . tcx. def_path_str( id) ) ,
132
+ guarantee,
127
133
sub : CallToDeprecatedSafeFnRequiresUnsafeSub {
128
134
start_of_line_suggestion : suggestion,
129
135
start_of_line : sm. span_extend_to_line ( span) . shrink_to_lo ( ) ,
0 commit comments