Skip to content

Don't use untrusted Deref/DerefMut traits for generic backends #529

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

Closed
bluss opened this issue Apr 24, 2016 · 1 comment
Closed

Don't use untrusted Deref/DerefMut traits for generic backends #529

bluss opened this issue Apr 24, 2016 · 1 comment
Labels
discussion draft Add if this issue includes suggested code, compares interfaces, preparses wording,etc

Comments

@bluss
Copy link
Contributor

bluss commented Apr 24, 2016

These traits are simply not reliable for "backend" generics, i.e. when you need to trust the implementor for some kind of temporal consistency (that the length they tell you about is consistent with what the slice the deref call returns the next time it's called and so on).

See also rust-lang/rust#29701 and rust-lang/rust#29701 (comment) for context.

@bvssvni bvssvni added discussion draft Add if this issue includes suggested code, compares interfaces, preparses wording,etc labels Apr 29, 2016
@HeroicKatora
Copy link
Member

I'm not aware of any unsafe usage anymore. All remaining usages might panic if the traits are not implemented as expected but that is within their right for such a contract violation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion draft Add if this issue includes suggested code, compares interfaces, preparses wording,etc
Projects
None yet
Development

No branches or pull requests

3 participants