Skip to content

Commit 79021b0

Browse files
committed
Add regression test
1 parent e2cf2cb commit 79021b0

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
mod baz {
2+
struct Foo;
3+
4+
pub trait Trait {
5+
type Assoc;
6+
}
7+
8+
impl Trait for Foo {
9+
type Assoc = ();
10+
}
11+
12+
pub struct Bar<'a, T: Trait> {
13+
source: &'a T::Assoc,
14+
//~^ ERROR: type `Foo` is private
15+
}
16+
17+
pub struct Baz<'a> {
18+
mode: Bar<'a, Foo>,
19+
}
20+
}
21+
22+
pub struct Struct<'a> {
23+
lexer: baz::Baz<'a>,
24+
}
25+
26+
fn main() {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: type `Foo` is private
2+
--> $DIR/generic_struct_field_projection.rs:13:9
3+
|
4+
LL | source: &'a T::Assoc,
5+
| ^^^^^^^^^^^^^^^^^^^^ private type
6+
7+
error: aborting due to 1 previous error
8+

0 commit comments

Comments
 (0)