Closed
Description
When writing a lot of unsafe code you often find yourself having to make just some parts of your functions unsafe, however the requirement to use unsafe blocks often makes it nicer to just wrap the function body in unsafe {}
.
I want to propose allowing bracketless unsafe
for making a single expression unsafe, for example retrieving a global variable require code like this:
let a = unsafe { global.get() };
This could be rewritten to:
let a = unsafe global.get();
It also becomes usefule when matching on globals:
match unsafe { global } {
...
}
// vs
match unsafe global {
...
}
Metadata
Metadata
Assignees
Labels
No labels