Skip to content

Commit fface27

Browse files
Merge pull request #21244 from ChayimFriedman2/deprecated-safe
fix: `#[rustc_deprecated_safe_2024]` can also come as `#[rustc_deprecated_safe_2024(audit_that = "reason")]`
2 parents 6ff9f64 + fc265a2 commit fface27

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

crates/hir-def/src/attrs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ fn match_attr_flags(attr_flags: &mut AttrFlags, attr: Meta) -> ControlFlow<Infal
155155
"rustc_skip_during_method_dispatch" => {
156156
extract_rustc_skip_during_method_dispatch(attr_flags, tt)
157157
}
158+
"rustc_deprecated_safe_2024" => {
159+
attr_flags.insert(AttrFlags::RUSTC_DEPRECATED_SAFE_2024)
160+
}
158161
_ => {}
159162
},
160163
2 => match path.segments[0].text() {

crates/ide-diagnostics/src/handlers/missing_unsafe.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,12 @@ fn main() {
296296
#[rustc_deprecated_safe_2024]
297297
fn set_var() {}
298298
299+
#[rustc_deprecated_safe_2024(audit_that = "something")]
300+
fn set_var2() {}
301+
299302
fn main() {
300303
set_var();
304+
set_var2();
301305
}
302306
"#,
303307
);

0 commit comments

Comments
 (0)