Skip to content

Forbid unsized rvalues #16933

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

Merged
merged 1 commit into from
Sep 8, 2014
Merged

Forbid unsized rvalues #16933

merged 1 commit into from
Sep 8, 2014

Conversation

nrc
Copy link
Member

@nrc nrc commented Sep 2, 2014

Closes #16813

r? @nikomatsakis I feel like I should be checking more things in check_rvalues, but not sure what - I don't properly understand expr_use_visitor

@nikomatsakis
Copy link
Contributor

@nick29581 see comments, basically looks good but I think the analysis is too narrow. Also, it occurs to me: I think we should ensure that the criteria for a value being considered affine includes "unsized". That is, Trait and [int] are always affine types. This...probably doesn't matter too much, since you couldn't implicitly copy them anywhere anyway, but it's important if we ever do want to support passing or moving by value in any circumstance.

@nrc
Copy link
Member Author

nrc commented Sep 3, 2014

With requested changes. @nikomatsakis r?

@sfackler
Copy link
Member

sfackler commented Sep 7, 2014

Tidy failures

bors added a commit that referenced this pull request Sep 8, 2014
Closes #16813 

r? @nikomatsakis I feel like I should be checking more things in check_rvalues, but not sure what - I don't properly understand expr_use_visitor
@bors bors closed this Sep 8, 2014
@bors bors merged commit 742f49c into rust-lang:master Sep 8, 2014
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.

ICE: assertion failed: ty::type_is_sized(bcx.tcx(), contents_ty)
4 participants