mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-27 11:05:06 +00:00
Delegation: allow foreign fns `reuse`
In example:
```rust
unsafe extern "C" {
fn foo();
}
reuse foo as bar;
```
Desugaring before:
```rust
fn bar() {
foo()
//~^ ERROR call to unsafe function `foo` is unsafe and requires unsafe function or block
}
```
after:
```rust
unsafe extern "C" fn bar() {
foo()
}
```
Fixes https://github.com/rust-lang/rust/issues/127412
r? `@petrochenkov`