Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 443 Bytes

File metadata and controls

20 lines (14 loc) · 443 Bytes

An inherent implementation was marked unsafe.

Erroneous code example:

struct Foo;

unsafe impl Foo { } // error!

Inherent implementations (one that do not implement a trait but provide methods associated with a type) are always safe because they are not implementing an unsafe trait. Removing the unsafe keyword from the inherent implementation will resolve this error.

struct Foo;

impl Foo { } // ok!