Skip to content

Commit 1e41dcd

Browse files
committed
lexical-scopes
1 parent 4eb27c5 commit 1e41dcd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/ui/shadowed/shadowing-generic-item.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Test that generic parameters shadow structs and modules with the same name.
2+
13
struct T { i: i32 }
24
fn f<T>() {
35
let t = T { i: 0 }; //~ ERROR expected struct, variant or union type, found type parameter `T`

tests/ui/shadowed/shadowing-generic-item.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0574]: expected struct, variant or union type, found type parameter `T`
2-
--> $DIR/lexical-scopes.rs:3:13
2+
--> $DIR/shadowing-generic-item.rs:5:13
33
|
44
LL | struct T { i: i32 }
55
| - you might have meant to refer to this struct
@@ -9,7 +9,7 @@ LL | let t = T { i: 0 };
99
| ^ not a struct, variant or union type
1010

1111
error[E0599]: no function or associated item named `f` found for type parameter `Foo` in the current scope
12-
--> $DIR/lexical-scopes.rs:10:10
12+
--> $DIR/shadowing-generic-item.rs:12:10
1313
|
1414
LL | fn g<Foo>() {
1515
| --- function or associated item `f` not found for this type parameter

0 commit comments

Comments
 (0)