File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1716,7 +1716,8 @@ impl<'a> Generator<'a> {
1716
1716
fn __test_static_{name}() -> {ty};
1717
1717
}}
1718
1718
unsafe {{
1719
- same(*(&{name} as *const _ as *const {ty}) as usize,
1719
+ // We must use addr_of! here because of https://github.com/rust-lang/rust/issues/114447
1720
+ same(*(std::ptr::addr_of!({name}) as *const {ty}) as usize,
1720
1721
__test_static_{name}() as usize,
1721
1722
"{name} static");
1722
1723
}}
@@ -1760,7 +1761,8 @@ impl<'a> Generator<'a> {
1760
1761
fn __test_static_{name}() -> *{mutbl} {ty};
1761
1762
}}
1762
1763
unsafe {{
1763
- same(&{name} as *const _ as usize,
1764
+ // We must use addr_of! here because of https://github.com/rust-lang/rust/issues/114447
1765
+ same(std::ptr::addr_of!({name}) as usize,
1764
1766
__test_static_{name}() as usize,
1765
1767
"{name} static");
1766
1768
}}
@@ -1804,7 +1806,8 @@ impl<'a> Generator<'a> {
1804
1806
fn __test_static_{name}() -> *{mutbl} {ty};
1805
1807
}}
1806
1808
unsafe {{
1807
- same(&{name} as *const _ as usize,
1809
+ // We must use addr_of! here because of https://github.com/rust-lang/rust/issues/114447
1810
+ same(std::ptr::addr_of!({name}) as usize,
1808
1811
__test_static_{name}() as usize,
1809
1812
"{name} static");
1810
1813
}}
You can’t perform that action at this time.
0 commit comments