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 C API const qualifiers #113

Merged
merged 2 commits into from
Jun 2, 2020
Merged

Add C API const qualifiers #113

merged 2 commits into from
Jun 2, 2020

Conversation

jonlamb-gh
Copy link
Collaborator

No description provided.

unsafe {
core::intrinsics::abort();
}
core::intrinsics::abort();
Copy link
Contributor

Choose a reason for hiding this comment

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

What happened to make this okay to call without an unsafe block? The documentation still lists this function as unsafe. (Same question for below)

Copy link
Collaborator Author

@jonlamb-gh jonlamb-gh Jun 2, 2020

Choose a reason for hiding this comment

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

Ran across this while cleaning up the warnings:

warning: unnecessary `unsafe` block
   --> src/lib.rs:232:5
    |
232 |     unsafe {
    |     ^^^^^^ unnecessary `unsafe` block
    |
    = note: `#[warn(unused_unsafe)]` on by default

warning: unnecessary `unsafe` block
   --> src/lib.rs:240:5
    |
240 |     unsafe {
    |     ^^^^^^ unnecessary `unsafe` block

warning: 2 warnings emitted

    Finished dev [unoptimized + debuginfo] target(s) in 0.48s

I haven't chased this one down yet, wonder if we should instead decorate them with allow(unused_unsafe) for now?

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe I found the relevant change. rust-lang/rust#72204. Hasn't hit stable, but c'est la vie. No change necessary here.

@@ -539,20 +538,12 @@ impl<'a> DynamicHistory<'a> {
if external_clock.count == 0 {
continue;
}
let id: TracerId = match external_clock.id.try_into() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch that this check isn't strictly necessary anymore.

Copy link
Contributor

@ZackPierce ZackPierce left a comment

Choose a reason for hiding this comment

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

👍

@jonlamb-gh jonlamb-gh merged commit 9c10be7 into master Jun 2, 2020
@jonlamb-gh jonlamb-gh deleted the const-qualifiers branch June 2, 2020 18:21
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.

2 participants