Allow and add track_caller to generators
This patch allows the usage of the `track_caller` annotation on generators, as well as sets them conditionally if the parent also has `track_caller` set. Also add this annotation on the `GenFuture`'s `poll()` function.
This commit is contained in:
parent
3db41d13f0
commit
fa99cb8269
3 changed files with 42 additions and 27 deletions
|
|
@ -70,6 +70,6 @@ fn panicked_at(f: impl FnOnce() + panic::UnwindSafe) -> u32 {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
assert_eq!(panicked_at(|| block_on(foo())), 39);
|
||||
assert_eq!(panicked_at(|| block_on(foo_track_caller())), 52);
|
||||
assert_eq!(panicked_at(|| block_on(foo())), 40);
|
||||
assert_eq!(panicked_at(|| block_on(foo_track_caller())), 53);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue