Skip to content

Commit 401e04d

Browse files
committed
Rollup merge of rust-lang#27644 - AlisdairO:diagnostics194, r=Manishearth
As title :-) Part of rust-lang#24407. r? @Manishearth This will need merging with E0193, so probably want to delay any r+ until that goes in and I can merge myself.
2 parents 8f83e2c + fef60c0 commit 401e04d

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/librustc_typeck/diagnostics.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1843,6 +1843,22 @@ Since we know for certain that Wrapper<u32> implements Clone, there's no reason
18431843
to also specify it in a `where` clause.
18441844
"##,
18451845

1846+
E0194: r##"
1847+
A type parameter was declared which shadows an existing one. An example of this
1848+
error:
1849+
1850+
```
1851+
trait Foo<T> {
1852+
fn do_something(&self) -> T;
1853+
fn do_something_else<T: Clone>(&self, bar: T);
1854+
}
1855+
```
1856+
1857+
In this example, the trait `Foo` and the trait method `do_something_else` both
1858+
define a type parameter `T`. This is not allowed: if the method wishes to
1859+
define a type parameter, it must use a different name for it.
1860+
"##,
1861+
18461862
E0195: r##"
18471863
Your method's lifetime parameters do not match the trait declaration.
18481864
Erroneous code example:
@@ -2598,7 +2614,6 @@ register_diagnostics! {
25982614
E0188, // can not cast a immutable reference to a mutable pointer
25992615
E0189, // deprecated: can only cast a boxed pointer to a boxed object
26002616
E0190, // deprecated: can only cast a &-pointer to an &-object
2601-
E0194,
26022617
E0196, // cannot determine a type for this closure
26032618
E0203, // type parameter has more than one relaxed default bound,
26042619
// and only one is supported

0 commit comments

Comments
 (0)