File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,23 @@ trait Ticks {
55 fn foo ( & self ) -> Self ;
66}
77
8- #[ flux:: no_panic]
8+ // `call_ticks_0` and `call_ticks_1` should have identical behavior, but
9+ // right now, they don't because of the way we handle closures: closures
10+ // only inherit their `no_panic` status from the first parent who is annotated
11+ // with `no_panic`, effectively ignoring the `no_panic_if` annotation on `call_ticks_0`.
12+ // Boo!
13+ #[ flux:: sig( fn ( _) -> ( ) ) ]
14+ #[ flux:: no_panic_if( true ) ]
915fn call_ticks_0 < T : Ticks > ( a : T ) {
10- // this (correctly) errors
11- a. foo ( ) ; //~ ERROR may panic
16+ let x = || {
17+ a. foo ( ) ; //~ ERROR may panic
18+ } ;
1219}
1320
14- #[ flux:: no_panic_if( true ) ]
21+ #[ flux:: sig( fn ( _) -> ( ) ) ]
22+ #[ flux:: no_panic]
1523fn call_ticks_1 < T : Ticks > ( a : T ) {
16- // this (buggy) for now, does not.
17- a. foo ( ) ; //~ ERROR may panic
24+ let x = || {
25+ a. foo ( ) ; //~ ERROR may panic
26+ } ;
1827}
You can’t perform that action at this time.
0 commit comments