-
Notifications
You must be signed in to change notification settings - Fork 22
Conversation
looks like clippy needs to be disabled or get some tuning before things will pass |
f71a3fa
to
81588ec
Compare
@jrmuizel @ErichDonGubler if you want to take a look, this cleans up clippy and makes ComPtr as close to sound as we'll reasonably get |
@msiglreith any chance of removing appveyor from this repository? |
lgtm |
@cwfitzgerald I removed the project on appveyor including the registered webhook - not sure if there is something left or it just doesn't update right away |
should probably also delete the |
Great, seems to have worked! Thanks! |
// and only then cast it. As if we cast it, then take a reference, we would | ||
// end up with a reference to a temporary. | ||
let refer: &mut *mut T = &mut self.0; | ||
let void: *mut *mut c_void = refer.cast(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In retrospect, this was incorrect, and sets void to self.0 as *mut *mut c_void
instead of &mut self.0 as *mut *mut T as *mut *mut c_void
, because .cast applies to the primitive pointer *mut T
by reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to the problem that @kdashg points out, there's another issue here: the &mut *mut void
extracted here is actually a reference to a *mut c_void
temporary in this method, whose lifetime is incorrectly inferred through the pointer deref. (because rustc
trusts us to get the lifetime right). This becomes insta-UB; a reference to a binding in a popped stack is no bueno. 😓
I don't think it makes sense to use mutable references here, TBH. I'll fix this up in gfx-rs/wgpu#3987, which vendors in this crate (and will likely result in this repository being archived, for the time being). EDIT: Change of plan, gonna "just" vendor in 0.7.0, which doesn't have this breakage.
CC @jrmuizel; I think he'd want to know about these issues.
No description provided.