about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2025-06-24 19:45:34 -0700
committerGitHub <noreply@github.com>2025-06-24 19:45:34 -0700
commitc3816350ef6f66476639bba5859111144a0d70bf (patch)
treec856ddde66f0e06d08a720eeabcdb71072163b76 /src
parentc062c495a0e9dce51921c6d319d9498ce1265a3e (diff)
parent84f92f3211726c4808453a25bc9be7b91d8cca53 (diff)
downloadrust-c3816350ef6f66476639bba5859111144a0d70bf.tar.gz
rust-c3816350ef6f66476639bba5859111144a0d70bf.zip
Rollup merge of #142977 - aDotInTheVoid:rustdochtml-targetfeature, r=GuillaumeGomez
rustdoc: Don't mark `#[target_feature]` functions as ⚠

Closes https://github.com/rust-lang/rust/issues/142952
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/render/print_item.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index 515424cbef1..e16acc9622f 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -469,7 +469,8 @@ fn item_module(cx: &Context<'_>, item: &clean::Item, items: &[clean::Item]) -> i
 
                     let unsafety_flag = match myitem.kind {
                         clean::FunctionItem(_) | clean::ForeignFunctionItem(..)
-                            if myitem.fn_header(tcx).unwrap().is_unsafe() =>
+                            if myitem.fn_header(tcx).unwrap().safety
+                                == hir::HeaderSafety::Normal(hir::Safety::Unsafe) =>
                         {
                             "<sup title=\"unsafe function\">⚠</sup>"
                         }