diff options
| author | bors <bors@rust-lang.org> | 2020-01-19 14:06:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-01-19 14:06:57 +0000 |
| commit | c0e02ad724f05f73b957b3d6f6314a9a2e5c284e (patch) | |
| tree | 7c54dabdc1a8a57a5da2d78f5c87b21971428cbf /src/librustc_error_codes/error_codes | |
| parent | 6250d56355d72264ece721e8d0dc95b16a6824b1 (diff) | |
| parent | d276e6942ea1af5c1ad79743e7f0ee797010023f (diff) | |
| download | rust-c0e02ad724f05f73b957b3d6f6314a9a2e5c284e.tar.gz rust-c0e02ad724f05f73b957b3d6f6314a9a2e5c284e.zip | |
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
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0195.md | 5 | ||||
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0197.md | 17 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/librustc_error_codes/error_codes/E0195.md b/src/librustc_error_codes/error_codes/E0195.md index 3606521020a..b8c313d412e 100644 --- a/src/librustc_error_codes/error_codes/E0195.md +++ b/src/librustc_error_codes/error_codes/E0195.md @@ -1,4 +1,5 @@ -Your method's lifetime parameters do not match the trait declaration. +The lifetime parameters of the method do not match the trait declaration. + Erroneous code example: ```compile_fail,E0195 @@ -16,7 +17,7 @@ impl Trait for Foo { } ``` -The lifetime constraint `'b` for bar() implementation does not match the +The lifetime constraint `'b` for `bar()` implementation does not match the trait declaration. Ensure lifetime declarations match exactly in both trait declaration and implementation. Example: diff --git a/src/librustc_error_codes/error_codes/E0197.md b/src/librustc_error_codes/error_codes/E0197.md index 0d91157e572..c142b8f3664 100644 --- a/src/librustc_error_codes/error_codes/E0197.md +++ b/src/librustc_error_codes/error_codes/E0197.md @@ -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! ``` |
