Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up err codes #68247

Merged
merged 2 commits into from
Jan 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/librustc_error_codes/error_codes/E0195.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:

Expand Down
17 changes: 12 additions & 5 deletions src/librustc_error_codes/error_codes/E0197.md
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!
```