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

option is_some() should not require a copyable value #2636

Closed
nikomatsakis opened this issue Jun 16, 2012 · 2 comments
Closed

option is_some() should not require a copyable value #2636

nikomatsakis opened this issue Jun 16, 2012 · 2 comments

Comments

@nikomatsakis
Copy link
Contributor

But it does now. Same with is_none(), iter(), and map() I believe. And possibly others.

@eholk
Copy link
Contributor

eholk commented Jun 18, 2012

Does this go for vectors too? I think I've been having to add copy bounds, but if we're clever we should be able to rewrite them without needing copy.

@nikomatsakis
Copy link
Contributor Author

It often applies to vectors, yes.

@brson brson closed this as completed in ff536f3 Jun 18, 2012
RalfJung pushed a commit to RalfJung/rust that referenced this issue Nov 6, 2022
Stacked Borrows: make scalar field retagging the default

I think it is time to finally close this soundness gap. Any objections? :)

Unfortunately the latest released versions of hashbrown and scopeguard can fail under full field retagging. The fixes have landed in the git repos but have not been released yet. I don't know if scalar field retagging as enabled by this PR is sufficient to cause problems with these crates, but it seems likely that this would be the case -- e.g. if both `value` and `dropfn` are scalars, the entire scopeguard struct will be a `ScalarPair` and thus get field retagging.

However, given that we actually generate LLVM `noalias` for these cases, it seems prudent to inform users of this risk. They can easily set `-Zmiri-field-retag=none` to opt-out of this change.

Cc rust-lang/miri#2528
Aaron1011 pushed a commit to Aaron1011/rust that referenced this issue Jan 6, 2023
Stacked Borrows: make scalar field retagging the default

I think it is time to finally close this soundness gap. Any objections? :)

Unfortunately the latest released versions of hashbrown and scopeguard can fail under full field retagging. The fixes have landed in the git repos but have not been released yet. I don't know if scalar field retagging as enabled by this PR is sufficient to cause problems with these crates, but it seems likely that this would be the case -- e.g. if both `value` and `dropfn` are scalars, the entire scopeguard struct will be a `ScalarPair` and thus get field retagging.

However, given that we actually generate LLVM `noalias` for these cases, it seems prudent to inform users of this risk. They can easily set `-Zmiri-field-retag=none` to opt-out of this change.

Cc rust-lang/miri#2528
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

No branches or pull requests

3 participants