]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-cast.rs
Rollup merge of #98609 - TaKO8Ki:fix-ice-for-associated-constant-generics, r=lcnr
[rust.git] / src / test / ui / consts / const-cast.rs
1 // run-pass
2 #![allow(non_upper_case_globals)]
3
4 struct TestStruct {
5     x: *const u8,
6 }
7
8 unsafe impl Sync for TestStruct {}
9
10 extern "C" fn foo() {}
11 const x: extern "C" fn() = foo;
12 static y: TestStruct = TestStruct { x: x as *const u8 };
13
14 pub fn main() {
15     assert_eq!(x as *const u8, y.x);
16 }