-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #68363 - Dylan-DPC:rollup-33enndv, r=Dylan-DPC
Rollup of 3 pull requests Successful merges: - #67682 ([const-prop] Remove useless typedef) - #68247 (Clean up err codes) - #68348 (Make iter::Empty<T> Send and Sync for any T) Failed merges: r? @ghost
- Loading branch information
Showing
5 changed files
with
26 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
An inherent implementation was marked unsafe. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0197 | ||
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. | ||
|
||
```compile_fail,E0197 | ||
``` | ||
struct Foo; | ||
// this will cause this error | ||
unsafe impl Foo { } | ||
// converting it to this will fix it | ||
impl Foo { } | ||
impl Foo { } // ok! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters