summary refs log tree commit diff
path: root/compiler/rustc_feature/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-09-22 10:18:59 +0000
committerbors <bors@rust-lang.org>2024-09-22 10:18:59 +0000
commit4ae36d906f7f509e63aaa7ea99fdbefd1463eb96 (patch)
treed6ab8fa100c8469e3416ea9e74f178772571d727 /compiler/rustc_feature/src
parent80aa6fa7314bddcfe95a68f4eb426b296bfdf4a9 (diff)
parent8103505a4d9bcef3eb5715a41cc0eb08d92c05d5 (diff)
downloadrust-4ae36d906f7f509e63aaa7ea99fdbefd1463eb96.tar.gz
rust-4ae36d906f7f509e63aaa7ea99fdbefd1463eb96.zip
Auto merge of #130689 - RalfJung:rustc_nonnull_optimization_guaranteed, r=jieyouxu
fix rustc_nonnull_optimization_guaranteed docs

As far as I can tell, even back when this was [added](https://github.com/rust-lang/rust/pull/60300) it never *enabled* any optimizations. It just indicates that the FFI compat lint should accept those types for NPO.
Diffstat (limited to 'compiler/rustc_feature/src')
-rw-r--r--compiler/rustc_feature/src/builtin_attrs.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs
index fa5f152132a..efb582fde1b 100644
--- a/compiler/rustc_feature/src/builtin_attrs.rs
+++ b/compiler/rustc_feature/src/builtin_attrs.rs
@@ -859,8 +859,10 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
     rustc_attr!(
         rustc_nonnull_optimization_guaranteed, Normal, template!(Word), WarnFollowing,
         EncodeCrossCrate::Yes,
-        "the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to enable \
-        niche optimizations in libcore and libstd and will never be stable",
+        "the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to document \
+        guaranteed niche optimizations in libcore and libstd and will never be stable\n\
+        (note that the compiler does not even check whether the type indeed is being non-null-optimized; \
+        it is your responsibility to ensure that the attribute is only used on types that are optimized)",
     ),
 
     // ==========================================================================