]> git.lizzy.rs Git - rust.git/commitdiff
Merge #7619
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Wed, 10 Feb 2021 08:25:12 +0000 (08:25 +0000)
committerGitHub <noreply@github.com>
Wed, 10 Feb 2021 08:25:12 +0000 (08:25 +0000)
7619: Add #[track_caller] to assist tests r=matklad a=yoshuawuyts

This points the source of a failed assertion to the code which called it, rather than the location within the assertion helper method. While working on https://github.com/rust-analyzer/rust-analyzer/pull/7617 I had trouble locating some failing tests, and it was only by adding these attributes during development that I was able to locate them.

This is only applied to test helpers, which means it comes at no runtime cost. And even then: I didn't experience any noticeable performance with this enabled or disabled. Mostly just a more pleasant experience debugging test failures (:

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>

No differences found