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

Function declaration requires sized lang item #18828

Closed
klutzy opened this issue Nov 10, 2014 · 3 comments
Closed

Function declaration requires sized lang item #18828

klutzy opened this issue Nov 10, 2014 · 3 comments

Comments

@klutzy
Copy link
Contributor

klutzy commented Nov 10, 2014

#![no_std]
fn main() {}
error: requires `sized` lang_item
error: aborting due to previous error

Not sure it's intended or not.

cc #15788

@japaric
Copy link
Member

japaric commented Nov 10, 2014

You need to add:

#[lang = "sized"]
trait Sized {}

to your source file. The error message should recommend that.

See #17392 and #17468

@alexcrichton
Copy link
Member

I'll note that the intention for #![no_std] users is to almost always include an extern crate core which is intended to take care of problems such as this.

We may not want to invest too much energy into this as lang items are a feature gate as they're pretty unstable. They change pretty regularly and providing a high-quality experience is sadly just not a priority right now.

@alexcrichton
Copy link
Member

I believe this is basically working as expected and otherwise I'm going to close this in favor of #27394

lnicola added a commit to lnicola/rust that referenced this issue Jan 7, 2025
minor: Add description field to edition manifest
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

4 participants