Skip to content

Commit 34fe1f0

Browse files
committed
adjust a test
I think it's more easily readable this way
1 parent 52882f6 commit 34fe1f0

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
// Make sure that users can construct structs through associated types
2-
// in both expressions and patterns
1+
// Check that fully qualified syntax can be used in struct expressions in patterns.
2+
// In other words, check that structs can constructed and destructed via an associated type.
33

44
#![feature(more_qualified_paths)]
55

6-
//@ check-pass
76
fn main() {
8-
let <Foo as A>::Assoc { br } = <Foo as A>::Assoc { br: 2 };
9-
assert!(br == 2);
7+
let <Type as Trait>::Assoc { field } = <Type as Trait>::Assoc { field: 2 };
8+
assert_eq!(field, 2);
109
}
1110

12-
struct StructStruct {
13-
br: i8,
11+
struct Struct {
12+
field: i8,
1413
}
1514

16-
struct Foo;
15+
struct Type;
1716

18-
trait A {
17+
trait Trait {
1918
type Assoc;
2019
}
2120

22-
impl A for Foo {
23-
type Assoc = StructStruct;
21+
impl Trait for Type {
22+
type Assoc = Struct;
2423
}

0 commit comments

Comments
 (0)