trait Foo {
extern "Rust" unsafe fn foo();
}
impl Foo for () {
extern "Rust" unsafe fn foo() {}
}
unsafe extern "Rust" fn foo() {}
fn main() {}
Here unsafe comes after extern in the Foo’s definition and implementation, but it comes before in the extern in the top-level function foo. I think foo’s order seems the most natural (and would be the most common use anyway), so I would assume that it has the intended order.