Closed
Description
I would expect that interfaces and implementations would support declaring a function as unsafe but it doesn't seem to work:
impl foo for [u8] {
unsafe fn from_bytes() -> str { str::unsafe::from_bytes(self) }
}
fn main() {}
Errors out with this:
test.rs:2:4: 2:10 error: expecting fn, found unsafe
test.rs:2 unsafe fn from_bytes() -> str {
^~~~~~
Metadata
Metadata
Assignees
Labels
No labels