Rollup merge of #42953 - estebank:fix-20729, r=petrochenkov

Move type parameter shadowing test to `ui`

Fix #20729.
This commit is contained in:
Ariel Ben-Yehuda 2017-06-29 08:40:10 +00:00 committed by GitHub
commit 4f121542e9
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
error[E0194]: type parameter `T` shadows another type parameter of the same name
--> $DIR/shadowed-type-parameter.rs:30:27
|
27 | trait Bar<T> {
| - first `T` declared here
...
30 | fn shadow_in_required<T>(&self);
| ^ shadows another type parameter
error[E0194]: type parameter `T` shadows another type parameter of the same name
--> $DIR/shadowed-type-parameter.rs:33:27
|
27 | trait Bar<T> {
| - first `T` declared here
...
33 | fn shadow_in_provided<T>(&self) {}
| ^ shadows another type parameter
error[E0194]: type parameter `T` shadows another type parameter of the same name
--> $DIR/shadowed-type-parameter.rs:18:25
|
17 | impl<T> Foo<T> {
| - first `T` declared here
18 | fn shadow_in_method<T>(&self) {}
| ^ shadows another type parameter
error: aborting due to previous error(s)