File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change @@ -559,3 +559,28 @@ fn slices() {
559559 }
560560 }
561561}
562+
563+ #[ test]
564+ fn fn_defs ( ) {
565+ lowering_success ! {
566+ program {
567+ trait Quux { }
568+
569+ fn foo<' a, T >( bar: T , baz: & ' a mut T ) -> u32
570+ where T : Quux ;
571+ }
572+ }
573+
574+ lowering_error ! {
575+ program {
576+ trait Quux { }
577+
578+ fn foo<T >( bar: TT ) -> T
579+ where T : Quux ;
580+ }
581+
582+ error_msg {
583+ "invalid type name `TT`"
584+ }
585+ }
586+ }
Original file line number Diff line number Diff line change @@ -23,3 +23,42 @@ fn functions_are_sized() {
2323 }
2424 }
2525}
26+
27+ #[ test]
28+ fn fn_defs ( ) {
29+ test ! {
30+ program {
31+ trait Foo { }
32+
33+ struct Bar { }
34+
35+ struct Xyzzy { }
36+ impl Foo for Xyzzy { }
37+
38+ fn baz<T >( quux: T ) -> T
39+ where T : Foo ;
40+
41+ fn garply( thud: i32 ) -> i32 ;
42+ }
43+
44+ goal {
45+ WellFormed ( baz<Bar >)
46+ } yields {
47+ "No possible solution"
48+ }
49+
50+ goal {
51+ WellFormed ( baz<Xyzzy >)
52+ } yields {
53+ "Unique"
54+ }
55+
56+ goal {
57+ WellFormed ( garply)
58+ } yields {
59+ "Unique"
60+ }
61+
62+
63+ }
64+ }
You can’t perform that action at this time.
0 commit comments