about summary refs log tree commit diff
path: root/tests/ui/darwin-objc/darwin-objc-bad-const.rs
blob: ccf28697b482afc2f5dc194ff7eb7d5b868adac4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Test that `objc::class!` and `objc::selector!` aren't `const` expressions.
// The system gives them their final values at dynamic load time.

//@ edition: 2024
//@ only-apple

#![feature(darwin_objc)]

use std::os::darwin::objc;

pub const CLASS: objc::Class = objc::class!("NSObject");
//~^ ERROR cannot access extern static `CLASS::VAL` [E0080]

pub const SELECTOR: objc::SEL = objc::selector!("alloc");
//~^ ERROR cannot access extern static `SELECTOR::VAL` [E0080]

pub fn main() {}