Skip to content

Commit a29ba00

Browse files
authored
Rollup merge of rust-lang#68247 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC
Clean up err codes r? @Dylan-DPC
2 parents cba48b8 + 6f1bdb4 commit a29ba00

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/librustc_error_codes/error_codes/E0195.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Your method's lifetime parameters do not match the trait declaration.
1+
The lifetime parameters of the method do not match the trait declaration.
2+
23
Erroneous code example:
34

45
```compile_fail,E0195
@@ -16,7 +17,7 @@ impl Trait for Foo {
1617
}
1718
```
1819

19-
The lifetime constraint `'b` for bar() implementation does not match the
20+
The lifetime constraint `'b` for `bar()` implementation does not match the
2021
trait declaration. Ensure lifetime declarations match exactly in both trait
2122
declaration and implementation. Example:
2223

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1+
An inherent implementation was marked unsafe.
2+
3+
Erroneous code example:
4+
5+
```compile_fail,E0197
6+
struct Foo;
7+
8+
unsafe impl Foo { } // error!
9+
```
10+
111
Inherent implementations (one that do not implement a trait but provide
212
methods associated with a type) are always safe because they are not
313
implementing an unsafe trait. Removing the `unsafe` keyword from the inherent
414
implementation will resolve this error.
515

6-
```compile_fail,E0197
16+
```
717
struct Foo;
818
9-
// this will cause this error
10-
unsafe impl Foo { }
11-
// converting it to this will fix it
12-
impl Foo { }
19+
impl Foo { } // ok!
1320
```

0 commit comments

Comments
 (0)