Skip to content

Ensure that the return type of a function is Sized #18142

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
Oct 19, 2014

Conversation

arielb1
Copy link
Contributor

@arielb1 arielb1 commented Oct 18, 2014

Fixes #18107

r? @eddyb

// option. This file may not be copied, modified, or distributed
// except according to those terms.

// error-pattern: the return type of a function must have a statically
Copy link
Member

Choose a reason for hiding this comment

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

Can't this go on the error location itself?

@arielb1 arielb1 force-pushed the return-type-sized branch 5 times, most recently from 9df75ad to 633f0be Compare October 18, 2014 21:05
While no real rvalue of an unsized type can exist, a diverging function
can still "return" a value of such a type, which causes an ICE.

Fixes rust-lang#18107.
bors added a commit that referenced this pull request Oct 19, 2014
@bors bors closed this Oct 19, 2014
@bors bors merged commit 0eb17e3 into rust-lang:master Oct 19, 2014
@arielb1 arielb1 deleted the return-type-sized branch March 16, 2015 21:34
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 when returning trait by-value
4 participants