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

Can't use deriving with #![no_std] #16803

Closed
kmcallister opened this issue Aug 27, 2014 · 2 comments
Closed

Can't use deriving with #![no_std] #16803

kmcallister opened this issue Aug 27, 2014 · 2 comments
Assignees

Comments

@kmcallister
Copy link
Contributor

#![no_std]

extern crate core;
extern crate native;

#[deriving(PartialEq)]
struct Foo;

fn main() { }

gives

foo.rs:6:12: 6:15 error: failed to resolve. Maybe a missing `extern crate std`?
foo.rs:6 #[deriving(PartialEq)]
                    ^~~
note: in expansion of #[deriving]
foo.rs:6:1: 6:23 note: expansion site
foo.rs:6:12: 6:21 error: attempt to implement a nonexistent trait `std::cmp::PartialEq`
foo.rs:6 #[deriving(PartialEq)]
                    ^~~~~~~~~
note: in expansion of #[deriving]
foo.rs:6:1: 6:23 note: expansion site
error: aborting due to 2 previous errors

requiring this workaround:

mod std {
    pub use core::cmp;
}

rustc 0.12.0-pre (e11cb5b 2014-08-20 16:25:53 +0000)

@kmcallister
Copy link
Contributor Author

Working on this.

@huonw
Copy link
Member

huonw commented Sep 7, 2014

Cc me

kmcallister added a commit to kmcallister/rust that referenced this issue Sep 14, 2014
@kmcallister kmcallister self-assigned this Jan 16, 2015
kmcallister added a commit that referenced this issue Feb 3, 2015
…] crate

Fixes #16803.
Fixes #14342.
Fixes half of #21827 -- slice syntax is still broken.
kmcallister added a commit to kmcallister/rust that referenced this issue Feb 5, 2015
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

2 participants