Port rustc_nonnull_optimization_guaranteed to the new attribute parser

This commit is contained in:
Jana Dönszelmann 2026-02-07 16:01:11 +01:00
parent 47ca78040a
commit 12e6628977
No known key found for this signature in database
8 changed files with 27 additions and 6 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() {}