@@ -94,12 +94,10 @@ impl<'tcx> UnsafetyVisitor<'_, 'tcx> {
94
94
fn emit_deprecated_safe_fn_call ( & self , span : Span , kind : & UnsafeOpKind ) -> bool {
95
95
fn parse_rustc_deprecated_safe_2024_attr ( attr : & Attribute ) -> Option < Symbol > {
96
96
for item in attr. meta_item_list ( ) . unwrap_or_default ( ) {
97
- if item. has_name ( sym:: todo) {
98
- return Some (
99
- item. value_str ( ) . expect (
100
- "`#[rustc_deprecated_safe_2024(todo)]` must have a string value" ,
101
- ) ,
102
- ) ;
97
+ if item. has_name ( sym:: audit_that) {
98
+ return Some ( item. value_str ( ) . expect (
99
+ "`#[rustc_deprecated_safe_2024(audit_that)]` must have a string value" ,
100
+ ) ) ;
103
101
}
104
102
}
105
103
None
@@ -115,10 +113,15 @@ impl<'tcx> UnsafetyVisitor<'_, 'tcx> {
115
113
let suggestion = parse_rustc_deprecated_safe_2024_attr ( attr) ;
116
114
117
115
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" ) ) ;
118
120
let suggestion = suggestion
119
121
. 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
+ } )
122
125
} )
123
126
. unwrap_or_default ( ) ;
124
127
@@ -129,6 +132,7 @@ impl<'tcx> UnsafetyVisitor<'_, 'tcx> {
129
132
CallToDeprecatedSafeFnRequiresUnsafe {
130
133
span,
131
134
function : with_no_trimmed_paths ! ( self . tcx. def_path_str( id) ) ,
135
+ guarantee,
132
136
sub : CallToDeprecatedSafeFnRequiresUnsafeSub {
133
137
start_of_line_suggestion : suggestion,
134
138
start_of_line : sm. span_extend_to_line ( span) . shrink_to_lo ( ) ,
0 commit comments