Rollup merge of #152296 - jdonszelmann:port-rust-nonnull-guaranteed, r=jonathanbrouwer

Port `rust_nonnull_optimization_guaranteed` and `rustc_do_not_const_check` to the new attribute parser

r? @JonathanBrouwer another two of them :)
This commit is contained in:
Jacob Pratt 2026-02-16 04:28:57 -05:00 committed by GitHub
commit d1f3c9eea8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 62 additions and 13 deletions

View file

@ -5,10 +5,12 @@
//~| NOTE the `#[rustc_nonnull_optimization_guaranteed]` attribute is an internal implementation detail that will never be stable
//~| NOTE the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to document guaranteed niche optimizations in the standard library
//~| NOTE 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
fn main() {}
struct Foo {}
#[rustc_variance]
//~^ ERROR use of an internal attribute [E0658]
//~| NOTE the `#[rustc_variance]` attribute is an internal implementation detail that will never be stable
//~| NOTE the `#[rustc_variance]` attribute is used for rustc unit tests
enum E {}
fn main() {}