about summary refs log tree commit diff
path: root/tests/ui
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 /tests/ui
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 'tests/ui')
-rw-r--r--tests/ui/feature-gates/feature-gate-rustc-attrs-1.rs2
-rw-r--r--tests/ui/feature-gates/feature-gate-rustc-attrs-1.stderr3
2 files changed, 3 insertions, 2 deletions
diff --git a/tests/ui/feature-gates/feature-gate-rustc-attrs-1.rs b/tests/ui/feature-gates/feature-gate-rustc-attrs-1.rs
index 667bc9f8ddf..7ae4a8d911b 100644
--- a/tests/ui/feature-gates/feature-gate-rustc-attrs-1.rs
+++ b/tests/ui/feature-gates/feature-gate-rustc-attrs-1.rs
@@ -2,6 +2,6 @@
 
 #[rustc_variance] //~ ERROR the `#[rustc_variance]` attribute is just used for rustc unit tests and will never be stable
 #[rustc_error] //~ ERROR the `#[rustc_error]` attribute is just used for rustc unit tests and will never be stable
-#[rustc_nonnull_optimization_guaranteed] //~ ERROR the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to enable niche optimizations in libcore and libstd and will never be stable
+#[rustc_nonnull_optimization_guaranteed] //~ ERROR the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to document guaranteed niche optimizations in libcore and libstd and will never be stable
 
 fn main() {}
diff --git a/tests/ui/feature-gates/feature-gate-rustc-attrs-1.stderr b/tests/ui/feature-gates/feature-gate-rustc-attrs-1.stderr
index 8177d5ef6be..8c3a8eb2df8 100644
--- a/tests/ui/feature-gates/feature-gate-rustc-attrs-1.stderr
+++ b/tests/ui/feature-gates/feature-gate-rustc-attrs-1.stderr
@@ -16,7 +16,8 @@ LL | #[rustc_error]
    = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error[E0658]: the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to enable niche optimizations in libcore and libstd and will never be stable
+error[E0658]: the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to document guaranteed niche optimizations in libcore and libstd and will never be stable
+              (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)
   --> $DIR/feature-gate-rustc-attrs-1.rs:5:1
    |
 LL | #[rustc_nonnull_optimization_guaranteed]