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

Fix dropping_references warning #388

Merged
merged 5 commits into from
Oct 20, 2023

Conversation

newAM
Copy link
Member

@newAM newAM commented Oct 20, 2023

Please do review this carefully. I'm not confident this (the fix and the test) is correct. Note there is unsafe in impl Drop for Vec which is the backend data structure for LinearMap.

A couple CI failures will still occur, see #387.

@newAM newAM linked an issue Oct 20, 2023 that may be closed by this pull request
@newAM newAM requested a review from Dirbaio October 20, 2023 13:46
Dirbaio
Dirbaio previously approved these changes Oct 20, 2023
Copy link
Member

@Dirbaio Dirbaio left a comment

Choose a reason for hiding this comment

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

LGTM. I'm not sure what was up with that drop code lol, the underlying Vec will already drop the contents fine.

I've merged #387 into this one because there's no way to merge them separately if CI fails.

@Dirbaio
Copy link
Member

Dirbaio commented Oct 20, 2023

omg there's also a tsan test failing

from [this](https://doc.rust-lang.org/beta/unstable-book/compiler-flags/sanitizer.html#threadsanitizer)

> To work correctly ThreadSanitizer needs to be "aware" of all synchronization operations in a program. It generally achieves that through \[...\] and compile time instrumentation (e.g. atomic operations). Using it without instrumenting all the program code can lead to false positive reports.

and the example uses -Zbuild-std ... of course, std has to be instrumented. Adding -Zbuild-std fixes it, indeed.
@Dirbaio Dirbaio added this pull request to the merge queue Oct 20, 2023
Merged via the queue into rust-embedded:main with commit 40468da Oct 20, 2023
69 checks passed
@newAM newAM deleted the fix-linear-map-drop branch October 20, 2023 22:12
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.

drop reference in linear_map.rs:L467
2 participants