Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add phantom data for criterion output #68

Merged
merged 4 commits into from Jul 13, 2021

Conversation

YangKeao
Copy link
Member

Fix #66

Signed-off-by: YangKeao keao.yang@yahoo.com

Signed-off-by: YangKeao <keao.yang@yahoo.com>
@YangKeao YangKeao requested a review from Hexilee June 30, 2021 03:41
Signed-off-by: YangKeao <keao.yang@yahoo.com>
Signed-off-by: YangKeao <keao.yang@yahoo.com>
Signed-off-by: YangKeao <keao.yang@yahoo.com>
Copy link
Member

@Hexilee Hexilee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM.

@@ -51,6 +60,10 @@ impl<'a, 'b> Profiler for PProfProfiler<'a, 'b> {
Output::Flamegraph(_) => "flamegraph.svg",
#[cfg(feature = "protobuf")]
Output::Protobuf => "profile.pb",
// This is `""` but not `unreachable!()`, because `unreachable!()`
// will result in another compile error, so that the user may not
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can really unreachable!() cause compile error? I do not realize it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the only branch is "unreachable!()", the type of "filename" will be resolved as (), and it's illegal to pass filename to benchmark_dir.join.

Though, adding a redundant type annotation : &str to the filename will fix this issue, it will also bring a big warning (because the following statement is unreachable statement in that case), so I prefer to return an empty string, and let the compile_error prints the only error.

@YangKeao YangKeao merged commit 24baced into tikv:master Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cannot compile this crate
2 participants